View Single Post
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 11-06-2010 , 22:44   Re: [INC] nVault Utility
Reply With Quote #6

Code:
public plugin_cfg()
{
    g_iValut = nvault_util_open( "valut" );
}
public client_authorized( id )
{
    get_user_authid( id , g_szAuthid[ id ] , charsmax( g_szAuthid[] ) );
 
    new iPos , szKey[ 32 ] , szVal[ 64 ] , iTimeStamp;
    new iCount = nvault_util_count( g_iValut );
 
    for ( new iCurrent = 1 ; iCurrent <= iCount ; iCurrent++ )
    {
        iPos = nvault_util_read( g_iValut , iPos , szKey , charsmax( szKey ) , szVal , charsmax( szVal ) , iTimeStamp );
        if ( equal( szKey , g_szAuthid[ id ] ) )
        {
            g_iVal[ id ] = str_to_num( szVal );
            break;
        }
    }
}
 
public plugin_end()
{
    nvault_util_close( g_iValut );
}
Is it right ?
if so, the problem is coming,
1. whether I should use the loop to get the player data when player is connecting to the server ?
2. If I want to set player data, just use nvault's nvault_set(), right ?
__________________
QQ:116268742

Last edited by K.K.Lv; 11-06-2010 at 22:49.
K.K.Lv is offline
Send a message via MSN to K.K.Lv