View Single Post
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-21-2009 , 10:16   Re: FVault - A new vault system!
Reply With Quote #15

Quote:
Originally Posted by alan_el_more View Post
Is this right? If i want to remove the key if not used within 2 weeks
That would remove all keys, not just that one.
If you want to remove one key for the timestamp, then you would do something like this:
Code:
stock fvault_prune_key( const szVault[ ], const szKey[ ], const iPruneStart=-1, const iPruneEnd=-1 ) {     static szData[ 2 ], iTimeStamp;     if( fvault_get_data( szVault, szKey, szData, 1, iTimeStamp ) && iTimeStamp != -1 ) {         if( iPruneStart == -1 ) {             if( iPruneEnd == -1             || iTimeStamp <= iPruneEnd ) {                 fvault_remove_key( szVault, szKey );                 return 1;             }         }         else if( iPruneEnd == -1 ) {             if( iTimeStamp >= iPruneStart ) {                 fvault_remove_key( szVault, szKey );                 return 1;             }         }         else if( iPruneStart <= iTimeStamp <= iPruneEnd ) {             fvault_remove_key( szVault, szKey );             return 1;         }     }         return 0; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 09-21-2009 at 10:35.
Exolent[jNr] is offline