绝影华
|
分享:
▼
x0
|
[1.6][插件] 关于等级插件存档问题
我自创了一种等级插件
但set了自动存档入到GAME杀了几个人有一堆经验
重开场后全部没有帮我存档
这等级有4种东西
new g_xp[33] // 玩家的经验值 new g_level[33] // 玩家的等级 new g_kill[33] // 杀玩家次数 new g_damage[33] // 玩家的给予伤害累积
下面是sma档入面关于save的文字...请大家帮忙有什么问题
register_clcmd("say /save","client_disconnect") g_vault = nvault_open("LevelSystem2")
public client_disconnect(id) { SaveData(id) }
public client_putinserver(id) { LoadData(id) }
public SaveData(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#%i#", g_xp[id], g_level[id], g_damage[id], g_kill[id])
nvault_set(g_vault, vaultkey, vaultdata)
return PLUGIN_CONTINUE }
public LoadData(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#%i#", g_xp[id], g_level[id], g_damage[id], g_kill[id])
nvault_get(g_vault, vaultkey, vaultdata, 255)
replace_all(vaultdata, 255, "#", " ")
new playerxp[32], playerlevel[32], playerdamage[32], playerkill[32] parse(vaultdata, playerxp, 31, playerlevel, 31, playerdamage, 31, playerkill, 31)
g_xp[id] = str_to_num(playerxp)
g_level[id] = str_to_num(playerlevel)
g_damage[id] = str_to_num(playerdamage)
g_kill[id] = str_to_num(playerkill)
return PLUGIN_CONTINUE }
|