Have A Question About Reset Something
#1

Hello Guys !
- How Can I Make This, every day in 0 AM this will reset something about player like the time to /gift or something,...
- The /gift command only used one day and 0 AM it will be reset
Reply
#2

PHP код:
new gifttimer[MAX_PLAYERS]; //on top of script 
in /gift command.
PHP код:
CMD:gift(playerid,params)
{
//code
if(gifttimer[playerid] > gettime()) return SendClientMessage(playerid,COLOR_YELLOW,"You need to wait for 1 day to use this command again");
gifttimer[playerid] = gettime()+86400;
return 
1;

This will reset the /gift after 1 full day.
Reply
#3

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
PHP код:
new gifttimer[MAX_PLAYERS]; //on top of script 
in /gift command.
PHP код:
CMD:gift(playerid,params)
{
//code
if(gifttimer[playerid] > gettime()) return SendClientMessage(playerid,COLOR_YELLOW,"You need to wait for 1 day to use this command again");
gifttimer[playerid] = gettime()+86400;
return 
1;

This will reset the /gift after 1 full day.
if player not online it's can work
Reply
#4

Yes if you save this in the INI file of player data or whichever saving system you use. Suppose a player used command /gift at 3am >>timer started>>>he logged out at 5am suppose>>>and logged in at 10am>>> the timer will start from the place where it left at 5am. But only if you save that in player's data
Reply
#5

Quote:
Originally Posted by Sunehildeep
Посмотреть сообщение
Yes if you save this in the INI file of player data or whichever saving system you use.
oke thank you !
Reply
#6

I edited my post read it again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)