AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Is there a way to do time calcualtions? (https://forums.alliedmods.net/showthread.php?t=12334)

slurpycof 04-12-2005 12:25

Is there a way to do time calcualtions?
 
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?

Twilight Suzuka 04-12-2005 13:00

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.

slurpycof 04-12-2005 14:44

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.

Twilight Suzuka 04-13-2005 09:51

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.

slurpycof 04-13-2005 15:28

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)


All times are GMT -4. The time now is 09:53.

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