12.10.2014, 05:40
I can't really build in my mind, on how this is logically supposed to be. I wanted to check whose player is the highest killing spree, to declare them "Bersek", although, with this code, it only works on whomever joins first. Basically, my main struggle is to understand how i can compare the variables between the playerid according to everyone else. Help is always appreciated
pawn Код:
public BersekCheck(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(i == playerid) continue;
else
{
if(playerVariables[playerid][pCurrentSpree] > playerVariables[i][pCurrentSpree])
{
bersek[playerid] = true;
SetPlayerColor(playerid, COLOR_LIGHTRED);
}
}
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(szMessage, 256, "[%d]%s is a menace and has turned into bersek, killing them will earn extra money.", playerid, pname);
SendClientMessageToAll(COLOR_RED, szMessage);
}
return 1;
}