文♂
|
分享:
▼
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 |
|
|
|