AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please help me. (https://forums.alliedmods.net/showthread.php?t=171022)

usaexelent 10-31-2011 14:59

Please help me.
 
I'm editing Shop plugin for JB to make that jbpacks would be saved and the packs don't save could some one please help me :cry:

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." );
    }




All times are GMT -4. The time now is 14:27.

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