Hour-function payday not working - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hour-function payday not working (
/showthread.php?tid=395939)
Hour-function payday not working -
DaRoderick - 28.11.2012
Hi,
As many of other servers I'm trying to make a payday. But I have an issue; with this code the payday isn't loading at all. It should load at every :00. What's the problem?
pawn Код:
new ghour = 0;
new gdebug = 1;
new shifthour;
new realtime = 1;
forward SyncUp();
forward SyncTime();
public SyncUp()
{
if (gdebug >= 3){printf("DEBUG SyncUp()");}
SyncTime();
ScoreUpdate();
}
public SyncTime()
{
if (gdebug >= 3){printf("DEBUG SyncTime()");}
new string[64];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "SERVER: The time is now %d:00",tmphour);
SendClientMessageToAll(blue,string);
if (gdebug){printf("DEBUG tmphour=%d ghour=%d",tmphour,ghour);}
ghour = tmphour;
PayDay();
if (realtime)
{
SetWorldTime(tmphour);
}
}
}
Re: Hour-function payday not working -
PlayLSX_Founder - 28.11.2012
How are you calling the "SyncUp" function?
Re: Hour-function payday not working -
DaRoderick - 28.11.2012
pawn Код:
synctimer = SetTimer("SyncUp", 60000, 1);