AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to add more 'minutes' ? (https://forums.alliedmods.net/showthread.php?t=194170)

pacheco 08-25-2012 20:45

How to add more 'minutes' ?
 
1 Attachment(s)
I Have one code of example to suspend accounts.
In this, i type in console: ban_test "name" "minutes" to suspend.
But i have one problem, i can't suspend for much minutes, because i'm using the get_time to unban the player. How i do to suspend for more minutes, and check to unban with other method? Example, i can suspend one player for 200 minutes.. How?

It just a test.. I'll put it in other mod.

If you don't understand what i'm trying to do, please tell me :3
Thanks! :twisted:

mottzi 08-26-2012 03:44

Re: How to add more 'minutes' ?
 
I didnt look at the code, but I would do it with the unix time definition.
Have a look at: http://www.amxmodx.org/funcwiki.php?go=func&id=604

pacheco 08-26-2012 19:05

Re: How to add more 'minutes' ?
 
Quote:

Originally Posted by mottzi (Post 1782983)
I didnt look at the code, but I would do it with the unix time definition.
Have a look at: http://www.amxmodx.org/funcwiki.php?go=func&id=604

Thanks. Can you give me one example, to i see how many time i have of my 'suspend'?

fysiks 08-26-2012 19:14

Re: How to add more 'minutes' ?
 
Quote:

Originally Posted by pacheco (Post 1783731)
Thanks. Can you give me one example, to i see how many time i have of my 'suspend'?

That question doesn't really make any sense. You just use the unix time the same way that you currently do (you just don't need to convert it because it is already an interger). Also, remember that the time returned is in seconds and not minutes.

EDIT: Just in case the funcwiki is still down when people read this, the function is get_systime().

pacheco 08-26-2012 19:25

Re: How to add more 'minutes' ?
 
Quote:

Originally Posted by fysiks (Post 1783738)
That question doesn't really make any sense. You just use the unix time the same way that you currently do (you just don't need to convert it because it is already an interger). Also, remember that the time returned is in seconds and not minutes.

EDIT: Just in case the funcwiki is still down when people read this, the function is get_systime().

Why? I need one example, Remaining 3 minutes (or in seconds, no problem) for your "unban".

Quote:

Also, remember that the time returned is in seconds and not minutes.
Ok.

fysiks 08-26-2012 19:28

Re: How to add more 'minutes' ?
 
To get the time remaining until they are "unsuspended" you simply need to do a little thinking and a little math. You have access to the current time and you have access to the time that they are supposed to be "unsuspended". That's all the information you need to do what you want.

pacheco 08-26-2012 19:29

Re: How to add more 'minutes' ?
 
Quote:

Originally Posted by fysiks (Post 1783751)
To get the time remaining until they are "unsuspended" you simply need to do a little thinking and a little math. You have access to the current time and you have access to the time that they are supposed to be "unsuspended". That's all the information you need to do what you want.

Thanks. I'll try it.


All times are GMT -4. The time now is 05:52.

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