I'm getting a warning with the nvault_lookup function...I'm not exactly sure how to check
by key and see if an entry is already there...the warning says: "warning 202: number of arguments does not match definition" will this still work with the warning or am I using it wrong?
Code:
public client_authorized(id)
{
new vaultid = nvault_open("credits")
new authid[32], vault_time[21]
get_user_authid(id,authid,31)
if(nvault_lookup(vaultid,authid)!=0) <---look here
{
vault_time = nvault_get(vaultid,authid,20)
connecttime[id] = str_to_num(vault_time)
}
else
{
connecttime[id] = numnewcredits * credittime
num_to_str(connecttime[id],vault_time,20)
nvault_set(vaultid,authid,vault_time)
}
nvault_close(vaultid)
return PLUGIN_CONTINUE
}
I'm also getting an error with the nvault_get function...I'm not exactly sure how to use this now compared to the old vault way...the error is saying: "error 033: array must be indexed <variable "vault_time">"
Code:
public client_disconnect(id)
{
new vaultid = nvault_open("credits")
Armor[id] = 0
Health[id] = 0
Speed[id] = 0
Gravity[id] = 0
Stealth[id] = 0
hpstlr[id] = 0
regeneration[id] = 0
weapontraining[id] = 0
jumpmodule[id] = 0
climb[id] = 0
promotion[id] = 0
gHasuammo[id] = 0
sshoe[id] = 0
wired[id] = 0
esp[id] = 0
laser[id] = 0
sgrenade[id] = 0
crowbar[id] = 0
itemcap[id] = 0
creditsspent[id] = 0
lastplaytime[id] = 0
remove_task(id)
new authid[32]
new playtime = (get_user_time(id) - lastplaytime[id])
get_user_authid(id,authid,31)
new tmp_vault_time,vault_time[21]
vault_time = nvault_get(vaultid,authid,20) <---look here
tmp_vault_time = str_to_num(vault_time)
tmp_vault_time += playtime
num_to_str(tmp_vault_time,vault_time,20)
nvault_set(vaultid,authid,vault_time)
nvault_close(vaultid)
return PLUGIN_CONTINUE
}
__________________