Within 24Hours INGAME help [+REP]
#1

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
Reply
#2

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

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)
Reply
#4

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.
Reply
#5

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

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)