Raised This Month: $ Target: $400
 0% 

Is there a way to do time calcualtions?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-12-2005 , 12:25   Is there a way to do time calcualtions?
Reply With Quote #1

I want to be able to do time calculations using vault like I am doing with SQL now. In SQL I can do
Code:
TO_DAYS( NOW( ) ) - TO_DAYS( date ) >=%d
The only way that I can figure out to do this is to do
Code:
new time_stored get_vaultdata(id,time_stored) new time_now = get_systime() if(time_now - time_stored >= 2592001){ //greater than 30 days

Also, is there any way to get the timestamp of a file in the amxx directory?
slurpycof is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-12-2005 , 13:00  
Reply With Quote #2

Type time in the wiki for all time functions.
One can do days.
I just use your method.

Also, might I point you to vaultX, if your wanting to use vault?
Its much faster.
http://forums.alliedmods.net/showthread.php?t=

Also, you cannot get the time stamp on files. Sorry.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-12-2005 , 14:44  
Reply With Quote #3

I did not see it in the amxx package so if I use vaultx, people will also have to download and install the module. I think it is a great idea and maybe the amxx gods will replace vault with your code. I am just hesitant to add another area for people to get lost trying to follow instructions.
slurpycof is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-13-2005 , 09:51  
Reply With Quote #4

The additional speed is well worth it.

Vault can not handle (effeciently, without lag), more then 100 - 500 entries before starting to lag a whole lot.

VaultX is limited only by the amount of memory you have.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
slurpycof
Senior Member
Join Date: Nov 2004
Old 04-13-2005 , 15:28  
Reply With Quote #5

Another question for you, is there a way to do more than 1 value per key? I have modified my plugin to use vaultx and I was trying to add another value to get stored. I have
Code:
set_vaultxdata(authid,vault_time)

and would like to be able to do
Code:
set_vaultxdata(authid,vault_time,time_updated)
slurpycof 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 09:53.


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