About Date and Time!
#1

Hello all,
for example i took the number of the gettime(); and i got 99545432 (only example)
how can i know the date and the time of this number (99545432)? is there any code for it or something?
thanks for help <3 !
Reply
#2

99545432 = 9954532 seconds.

You can use timestamps for temporary systems like temporary banning, etc..

It works like this:
1) First, use gettime() and get the timestamp
2) If the player is getting banned for a day, we need to get the seconds in a day: 60 * 60 * 24 = 86400 seconds
3) now we'll add this to the timestamp, like this:
PHP код:
new unbantime=gettime()+86400
4) Now, you can make it work like this:
PHP код:
OnPlayerConnect(playerid)
{
    if( 
unbantime gettime() ) return Kick(playerid);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)