This is my nvault code
PHP Code:
public SaveData(id)
{
new szIP[35]
get_user_ip(id, szIP, 34)
new szKey[64], szData[256]
for (new RaceID = 1; RaceID < MaxRaces; RaceID++)
{
format(szKey, 63, "%s-xWar", szIP)
format(szData, 255, "%i#%i#%i#", PlayerLevel[id][RaceID], PlayerXP[id][RaceID], PlayerPoints[id][RaceID])
}
nvault_set(Nvault, szKey, szData)
}
public LoadData(id)
{
new szIP[35]
get_user_ip(id, szIP, 34)
new szKey[64], szData[256]
parse(szData, Level, 31, XP, 31, Points, 31)
new Level[32], XP[32], Points[32]
for (new RaceID = 1; RaceID < MaxRaces; RaceID++)
{
format(szKey, 63, "%s-xWar", szIP)
format(szData, 255, "%i#%i#%i#", PlayerLevel[id][RaceID], PlayerXP[id][RaceID], PlayerPoints[id][RaceID])
PlayerLevel[id][RaceID] = str_to_num(Level)
PlayerXP[id][RaceID] = str_to_num(XP)
PlayerPoints[id][RaceID] = str_to_num(Points)
}
nvault_get(Nvault, szKey, szData, 255)
replace_all(szData, 255, "#", " ")
}
Why it don't works? It works when I reconnect in server, but if I change map or restart server nvault won't load my xp, level....