12.03.2015, 09:00
pawn Код:
new toptime = 0;//creating a variable with 0 value
new topid = -1;//creating a variable with -1 value (as playerid can be 0 too so we are using -1)
for(new i=0; i < MAX_PLAYERS; i++)
{
if(toptime < YourTimeStoringVariable[i])
{
toptime = YourTimeStoringVariable[i];
topid = i;
}
}
//the topid is the playerid with most time played (check if topid is not -1)