下面是引用 森之千手 於 2010-05-10 21:08 發表的 :
不用SaveData,LoadData試試
可用
xp_load_data,xp_save_data
我改成這樣
複製程式
public client_putinserver(id)
{
Xp_Load_Data(id)
}
public client_disconnect(id)
{
Xp_Save_Data(id)
}
public Xp_Save_Data(id)
{
new name[35], vaultkey[64], vaultdata[256]
get_user_name(id, name, 34)
format(vaultkey, 63, "%s-LevelInfo", name)
format(vaultdata, 255, "%i#%i#%i#", g_xp[id], g_level[id], g_damage[id])
nvault_set(g_vault, vaultkey, vaultdata)
}
public Xp_Load_Data(id)
{
new name[35], vaultkey[64], vaultdata[256]
get_user_name(id,name,34)
format(vaultkey, 63, "%s-LevelInfo", name)
format(vaultdata, 255, "%i#%i#%i#", g_xp[id], g_level[id], g_damage[id])
nvault_get(g_vault, vaultkey, vaultdata, 255)
replace_all(vaultdata, 255, "#", " ")
new playerxp[32], playerlevel[32], playerdamage[32]
parse(vaultdata, playerxp, 31, playerlevel, 31, playerdamage, 31)
g_xp[id] = str_to_num(playerxp)
g_level[id] = str_to_num(playerlevel)
g_damage[id] = str_to_num(playerdamage)
}
成功轉檔了..可是成不成功就不知道= =現在測試一下