19.12.2014, 13:21
Hey there, I have a paycheck system scripted on my game-mode and just like any other role-play scripts, it's set to every hour. It's just really weird that sometimes it works fine and sometimes it doesn't.
Here's what I currently have:
If someone could enlighten me, please do. Thank you.
Here's what I currently have:
pawn Код:
forward OneSecond();
public OneSecond()
{
new hour, minute, second;
gettime(hour, minute, second);
new string[128];
if(minute >= 59 && second >= 59)
{
SetWorldTime(hour+1);
format(string, sizeof(string), "The time now is %d:00", hour+1);
SendClientMessageToAll(0xFFFFFFFF, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(minute >= 59 && second >= 59)
{
// Give paycheck here
}
}
return 1;
}
public OnGameModeInit()
{
SetTimer("OneSecond", 1000, 1);
return 1;
}