Quote:
Originally Posted by DeMoX
Try this:
pawn Код:
wait(seconds) { new _newTime[4], _oldTime[4]; gettime(_oldTime[0], _oldTime[1], _oldTime[2]); _oldTime[3] = _oldTime[2] + (_oldTime[1] * 60) + (_oldTime[0] * 600);
while(_newTime[3] != (_oldTime[3] + seconds)) { gettime(_newTime[0], _newTime[1], _newTime[2]); _newTime[3] = _newTime[2] + (_newTime[1] * 60) + (_newTime[0] * 600); } }
Then use wait(1);
To wait one sec
And yeah GetTime() will help.
Read this
V
Edit: Wait fonction freezes the server, use this include : Sleep
|
All of this is non-sense you don't want to prevent your script from working, just use a timer what is the big deal ? Usually people use timers when they don't have to your trying to do the opposite by not using timers. However what your trying to do won't work unless a timer is used.
If it's syntax your looking for try y_timers
https://sampforum.blast.hk/showthread.php?tid=182948 your looking for this part.
pawn Код:
timer DelayedTimer[500](playerid)
{
printf("May be called after 0.5 seconds");
}
main()
{
defer DelayedTimer(42);
}
I don't think it could be easier to read than that.