SA-MP Forums Archive
How to save a timer? - 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: How to save a timer? (/showthread.php?tid=396757)



How to save a timer? - Elysian` - 01.12.2012

I want to know how you save a timer for a Payday system?

Thanks.

For example: Every hour you recieve a certain amount cash.


Re: How to save a timer? - NewerthRoleplay - 01.12.2012

You can use https://sampwiki.blast.hk/wiki/Gettime And do it like that every hour bare in mind this will only work every server hour rather then a client hour, to do a client hour I would recommend doing and hour timer.


Re: How to save a timer? - BleverCastard - 01.12.2012

How would I do that?


Re: How to save a timer? - SuperViper - 01.12.2012

Create a player variable which saves called LastPayday. Use the following check under a timer which you should create that sets off every 10 to 20 seconds.

pawn Код:
new currentTickcount = tickcount();

if(currentTickcount - LastPayday[playerid] >= 3600000)
{
    Payday();
    LastPayday[playerid] = currentTickcount;
}