SetTimer assistance - 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: SetTimer assistance (
/showthread.php?tid=533029)
SetTimer assistance -
Malicious - 21.08.2014
Recently I have decided to practise scripting and so far it's going quite well, however, I am stuck on something that I would really like to add to my practise script, it's basically the use of the date and time along with the SetTimer to create an information message that allows people to know exactly what time the server would restart, for example:
" a server restart has been issued, it will restart at 12:05, please leave the server so your stats wont be lost or damaged in any way"
Re: SetTimer assistance -
Blademaster680 - 22.08.2014
Why dont you rather say the server is restarting in x amounts of minutes?
Re: SetTimer assistance -
Malicious - 22.08.2014
well, that's what I currently have, but I wanted it as a generalized time instead
Re: SetTimer assistance -
MissionCoder - 22.08.2014
Uhmm... You said what you need to be done, generally... We really need the details to be able to help you.
Re: SetTimer assistance -
BuLLeT[LTU] - 22.08.2014
Isn't this better?
pawn Код:
public Counting()
{
switch (Counter)
{
case 120:
{
SendClientMessage(playerid,COLOR,"2 minutes left before restart");
}
}
Counter--;
return 1;
}
Function counter should be called every second (with SetTimer), or every minute, but then 'Counter' variable means minutes, not seconds. I think it's the easiest way to do this.