Raised This Month: $ Target: $400
 0% 

How to add more 'minutes' ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 08-25-2012 , 20:45   How to add more 'minutes' ?
Reply With Quote #1

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
Thanks!
Attached Files
File Type: sma Get Plugin or Get Source (testing_method_suspend.sma - 571 views - 2.5 KB)
__________________



pacheco is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-26-2012 , 03:44   Re: How to add more 'minutes' ?
Reply With Quote #2

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
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
pacheco
Senior Member
Join Date: Jul 2011
Old 08-26-2012 , 19:05   Re: How to add more 'minutes' ?
Reply With Quote #3

Quote:
Originally Posted by mottzi View Post
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'?
__________________



pacheco is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-26-2012 , 19:14   Re: How to add more 'minutes' ?
Reply With Quote #4

Quote:
Originally Posted by pacheco View Post
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().
__________________

Last edited by fysiks; 08-26-2012 at 19:16.
fysiks is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 08-26-2012 , 19:25   Re: How to add more 'minutes' ?
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
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.
__________________




Last edited by pacheco; 08-26-2012 at 19:28.
pacheco is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-26-2012 , 19:28   Re: How to add more 'minutes' ?
Reply With Quote #6

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.
__________________
fysiks is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 08-26-2012 , 19:29   Re: How to add more 'minutes' ?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
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.
__________________



pacheco is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:25.


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