12.10.2014, 08:07
pawn Код:
public BersekCheck()
{
new index;
index = 0;
for(new i=0; i< MAX_PLAYERS; i++) // foreach would be better
{
if(playerVariables[i][pCurrentSpree] > playerVariables[index][pCurrentSpree])
index = i;
}
new pname[MAX_PLAYER_NAME];
new szMessage[128];
GetPlayerName(index, pname, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "[%d]%s is a menace and has turned into bersek, killing them will earn extra money.", index, pname);
SendClientMessageToAll(COLOR_RED, szMessage);
return 1;
}