Jump to content

DamageScreen


shaun

Recommended Posts

Salut all....

Poate v-ati intrebat cateodata,jucandu-va pe alte servere..cum sa faceti sa se vada ecranul rosu cand playerul pierde viatza...cam ca aici ->

http://www.xfire.com/video/2003aa/

Simplu....

Un scripter,SilentHuntR,a inventat un include,care face posibil  aceast Damage effect

Luam includeul de aici -> http://www.megaupload.com/?d=3DDTZXRU

Il bagam in - Serverul tau->Pawno->Include

Asa totu' este bineeee....

Acuma ce mai facem?

Bagam la includeuri

#include <j_fader_v2>
sub includeuri bagam :
new Float:gTmp;
new Float:pOldHealth[MAX_PLAYERS];
new Float:vSpeed[MAX_PLAYERS];
new Float:gtemp[4]; //global temporary variables
new JustDied[MAX_PLAYERS];
la ongamemodeinit :
FadeInit();
La ongamemodeexit:
 FadeExit();
la onplayerconnect:
  FadePlayerConnect(playerid);
  JustDied[playerid]=0;
la onplayerdisconnect:
FadePlayerDisconnect(playerid);
La onplayerdeath:
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
  JustDied[playerid]=1;
la onplayerspawn:
if(JustDied[playerid])
    {
    FadeColorForPlayer(playerid,255,0,0,255,255,0,0,0,25,0);
    JustDied[playerid]=0;
    }
la onplayerstatechange:
if(newstate==PLAYER_STATE_ONFOOT)vSpeed[playerid]=0;
la onplayerupdate:
GetPlayerHealth(playerid,gTmp);
  if(pOldHealth[playerid]>gTmp)
  {
    FadeColorForPlayer(playerid,255,0,0,floatround(pOldHealth[playerid]-gTmp)*10,255,0,0,0,floatround(pOldHealth[playerid]-gTmp),0);
  }
  pOldHealth[playerid]=gTmp;
  if(IsPlayerInAnyVehicle(playerid))
  {
    GetVehicleVelocity(GetPlayerVehicleID(playerid),gtemp[0],gtemp[1],gtemp[2]);
    gtemp[3]=floatsqroot( floatmul(gtemp[0],gtemp[0])+floatmul(gtemp[1],gtemp[1])+floatmul(gtemp[2],gtemp[2]) )*100;
    if(vSpeed[playerid]-gtemp[3]>20)FadeColorForPlayer(playerid,255,0,0,(floatround(vSpeed[playerid]-gtemp[3])-20)*3,255,0,0,0,floatround(vSpeed[playerid]-gtemp[3])-20,0);
    vSpeed[playerid]=gtemp[3];
Atentie!  Daca nu va descurcati...nu gasiti un callback...ca onplayerupdate....etc...am facut aici un exemplu  la cum o sa arate:
/*

include by SilentHuntR..
Tutorial by CookieEatingMonster

All credits go to SilentHuntR!!!!!!

SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR
SilentHuntR

*/




#include <a_samp>
#include <j_fader_v2>

new Float:gTmp;
new Float:pOldHealth[MAX_PLAYERS];
new Float:vSpeed[MAX_PLAYERS];
new Float:gtemp[4]; //global temporary variables
new JustDied[MAX_PLAYERS];


public OnFilterScriptInit()
{
  FadeInit();
  return 1;
}
public OnFilterScriptExit()
{
  FadeExit();
  return 1;
}

public OnPlayerConnect(playerid)
{
  FadePlayerConnect(playerid);
  JustDied[playerid]=0;
  return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
  FadePlayerDisconnect(playerid);
  return 1;
}
public OnPlayerDeath(playerid,killerid,reason)
{
  FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,25,1000);
  JustDied[playerid]=1;
  return 1;
}
public OnPlayerSpawn(playerid)
{
    if(JustDied[playerid])
    {
    FadeColorForPlayer(playerid,255,0,0,255,255,0,0,0,25,0);
    JustDied[playerid]=0;
    }
	return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
    if(newstate==PLAYER_STATE_ONFOOT)vSpeed[playerid]=0;
    return 1;
}
public OnPlayerUpdate(playerid)
{
  GetPlayerHealth(playerid,gTmp);
  if(pOldHealth[playerid]>gTmp)
  {
    FadeColorForPlayer(playerid,255,0,0,floatround(pOldHealth[playerid]-gTmp)*10,255,0,0,0,floatround(pOldHealth[playerid]-gTmp),0);
  }
  pOldHealth[playerid]=gTmp;
  if(IsPlayerInAnyVehicle(playerid))
  {
    GetVehicleVelocity(GetPlayerVehicleID(playerid),gtemp[0],gtemp[1],gtemp[2]);
    gtemp[3]=floatsqroot( floatmul(gtemp[0],gtemp[0])+floatmul(gtemp[1],gtemp[1])+floatmul(gtemp[2],gtemp[2]) )*100;
    if(vSpeed[playerid]-gtemp[3]>20)FadeColorForPlayer(playerid,255,0,0,(floatround(vSpeed[playerid]-gtemp[3])-20)*3,255,0,0,0,floatround(vSpeed[playerid]-gtemp[3])-20,0);
    vSpeed[playerid]=gtemp[3];
  }
  return 1;
}

Gata de download : http://solidfiles.com/d/7048/

Cam asta a fost  :shocked: poate imi mai vin idei d'astea si mai fac tutoriale :)) din pacate pentru voi... >:) muhaha

All credits go to SlientHuntR!!

Yo n-am facut decat tutorialul...multumesc  :laugh:

u78ch.jpg

CHECK MY CHANNEL!

http://www.youtube.com/user/amysoica

Link to comment
Share on other sites

mama pentru asa ceva a scris acolo o gramada de linii ... + inc

cel mai simplu faceti cu textdraweditor faceai un textdrqawusebox rosu tot  si il folositi ... il faceti sa apara la jucator cand ii scade viata si sa dispara folosind un timer cred ca scot toate astea in 15 linii nu cate ai tu acolo.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.