Quote:
Originally Posted by Sylwester
That's because you open and close nvault every time you save or load data. Open it in plugin_init and close in plugin_end to get rid of lags.
|
Oh I didn't know that.
By the way, I feel bad to ask you, but can you change another plugin I have to mysql saving? This one is really small, and I've tried using the way above, but I just fail and it bugs.
Here are the saving/loading codes.
PHP Code:
public client_connect( id )
{
load_jumps( id )
}
public client_disconnect( id )
{
save_jumps( id )
}
PHP Code:
public save_jumps( id )
{
new jump_data[ 128 ],sSteam_Id[ 40 ], key_format[ 238 ]
get_user_authid( id, sSteam_Id, 39 )
formatex( key_format, 237, "%s-Jumps", sSteam_Id )
num_to_str( vJump[ id ], jump_data, 127 )
fvault_set_data( vault, key_format, jump_data )
}
public load_jumps( id )
{
new jump_data[ 128 ],sSteam_Id[ 40 ], key_format[ 238 ]
get_user_authid( id, sSteam_Id, 39 )
formatex( key_format, 237, "%s-Jumps",sSteam_Id )
fvault_get_data( vault, key_format, jump_data, 15 )
vJump[ id ] = str_to_num( jump_data )
}