22.08.2011, 23:39
(
Last edited by Kush; 23/08/2011 at 12:09 AM.
)
PHP Code:
new gVar_Rank[MAX_PLAYERS]; //an array defined as a variable
public OnPlayerDeath(playerid, killerid, reason) // on player death function with set parameters (player, the killer, the reason)
{
gVar_Rank[killerid]++; // will add 1 value when the killer kills a person
gVar_Rank[playerid]--; // will remove 1 value to the player in which dies
if(gVar_Rank[killerid] < 10) { GivePlayerWeapon(killerid, 22, 50 } // if the killer's rank is less than 10 they will get a pistol
else if (gVar_Rank[killerid] == 10 { GivePlayerWeapon(killerid, 25, 50 } // if rank value 10 they will get a shotgun
else if (gVar_Rank[killerid] == 20 { GivePlayerWeapon(killerid, 25, 50 } // if 20 they will get deagle
return 1; //returning the compound code as true.
}