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_points( index )
{
/* --| 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_authid( index, gSteamID, charsmax( gSteamID ) );
/* --| Setting stuff on vault file, and close the file */
formatex( vKey, charsmax( vKey ), "%sPOINTS", gSteamID );
formatex( vData, charsmax( vData ), "%d", gKillerPoints[ index ] );
nvault_set( gVault, vKey, vData );
nvault_close( gVault );
}
/* --| Loading client points */
stock load_client_points( index )
{
/* --| 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_authid( index, gSteamID, charsmax( gSteamID ) );
/* --| Get the player points, then, close the nvault vile */
formatex( vKey, charsmax( vKey ), "%sPOINTS", gSteamID );
gKillerPoints[ index ] = nvault_get( gVault, vKey );
nvault_close( gVault );
}
and edited functions:
PHP Code:
stock save_client_points( index )
{
/* --| 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(index, namepoints, charsmax(namepoints));
/* --| Setting stuff on vault file, and close the file */
formatex( vKey, charsmax( vKey ), "%sPOINTS", namepoints);
formatex( vData, charsmax( vData ), "%d", gKillerPoints[ index ] );
nvault_set( gVault, vKey, vData );
nvault_close( gVault );
}
/* --| Loading client points */
stock load_client_points( index )
{
/* --| 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(index, namepoints, charsmax(namepoints));
/* --| Get the player points, then, close the nvault vile */
formatex( vKey, charsmax( vKey ), "%sPOINTS", namepoints );
gKillerPoints[ index ] = nvault_get( gVault, vKey );
nvault_close( gVault );
}
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