Raised This Month: $ Target: $400
 0% 

function should expire on specific date


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Guenhwyvar
AMX Mod X Beta Tester
Join Date: Jul 2005
Location: Berlin / Germany
Old 03-03-2006 , 13:46   function should expire on specific date
Reply With Quote #1

I have a function which should work only until a specific date and expire after.

I have the idea that a if code have to be placed into the first lines of that function:

Code:
expireDate = "2006/04/01" if (currentDate < expireDate) return PLUGIN_HANDLED

But I need help on the date checking.

Thanx in advance!
Guenhwyvar is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-03-2006 , 15:54  
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=249
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Guenhwyvar
AMX Mod X Beta Tester
Join Date: Jul 2005
Location: Berlin / Germany
Old 03-04-2006 , 04:32  
Reply With Quote #3

Thanks des, but could you give me an example checking if the current date is later/equal the date given by the var expireDate?
Guenhwyvar is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-04-2006 , 14:19  
Reply With Quote #4

if i'm right in assuming how these date commands work:

Code:
new expireDate[32], currentDate[32]; expireDate = "2006/04/01"; get_time("%Y/%m/%d",currentDate,31); if(parse_time(currentDate,"%Y/%m/%d") > parse_time(expireDate,"%Y/%m/%d")) {    // expired }

i'm not totally sure though, the time functions appear confusing and misleading to me.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 03-04-2006 , 16:21  
Reply With Quote #5

use get_systime from you set it and add however many seconds to make it your expire date then just check it with get_systime again.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Guenhwyvar
AMX Mod X Beta Tester
Join Date: Jul 2005
Location: Berlin / Germany
Old 03-05-2006 , 05:35  
Reply With Quote #6

Thanks for the help, I think get_systime is working for me. A little bit more calculation beforehand, but I do not have to handle with dates in the function.
Guenhwyvar is offline
Reply


Thread Tools
Display Modes

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 20:17.


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