SA-MP Forums Archive
Within 24Hours INGAME help [+REP] - 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: Within 24Hours INGAME help [+REP] (/showthread.php?tid=631842)



Within 24Hours INGAME help [+REP] - Xportaler - 05.04.2017

Hello guys! I want to create an system. When players get register. EXAMPLE if i register myself today at 2am. Everytime i join within 24 hours send me message. "Welcome Newbie Player". and if i logint to the account i registered before 24 hours. it send me message "Welcome Regular Player"

HELP! +REP


Re: Within 24Hours INGAME help [+REP] - AndreiWow - 05.04.2017

Do you already have a feature that keeps track of the playing hours?


Re: Within 24Hours INGAME help [+REP] - Xportaler - 05.04.2017

Yes i already have. but my system save how much hours player play. But i want to make it after 24hours(realtime)(if he is online or offline)


Re: Within 24Hours INGAME help [+REP] - AndreiWow - 05.04.2017

Get the date and hour when the player firstly joined and save them as "Join Date" or something like that, however you want.

Then every time he connects get the date and time and match it with the saved ones, if they are under 24 hours then put the newbie message.

Maybe not the best method but it should work without any issues.


Re: Within 24Hours INGAME help [+REP] - Xportaler - 05.04.2017

Can you do for me a simple script! I really need that PLEASE


Re: Within 24Hours INGAME help [+REP] - AndreiWow - 05.04.2017

Here you get help with how to do it, not request a script.

Those two links may help you, this is how you get the date and the time, all you have to do now is save what you get...
How to get the date: https://sampwiki.blast.hk/wiki/Getdate
How to get the time: https://sampwiki.blast.hk/wiki/Gettime

However if you want to request the script, click the link in my description.


Re: Within 24Hours INGAME help [+REP] - DRIFT_HUNTER - 05.04.2017

When user registers, save current timestamp. Something like:
pawn Код:
new curTimestamp = gettime(playerid);
Then when he joins again, again, get current timestamp, read timestamp from when he registered(from where you saved it), and substract it from current one. Then just check if the result is bigger then 86400 (that is 24h in seconds), if it is 24h have passed.