08.06.2011, 00:41
Muhib, do you know how to work with arrays?
pawn Код:
new KillStreak[MAX_PLAYERS]; // Global variable 'KillStreak' the size of how many players your server holds
public OnPlayerDeath(playerid, killerid, reason)
{
// #pragma unused reason // Not sure why you're doing this, as the reason can be useful elsewhere in this
KillStreak[playerid] = 0; // If they die, they lose their KillStreak
if(killerid >= 0) KillStreak[killerid]++; // If they didn't die, and killed someone, up it (Not sure as to what they had in mind with this condition..)
if(KillStreak[killerid] >= 3) SetPlayerHealth(playerid, 100); // If their streak is >=3, give them 100 health
return 1; // Lala
}