Code: Select all
new gVault;new gIP[ 32 ];new vKey[ 64 ];new vData[ 64 ]; /* --| Saving JBPacks */stock save_client_points( index ){ /* --| Open the vault file */ gVault = nvault_open( "JBPacks_Bankas" ); /* --| If vault return -1, lets stop this shit */ if( gVault == INVALID_HANDLE ) { set_fail_state( "[INFO] nValut ERROR: =-> Invalid-Handle" ); } /* --| Get the player ip */ get_user_ip( index, gIP, charsmax( gIP ), 1 ); /* --| Setting stuff on vault file, and close the file */ formatex( vKey, charsmax( vKey ), "%sPOINTS", gIP ); formatex( vData, charsmax( vData ), "%d", g_jbpacks[ index ] ); nvault_set( gVault, vKey, vData ); nvault_close( gVault );} /* --| Loading client JBPacks */stock load_client_points( index ){ /* --| Open the vault file */ gVault = nvault_open( "JBPacks_Bankas" ); /* --| If vault return -1, lets stop this shit */ if( gVault == INVALID_HANDLE ) { set_fail_state( "[INFO] nValut ERROR: =-> Invalid-Handle" ); } /* --| Get the player ip */ get_user_ip( index, gIP, charsmax( gIP ), 1 ); /* --| Get the player points, then, close the nvault vile */ formatex( vKey, charsmax( vKey ), "%sPOINTS", gIP ); g_jbpacks[ index ] = nvault_get( gVault, vKey ); nvault_close( gVault );}