Raised This Month: $32 Target: $400
 8% 

Solved Expire date


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-18-2018 , 17:06   Re: Expire date
Reply With Quote #11

What is the value of szInput?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-18-2018 , 17:51   Re: Expire date
Reply With Quote #12

Quote:
Originally Posted by OciXCrom View Post
What is the value of szInput?
The expire date, using HamletEagle's AddToDate stock.
__________________
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-18-2018 , 18:30   Re: Expire date
Reply With Quote #13

I know it's the expire date, but I'm asking how exactly are you writing it? Give an example.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-18-2018 , 18:35   Re: Expire date
Reply With Quote #14

It's saved as %D in nVault

CheckSuspended is called on Ham_Spawn
PHP Code:
CheckSuspendedid 

    if( ! 
is_user_connectedid ) || is_user_botid ) ) 
    return 
0

    new 
szName32 ], szExpireTime], iTimeStampiExists
    
get_user_nameidszNamecharsmaxszName ) ); 
    
    
iExists nvault_lookupg_iVaultszNameszExpireTimecharsmaxszExpireTime ), iTimeStamp ); 
    
    if( ! 
iExists 
    return 
0
    
    if( 
HasSuspendExpiredszExpireTime ) ) 
    { 
        
UnSuspendPlayerid ); 
        
nvault_removeg_iVaultszName );
        
        
client_print_coloridDontChange"^4[Suspend System] ^3Your suspend has expired" );
    } 
    
    return 
1
}

bool:HasSuspendExpired( const szInput[ ] )
return 
get_systime( ) >= parse_timeszInput"%D" ); 
__________________

Last edited by edon1337; 08-18-2018 at 18:37.
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-20-2018 , 04:50   Re: Expire date
Reply With Quote #15

Wait what..
PHP Code:
bool:HasSuspendExpired( const szInput[ ] )
{
    
log_to_file"time.txt""szInput: %s | Systime: %d | Parse: %d"szInputget_systime( ), parse_timeszInput"%D" ) );

Why do 20/08/2018 and 21/08/2018 return the same timestamp?
PHP Code:
L 08/20/2018 11:49:06nVault szExpireDate08/21/18
L 08
/20/2018 11:49:06szInput08/21/18 Systime1534754946 Parse1534754946 
__________________

Last edited by edon1337; 08-20-2018 at 07:13.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-20-2018 , 14:54   Re: Expire date
Reply With Quote #16

Try "%m/%d/%y" instead of %D.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-20-2018 , 15:29   Re: Expire date
Reply With Quote #17

Quote:
Originally Posted by HamletEagle View Post
Try "%m/%d/%y" instead of %D.
Worked, thanks
__________________
edon1337 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 10:32.


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