Raised This Month: $ Target: $400
 0% 

How to save easier in nvault?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-09-2017 , 09:36   Re: How to save easier in nvault?
Reply With Quote #5

Assign values for each player like this:

g_pdData[ id ][ Crimson ] = 343;
g_pdData[ id ][ Burner ] = 123;

PHP Code:

#include <amxmodx>
#include <nvault_array>

#define MAX_PLAYERS 32

enum PlayerData
{
    
Glock,
    
Burner,
    
Carbon,
    
Crimson,
    
Gradient,
    
Krolewski,
    
Krwawy
}

new 
g_pdDataMAX_PLAYERS ][ PlayerData ];
new 
g_szAuthIDMAX_PLAYERS ][ 34 ];
new 
bool:g_bIgnorePlayerMAX_PLAYERS ];
new 
zapis_vault;

public 
plugin_init() 
{
    
zapis_vault nvault_open"zapis_vault" );
}

public 
plugin_end()
{
    
nvault_closezapis_vault );
}

public 
client_authorizedid )
{
    if ( !( 
g_bIgnorePlayerid ] = ( is_user_botid ) || is_user_hltvid ) ) ) ) 
    {
        
get_user_authidid g_szAuthIDid ] , charsmaxg_szAuthID[] ) );
        
LoadDataid );
    }
}

public 
client_disconnectid )
{
    if ( !
g_bIgnorePlayerid ] )
    {
        
SaveDataid );
    }

    
arraysetg_pdDataid ][ PlayerData:] , sizeofg_pdData[] ) );
}

public 
SaveDataid 
{  
    
nvault_set_arrayzapis_vault g_szAuthIDid ] , g_pdDataid ][ PlayerData:] , sizeofg_pdData[] ) );


public 
LoadDataid )  
{  
    
nvault_get_arrayzapis_vault g_szAuthIDid ] , g_pdDataid ][ PlayerData:] , sizeofg_pdData[] ) );

__________________

Last edited by Bugsy; 02-09-2017 at 10:20.
Bugsy 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 20:42.


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