A paycheck system - 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: A paycheck system (
/showthread.php?tid=319123)
A paycheck system -
Jack_Wilson - 18.02.2012
I've been working on a roleplay script lately, I'm just curious as to how I could use gettime(&hour=0, &minute=0, &second) to initiate a paycheck every time it hits an hour.
Any links etc, would be greatly appreciated.
Re: A paycheck system -
Nuke547 - 18.02.2012
Well ongamemodeinit set a timer for everysecond, and make a new saved player variable called seconds connected.
Once the saved variables, secondsconnected reaches 3600(Thats one hour in seconds), it gives a paycheck
Re: A paycheck system -
Jack_Wilson - 18.02.2012
Quote:
Originally Posted by Nuke547
Well ongamemodeinit set a timer for everysecond, and make a new saved player variable called seconds connected.
Once the saved variables, secondsconnected reaches 3600(Thats one hour in seconds), it gives a paycheck
|
Nothing like what I meant, I don't want to start a timer that initiates a paycheck in an hour from the server initialization.
I want it to give a paycheck each hour IRL / server time.
Re: A paycheck system -
ReneG - 18.02.2012
Quote:
Originally Posted by Jack_Wilson
Nothing like what I meant, I don't want to start a timer that initiates a paycheck in an hour from the server initialization.
I want it to give a paycheck each hour IRL / server time.
|
I've haven't started to learn how to make a payday system, but I recommend reading the wiki's. Specifically GetTime and GetDate. I honestly don't know how payday systems work, but it's a start. You can also try looking at a GF edit and using that script as a reference to scripting. I use them whenever I get stuck on something. Goodluck.
Re: A paycheck system -
Nuke547 - 18.02.2012
So for every hour that goes by irl, it gives them a paycheck?
Re: A paycheck system -
Jack_Wilson - 18.02.2012
Quote:
Originally Posted by Nuke547
So for every hour that goes by irl, it gives them a paycheck?
|
Correct.
gettime() seems to only give me a unix timestamp, I can't determine the actual hour at all.