04.01.2014, 17:14
how to count damage and save it in a variable for later use ?
//Make Global Variable
new float:PlayerHealth[MAX_PLAYERS];
Then On A Public Function
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
// Here amount is what it takes by the Killer
// You can compare PlayerHealth that is global variable and store the amount of taken damage
// You can do it like this PlayerHealth[playerid] = amount;
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
PlayerHealth[playerid] = amount;
// OR
PlayerHealth[issuerid] = amount;
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
damagedid[playerid] = amount;
return 1;
}
tage mismatch warning.
pawn Код:
|
new Float:damagedid[MAX_PLAYERS];