Alright, so here's the basic problem:
When there's no vault file, I can change the map, and it will work perfectly fine, but if someone kills someone, and it saves something to the vault, and I change the map, it crashes. What could possibly be the problem?
PHP Code:
public Save_Data(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64], vaultdata[256]
if(pub_Class[id] == WARRIOR)
{
formatex(vaultkey,63,"%s-xp-%i-class",AuthID, WARRIOR)
}
else
{
formatex(vaultkey,63,"%s-xp-%i-class",AuthID, ASSASSIN);
}
formatex(vaultdata, 254, "%i#%i#%i#%i#%i#%i", pub_Stats[id][EXP],
pub_Stats[id][LVL], pub_Stats[id][AGILITY], pub_Stats[id][TRANSPARENCY],
pub_Stats[id][STRENGTH], pub_Stats[id][HEALTH]
);
nvault_set(g_Vault, vaultkey, vaultdata);
formatex(vaultkey, charsmax(vaultkey), "%s-stats", AuthID);
nvault_set(g_Vault, vaultkey, pub_Stats[id][STATSCOUNT]);
}
public Load_Data(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64];
formatex(vaultkey,63,"%s-xp-%i-class",AuthID, pub_Class[id])
new Data[256]
nvault_get(g_Vault, vaultkey, Data, charsmax(Data));
replace_all(Data, charsmax(Data), "#", " ");
new exp[10], lvl[10], agi[10], trans[10], str[10], health[10];
parse(Data, exp, charsmax(exp), lvl, charsmax(lvl), agi, charsmax(agi),
trans, charsmax(trans), str, charsmax(str), health, charsmax(health)
);
pub_Stats[id][EXP] = str_to_num(exp);
pub_Stats[id][LVL] = str_to_num(lvl);
pub_Stats[id][AGILITY] = str_to_num(agi);
pub_Stats[id][TRANSPARENCY] = str_to_num(trans);
pub_Stats[id][STRENGTH] = str_to_num(str);
pub_Stats[id][HEALTH] = str_to_num(health);
formatex(vaultkey, charsmax(vaultkey), "%s-stats", AuthID);
pub_Stats[id][STATSCOUNT] = nvault_get(g_Vault, vaultkey);
}
Some possibly useful information:
-The nVault is closed at plugin_end()
-The nVault only loads data when the person joins a team
__________________