文♂
|
分享:
▼
x0
|
[1.6][插件] [nvault问题] 会nvault的高手可不可以指点一下?
这是加载资料的 复制程式
LoadData(id)
{
new vaultkey[256], datalen, playerlevel[33], playerexp[33], playerjob[33], playerdamage[33]
format(vaultkey, charsmax(vaultkey), "Account-%s-Password-%s-Level-%i-Exp-%i-Job-%i-Damage-%i", user_name[id], user_password[id], level[id], exp[id], job[id], totaldamage[id])
nvault_get(nvault_fp, vaultkey, charsmax(vaultkey))
datalen = strlen(user_password[id])
parse(vaultkey, playerlevel, charsmax(playerlevel[]), playerexp, charsmax(playerlevel[]), playerjob, charsmax(playerjob[]), playerdamage, charsmax(playerdamage[]))
level[id] = str_to_num(playerlevel)
exp[id] = str_to_num(playerexp)
job[id] = str_to_num(playerjob)
totaldamage[id] = str_to_num(playerdamage)
if (datalen)
{
user_registered[id] = true
remove_task(id+TASK_USER)
set_task(1.0, "player_input_password", id+TASK_USER)
log_to_file(LogFilePath, "Load User Account: (^"%s^") (Password:^"%s^")", user_name[id], user_password[id])
}
else
{
user_registered[id] = false
log_to_file(LogFilePath, "User Account Not Found: *UNREGISTER* (^"%s^")", user_name[id])
}
} 这是保存资料的 复制程式
SaveData(id)
{
if (user_registered[id])
{
new vaultdata[64], vaultkey[256]
format(vaultdata, charsmax(vaultdata), "Account-%s-Password-%s-", user_name[id], user_password[id])
format(vaultkey, charsmax(vaultkey), "Level-%i-Exp-%i-Job-%i-Damage-%i", level[id], exp[id], job[id], totaldamage[id])
nvault_set(nvault_fp, vaultdata, vaultkey)
}
} 保存资料就已经行了 但是不能加载资料 可不可以指点一下我有怎么写错了
[ 此文章被文♂在2011-08-27 15:13重新编辑 ]
|
|
x0
[楼 主]
From:香港网上行 | Posted:2011-08-26 15:11 |
|
|
|