How to sum damage
#9

Don't use PVars - they're slower.

pawn Код:
static
    Float: Player_DamageTaken[MAX_PLAYERS];

// OnPlayerConnect:
Player_DamageTaken[playerid] = 0.0;

// OnPlayerDeath:
Player_DamageTaken[playerid] = 0.0;

// OnPlayerTakeDamage (damage taken by players):
if (issuerid != INVALID_PLAYER_ID)
{
    Player_DamageTaken[playerid] += amount;
}
Player_DamageTaken[playerid] stores the total amount a player took damage by players. In each round (if you have of course) you can reset it to 0.
Reply


Messages In This Thread
How to sum damage - by GwENiko - 12.05.2014, 11:39
Re: How to sum damage - by ball - 12.05.2014, 11:49
Re: How to sum damage - by gekas - 12.05.2014, 12:24
Re: How to sum damage - by GwENiko - 12.05.2014, 16:34
Re: How to sum damage - by GwENiko - 14.05.2014, 18:31
Re: How to sum damage - by GwENiko - 15.05.2014, 17:36
Re: How to sum damage - by ball - 15.05.2014, 17:54
Re: How to sum damage - by GwENiko - 16.05.2014, 16:35
Re: How to sum damage - by Konstantinos - 16.05.2014, 16:42
Re: How to sum damage - by GwENiko - 16.05.2014, 16:49

Forum Jump:


Users browsing this thread: 2 Guest(s)