18.08.2010, 15:36
Some edits about it
This should work fine. btw i would prefer using PVars.
pawn Код:
new playerKills[MAX_PLAYERS];//at OnPlayerConnect you should set it at 0 "playerKills[playerid] = 0;"
public OnPlayerDeath(playerid, killerid, reason)
{
playerKills[killerid]++; //killer should get a plus, not the player that die
return 1;
}
COMMAND:yourcheck(playerid, params[])
{
new mostkills = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++) //you should be using foreach, but this works too.
{
if(playerKills[i] > playerKills[mostkills]) mostkills = i;
}
printf("The ID with most kills is: %d", mostkills");
return 1;
}