20.01.2015, 15:45
Exactly as Schneider, and I suggest using foreach for faster looping.
pawn Код:
//OnGameModeInit
SetTimer("TimeUpdater",1000,true);
//anywhere in the script
forward TimeUpdater(playerid);
public TimeUpdater(playerid)
{
foreach(Player, i)
//I suggest using foreach, if you don't want you can use this
//for(new i; i<MAX_PLAYERS; i++)
{
PlayerInfo[i][Seconds]++;
if(PlayerInfo[i][Seconds] >= 59)
{
PlayerInfo[i][Seconds] = 0;
PlayerInfo[i][Minutes] ++;
if(PlayerInfo[i][Minutes] >= 59)
{
PlayerInfo[i][Minutes] = 0;
PlayerInfo[i][Hours] = ++;
}
}
}
return 1;
}