Raised This Month: $51 Target: $400
 12% 

nvault question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-26-2011 , 07:57   nvault question
Reply With Quote #1

How can I make that every player gots an nvault file where the info is stored, there should be 3 lines of info like:

Parameter 1
Parameter 2
Parameter 3

And how could I change 1 of them ? And how to retrieve 1 of them ? (It depends what I need, parameter 1, 2 or 3) ...

And how to automaticly change them after a certain time ?

Last edited by reinert; 01-26-2011 at 07:59.
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-26-2011 , 14:11   Re: nvault question
Reply With Quote #2

You can use 1 nvault file for this.
For the key, use the player SteamID and the parameter number.

Example:
"STEAM_0:1:234567-param1"
"STEAM_0:1:234567-param2"
"STEAM_0:1:234567-param3"

To change/retrieve, use the set/get functions from nvault.

To automatically change, use a task.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-26-2011 , 14:33   Re: nvault question
Reply With Quote #3

Thanks.
reinert is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-27-2011 , 07:32   Re: nvault question
Reply With Quote #4

Is this correct ? :

new szKey[40];
formatex( szKey , charsmax( szKey ) , "%sSTH" , g_szAuthID[id] );

if(nvault_get( g_Vault , szKey) > 0)
return PLUGIN_HANDLED;

it checks is there a file like %sSTH, and if yes then ir returns PLUGIN_HANDLED;, right ?
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-27-2011 , 10:54   Re: nvault question
Reply With Quote #5

Yes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-27-2011 , 12:05   Re: nvault question
Reply With Quote #6

Okay, but I've got 3 different nvault's for example
%sSTH
%sSMTH
%sSMBD

And I would like that STH will be deleted with nvault_prune after 5 minutes, SMTH after 10minutes and SMBD after 15 minutes, how can I do it ?
reinert is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-27-2011 , 12:19   Re: nvault question
Reply With Quote #7

I think for that you would have to make 3 different vault files itself :/
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-27-2011 , 13:15   Re: nvault question
Reply With Quote #8

Quote:
Originally Posted by reinert View Post
Okay, but I've got 3 different nvault's for example
%sSTH
%sSMTH
%sSMBD

And I would like that STH will be deleted with nvault_prune after 5 minutes, SMTH after 10minutes and SMBD after 15 minutes, how can I do it ?
To make things easy, multiple vault files can be used.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-27-2011 , 14:27   Re: nvault question
Reply With Quote #9

Why this is not working ?

PHP Code:
    new szKey[40];
    
formatexszKey charsmaxszKey ) , "%sSTH" g_szAuthID[id] );
    
    if(
nvault_gets_Vault szKey) > 0)
    {
        return 
PLUGIN_HANDLED;
    }
    
    
nvault_sets_Vault szKey "1");
    
set_task(5.0"checkPrune"id 950__"b")
    
public 
checkPrune()
{
    
nvault_prune(s_Vault0get_systime() - 60 )

I think prune is not working, because it always returns PLUGIN_HANDLED;

It works first time (after deleting Vault's from server addons directory), then it set's nvault and I've been waiting for like 3 minutes, still didn't worked again...
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-27-2011 , 16:00   Re: nvault question
Reply With Quote #10

How are you testing if it works?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 16:16.


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