Raised This Month: $ Target: $400
 0% 

STEAMID saving to name saving


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Change377
Junior Member
Join Date: Aug 2010
Old 07-23-2011 , 07:47   STEAMID saving to name saving
#1

Hey,
I edited plugin (deathrun shop). Points have been saving by authid, and i wanted saving by name. Original functions (save and load points):

PHP Code:
stock save_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Setting stuff on vault file, and close the file */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
formatexvDatacharsmaxvData ), "%d"gKillerPointsindex ] );
    
nvault_setgVaultvKeyvData );
    
nvault_closegVault );
}

/* --| Loading client points */
stock load_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_authidindexgSteamIDcharsmaxgSteamID ) );
    
    
/* --| Get the player points, then, close the nvault vile */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"gSteamID );
    
gKillerPointsindex ] = nvault_getgVaultvKey );
    
nvault_closegVault );

and edited functions:
PHP Code:
stock save_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
/* --| Get the player steamid */
    
get_user_name(indexnamepointscharsmax(namepoints));
    
    
/* --| Setting stuff on vault file, and close the file */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"namepoints);
    
formatexvDatacharsmaxvData ), "%d"gKillerPointsindex ] );
    
nvault_setgVaultvKeyvData );
    
nvault_closegVault );
}

/* --| Loading client points */
stock load_client_pointsindex )
{
    
/* --| Open the vault file */
    
gVault nvault_open"DeathrunShop_SavedPoints" );
    
    
/* --| If vault return -1, lets stop this shit */
    
if( gVault == INVALID_HANDLE )
    {
        
set_fail_state"[DrShop] nValut ERROR: =-> Invalid-Handle" );
    }
    
    
    
/* --| Get the player steamid */
    
get_user_name(indexnamepointscharsmax(namepoints));
    
    
/* --| Get the player points, then, close the nvault vile */
    
formatexvKeycharsmaxvKey ), "%sPOINTS"namepoints );
    
gKillerPointsindex ] = nvault_getgVaultvKey );
    
nvault_closegVault );

No errors/warnings, but saving is still by authid (after server restart, changing map etc, I can disconnect, change my name and reconnect, and my points have still the same value. Whats wrong?
Thanks

Last edited by Change377; 07-23-2011 at 09:47.
Change377 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 01:09.


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