SA-MP Forums Archive
Auto cmd in days - 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: Auto cmd in days (/showthread.php?tid=603247)



Auto cmd in days - Ax3l123 - 20.03.2016

Hi , could you give me some tips and what i need to make an auto expire vip like i set /givevip 10 which will give a player vip for 10 days.
i'm not asking for a free script just some wiki links how to create it , i mean the timer not the vip system.


Re: Auto cmd in days - IceBilizard - 20.03.2016

If you are using saving system of users then it will be more easy which saving system you are using for saving player data?


Re: Auto cmd in days - $Marco$ - 20.03.2016

I would suggest saving a players last day of connecting (and update it everytime he connects) and compare it to the current server date using getdate().
Hope I helped.


Re: Auto cmd in days - dominik523 - 20.03.2016

I would do it like this:
pawn Код:
new VIPExpire[MAX_PLAYERS];

// under command for giving a vip status
VIPExpire[playerid] = gettime() + days * 86400; // 86400 seconds = one day
This would use unix timestamps to get the given date (search the forums if you don't know what those are) and you could check if gettime() is greater than the date under OnPlayerConnect or some timer with fixed interval like few minutes or something.


Re: Auto cmd in days - SickAttack - 20.03.2016

Use timestamps.