if i am closing nvault and reopen with an set task interval 120 .. this will be very laggy ?
#define AUTOSAVE_INTERVAL 120.0
public plugin_cfg()
{
set_task(AUTOSAVE_INTERVAL, "TaskAutoSave",_,_,_,"b")
}
and is saving like this
PHP Code:
public TaskAutoSave()
{
for(new id = 1; id <= g_maxplayers; id++)
{
if(is_user_connected(id) && flag_get(g_loadSuccess,id)) SaveAmmo(id);
}
}
SaveAmmo(id)
{
gvault = nvault_open(g_vault_name);
if(!flag_get(g_loadSuccess,id))
{
server_print("[AutoSaveAmmoPack] User [%i] failed to save AP because it not loaded yet!", id)
return
}
g_ammo[id] = zp_get_user_ammo_packs(id)
new authid[35]
get_user_authid(id, authid, sizeof(authid) - 1)
new data[16]
num_to_str(g_ammo[id], data, sizeof(data) - 1)
nvault_set(gvault, authid, data)
nvault_close(gvault);
}
i realy need this kind of saving for prevent losing data on crash ... i was using fvault system before and i knew that nvault is more faster ... but i was thinking if this kind of using nvault will be more laggy then fvault ?