Raised This Month: $ Target: $400
 0% 

New to nVault


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2010 , 05:33   New to nVault
Reply With Quote #1

Instead of working with cash (in Bugsy's nVault Tutorial), I would like it to save points. Something for you to edit:
PHP Code:
public plugin_cfg()
{
    
g_Vault nvault_open"zombiedefiance" );
    
    if ( 
g_Vault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );

    
nvault_pruneg_Vault get_systime() - ( 86400 get_pcvar_numg_pExpireDays ) ) );
}

public 
plugin_end()
{
    
nvault_closeg_Vault );
}

public 
client_authorized(id)
{
    
get_user_authidid g_szAuthID[id] , 34 );
}

public 
cmdSavePoints(id)
{
    new 
szMoney[7];        //Data holder for the money amount
    
new szKey[40];        //Key used to save money "STEAM_0:0:1234MONEY"

    
formatexszKey 39 "%sMONEY" g_szAuthID[id] );
    
formatexszMoney"%d" cs_get_user_money(id) );
    
    
nvault_setg_Vault szKey szMoney );

    
client_print_coloridBlue"^4[ZD]^3 ** Your money was saved to vault **" );
}

public 
cmdGetPoints(id)
{
    new 
szKey[40];
    
formatexszKey 39 "%sMONEY" g_szAuthID[id] );
    new 
iMoney nvault_getg_Vault szKey );

    if ( 
iMoney )
    {
        
cs_set_user_moneyid iMoney );
        
nvault_removeg_Vault szKey );

        
client_print_coloridBlue"^4[ZD] ^3** Your money was loaded from vault:^4 $%d **"iMoney );
    }
    else
    {
        
client_print_coloridBlue"^4[ZD] ^3** You have no money entry in vault. **" );
    }

Thank you very much in advance.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
 



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:42.


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