I have this code to use nVault. I was running it with the nvault_close commented out and it worked great. The only issue was that the data was lost whenever I restarted the server. Since nvault_close is fixed in 1.6, I am trying to use it. With it un-commented, no data is getting stored at all. I do not understand why nvault_close would keep the data from being stored?
Code:
public client_disconnect (id){ //Update players stored time
if ( is_user_bot(id) ) { //Do not add to nVault
return PLUGIN_CONTINUE
}
if (is_user_hltv(id) ) { //Do not add to nVault
return PLUGIN_CONTINUE
}
new authid[32]
new playtime = get_user_time (id)
get_user_authid(id,authid,31)
gVaultHandle = nvault_open(VAULTNAME)
if (gVaultHandle == INVALID_HANDLE) {
log_amx("Error opening nVault file: %s",VAULTNAME)
}
new tmp_vault_time, vault_time[21], TimeStamp
nvault_lookup(gVaultHandle, authid, vault_time, 20, TimeStamp)
tmp_vault_time = str_to_num(vault_time)
tmp_vault_time += playtime
num_to_str(tmp_vault_time,vault_time,20)
nvault_set(gVaultHandle, authid, vault_time)
nvault_close(gVaultHandle)
return PLUGIN_CONTINUE
}