Raised This Month: $ Target: $400
 0% 

Save Money


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-24-2009 , 17:58   Save Money
Reply With Quote #1

Will this work?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <cstrike>

new g_szAuthID[33][33];
new 
g_iBot[33];
new 
g_iMoney[33];
new 
g_pEnabled;
new 
g_iVault;
new const 
g_szVaultFile[] = "Save_Money";

public 
plugin_init()
{
    
register_plugin"Save_money" "1.0" "-Acid-" );
    
g_pEnabled register_cvar"sm_enabled" "1" );
    
    
}

public 
plugin_cfg()
{
    
g_iVault nvault_openg_szVaultFile );
    
    if ( 
g_iVault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
    
    
g_iBotid ] = is_user_botid );
    
    if ( !
g_iBotid ] )
    {
        
get_user_authidid g_szAuthIDid ] , 32 );
        
        new 
iMoney nvault_getg_iVault g_szAuthIDid ] );
        
        if ( 
iMoney )
        {
            
g_iMoneyid ] = iMoney;
            
cs_set_user_moneyid iMoney );
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnectid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
    
    if ( !
g_iBotid ] && g_iMoneyid ] )
    {
        new 
szMoney];
        
num_to_strg_iMoney[id] , szMoney );
        
        
nvault_setg_iVault g_szAuthIDid ] , szMoney );
    }
    
    
g_iMoneyid ] = 0;
    
g_iBotid ] = 0;
    
    return 
PLUGIN_CONTINUE;


Save a players money
__________________
-Acid- 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 15:38.


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