07.06.2011, 22:02
anyone know how to make a killstreak like if a player gets 3 kills in a row without dieing they get 100% health
new KillStreak[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason){
#pragma unused reason
KillStreak[playerid] = 0;
if(killerid >= 0) KillStreak[killerid]++;
if(KillStreak[killerid == 3) SetPlayerHealth(playerid, 100);
return 1;
}
new KillStreak[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason){
#pragma unused reason
KillStreak[playerid] = 0;
if(killerid >= 0) KillStreak[killerid]++;
if(KillStreak[killerid] == 3) SetPlayerHealth(playerid, 100);
return 1;
}
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
}