19.07.2011, 13:29
pawn Код:
forward secondupdater();
public secondupdater()
{
new hour, minute, second;
gettime(hour, minute, second);
for(new i; i < MAX_PLAYERS; i ++)
{
if(minute == 60 && second == 0)
{
hour++;
SetPlayerScore(i, GetPlayerScore(i) + 1);
SetWorldTime(hour);
if(hour == 24)
{
hour = 0;
}
}
}
printf("Hour: %d, Minutes: %d, Seconds: %d.", hour, minute, second);
if(minute == 60 && second == 0)
{
printf("New Hour: %d.", hour);
}
return 1;
}