AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Best method to use ? (https://forums.alliedmods.net/showthread.php?t=154567)

reinert 04-10-2011 10:55

Best method to use ?
 
What is the best method to use Time if I would like to add hours/days to the Current time, and how could I check is the time expired ? Something like a BAN System with MySql...

Nyuszy 04-10-2011 11:05

Re: Best method to use ?
 
get_systime()

fysiks 04-10-2011 20:52

Re: Best method to use ?
 
When you ban them you need to store the "expiration" time:

get_systime() + bantime_in_seconds

Then, when you check to see if they are still banned you do:

Code:

if( get_user_ban_expiration(id) > get_systime() )
{
    // User is still banned
}


reinert 04-11-2011 00:16

Re: Best method to use ?
 
Thanks, :)


All times are GMT -4. The time now is 20:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.