How to combine the hit I gived?
#1

Hello,

I would like to make a damage system I know to do the easiest one, but I want to create one like that (and I don't see how I can do that)


so its:

I give 2 hit on a players with deagle.
Hited player will saw a textdraw at each hit, and at the second one he will se 2HIT - 92(2 eagles damages) DAMAGES.

thx for help, and i'd like to do it with all wps.
Reply
#2

Just create a variable that checks how many times the player got shoot, example:

pawn Код:
new ShootCount[MAX_PLAYERS]=0;
new Float:ShootDamage[MAX_PLAYERS];
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid,bodypart)
{
    //show your textdraws
    ShootDamage[playerid]+=amount;
    ShootCount[playerid]++;
    new string[128];
    format(string,sizeof(string),"%d Hit - %.0f",ShootCount[playerid],ShootDamage[playerid]);
    PlayerTextDrawSetString(playerid,yourtextdraw,string);
    SetTimerEx("ResetPlayerVariable",2000,false,"i",playerid);//I made a timer after 2 second to reset hit variable back
    return 1;
}
forward ResetPlayerVariable(playerid);
public ResetPlayerVariable(playerid)
{
    ShootCount[playerid]=0;
    ShootDamage[playerid]=0;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)