Raised This Month: $ Target: $400
 0% 

About get_systime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bladell
Senior Member
Join Date: Jun 2012
Old 08-27-2013 , 08:57   About get_systime
Reply With Quote #1

How it is work?
What really do this native?Here : http://www.amxmodx.org/funcwiki.php?...time&go=search , I saw that count the seconds from 1 January 1970...Then this expression it's wrong for me:
Code:
nvault_prune(gVaultHandle, 0, get_systime() - (xpSaveDays * 24 * 3600))
If you make the difference betwen seconds elapsed since 1970 and a week (for example), you will get a result wich is in past, not in future.So...how this native work?
I think that the correct expression is
Code:
nvault_prune(gVaultHandle, 0, get_systime() + (xpSaveDays * 24 * 3600))
This is a line from SuperHero Mod...what I am trying to do is a message wich will be shown in the last X days before reset of experience.The problem is that I can't understand how work get_systime native...
Bladell is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-27-2013 , 09:05   Re: About get_systime
Reply With Quote #2

get_systime will return the current Unix Epoch value. You are then subtracting a week, so it is expected to get a value in the past. Based on what you have provided, it looks like it is trying to remove old data that hasn't been updated in a week.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Old 08-27-2013, 09:05
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
Bladell
Senior Member
Join Date: Jun 2012
Old 08-27-2013 , 10:05   Re: About get_systime
Reply With Quote #3

Let me exaplin a bit better...
xpSaveDays it's the pointer on cvar sh_xpsavedays...

Code:
nvault_prune(gVaultHandle, 0, get_systime() - (xpSaveDays * 24 * 3600))
So, if I set sh_xpsavedays "7", the native will look like this:

Code:
nvault_prune(gVaultHandle, 0, get_systime() - (7 * 24 * 3600))
0 = start, and the result of get_systime() - (7 * 24 * 3600) = end

But I still not understand, what value return get_systime?The seconds elapsed since 1970?This mean that the value of get_systime() grow every seconds.
Bladell is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-27-2013 , 10:08   Re: About get_systime
Reply With Quote #4

Quote:
Originally Posted by Bladell View Post
xpSaveDays it's the pointer on cvar sh_xpsavedays...
Then you should be using get_pcvar_num instead of the variable itself

Quote:
But I still not understand, what value return get_systime?
It returns the current Unix Epoch time as reported by the OS.

Quote:
The seconds elapsed since 1970?
http://en.wikipedia.org/wiki/Unix_time

Quote:
This mean that the value of get_systime() grow every seconds.
Yes
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 08-27-2013 at 10:08.
YamiKaitou is offline
President
Member
Join Date: May 2013
Old 08-27-2013 , 12:26   Re: About get_systime
Reply With Quote #5

When you save something on nvault, it records the time too
and when get_systime()-(time) is bigger than that time(recorded on save), it deletes the line

Do you understand now?

Last edited by President; 08-27-2013 at 12:27.
President is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 09-03-2013 , 06:47   Re: About get_systime
Reply With Quote #6

Yea, thanks
Bladell 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 18:50.


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