Raised This Month: $ Target: $400
 0% 

nVault


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 10-31-2011 , 06:44   nVault
Reply With Quote #1

So I'm editing shop plugin for JB and trying to make that i would save JB packs, but it doesn't work could some one tell where is the problem? This is the code I use

PHP Code:
public plugin_cfg( )
{
    
////////////////Nvault//////////////
    //Open our vault and have g_Vault store the handle.
    
g_Vault nvault_open"JBPACKS" );

    
//Make the plugin error if vault did not successfully open
    
if ( g_Vault == INVALID_HANDLE )
    
set_fail_state"Error opening nVault" );

    
//This will remove all entries in the vault that are 5+ (or cvar+) days old at server-start
    //or map-change
    
nvault_pruneg_Vault get_systime() - ( 86400 30 ) );
    
///////////////////////////////////
}
public 
plugin_end()
{
    
//Close the vault when the plugin ends (map change\server shutdown\restart)
    
nvault_closeg_Vault );
}

public 
client_authorized(id)
{
    
//Get the connecting users authid and store it in our global string array so it
    //will not need to be retrieved every time we want to do an nvault transaction.
    
get_user_ipid g_szip[id] , charsmaxg_szip[] ) );
}
public 
savejb(id)
{

    new 
szPacks[7];        //Data holder for the packs amount
    
new szKey[40];        //Key used to save packs "STEAM_0:0:1234MONEY"
    
    
formatexszKey charsmaxszKey ) , "%s" g_szip[id] );
    
formatexszPacks charsmaxszPacks ) , "%s" g_jbpacks[id] );
    
    
nvault_setg_Vault szKey szPacks ); 
    
     
client_printid print_chat "* Your money was saved to vault %s packs",szPacks );
    
}
public 
getjb(id)
{
    
//Read 2 items that that are saved in the same entry
    //Example: STEAM_0:0:1234 15 5

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

    
formatexszKey charsmaxszKey ) , "%s" g_szip[id] );

    
//If data was found
    
if ( nvault_getg_Vault szKey szData charsmaxszData ) ) )
    {

            new 
Paketai[4];
            

            
formatexPaketai "%s" szData );

            
//Set the players packs with these values.
           
g_jbpacks[id] = str_to_numPaketai )

            
client_printid print_chat "* Your packs was loaded: %s packs" Paketai );
        }
    }
    else
    {
        
client_printid print_chat "* You have no score entry in vault." );
    }


Last edited by usaexelent; 10-31-2011 at 14:56.
usaexelent is offline
Send a message via Skype™ to usaexelent
 



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 14:27.


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