Raised This Month: $ Target: $400
 0% 

Saving in NVault ? Cant?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JProReTaRD
Member
Join Date: May 2009
Location: Denmark, KBH
Old 05-11-2010 , 08:01   Saving in NVault ? Cant?
Reply With Quote #1

Hi,
I can't seem to save my rules in the nvault.
I am doing this through cmd.
This is the code:
PHP Code:
new rrm_Rules;               //Global var to hold our vault handle
new rrm_Punishments;               //Global var to hold our vault handle
new rrm_szAuthID[33][35];    //Global array to store auth ids of players

enum _:VaultData
{
    
VAULT_KEY32 ],  //change to max key length
    
VAULT_DATA32 ]  //..max data len
};


public 
plugin_init()
{
    
register_concmd"RRM_ChangeRule""Change_Rule"ADMIN_KICK );
    
rrm_Rules nvault_open"rrm_Rules" );
    
rrm_Punishments nvault_open"rrm_Punishments" );
}

public 
plugin_end()
{
    
nvault_closerrm_Rules );
    
nvault_closerrm_Punishments );
}

cmd_ChangeRule(idkey)
{
    if ( 
gbAdminAccess[id] )
    {
        
client_cmd(id"messagemode RRM_ChangeRule"); 
        
client_print(idprint_chat"Write the %s. rule."key); 
    }
    
    return 
PLUGIN_HANDLED;
}

public 
Change_RuleiClientiLeveliCid )
{
    if( !
cmd_accessiClientiLeveliCid) )
    {
        return;
    }

    new 
szVaultDataVaultData ];
    
    
read_argv1szVaultDataVAULT_KEY ] , charsmaxszVaultData[] ) );
    
read_argv2szVaultDataVAULT_DATA ] , charsmaxszVaultData[] ) );
    
    
nvault_psetrrm_RulesszVaultDataVAULT_KEY ], szVaultDataVAULT_DATA ] );
}

public 
ShowRuleidkey )
{
    
//Read 2 items that that are saved in the same entry
    //Example: RULE-1 "HELP ME!"

    
new szData[8];
    new 
szKey[40];

    
formatexszKey 39 "%s" key );

    
//If data was found
    
if ( nvault_getrrm_Rules szKey szData ) )
    {
        
ColorChat(idGREEN"%s^x01 Rule^x03 %s:^x01 %s"PLUGIN_PREFIXszKeyszData);
    }
    else
    {
        
ColorChat(idGREEN"%s^x01 Rule^x03 %s:^x01 Wasn't found, make a new Entry!"PLUGIN_PREFIXkey);
    }    

I hope you can help

Last edited by JProReTaRD; 05-11-2010 at 08:04.
JProReTaRD is offline
 


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 03:41.


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