19.07.2011, 12:49
Hello, I have attempted to make an auto updater for the players scores and to set the world time, my code just doesn't seem to work, it prints out the time like I have scripted it to:
I just don't understand it, should it be a SetTimer or SetTimerEx also?
pawn Код:
forward secondupdater(playerid);
public secondupdater(playerid)
{
new hour, minute, second;
gettime(hour, minute, second);
if(minute == 60 && second == 0)
{
hour++;
SetPlayerScore(playerid, GetPlayerScore(playerid) + 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;
}