這是保存資料的
複製程式
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)
}
}
複製程式
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
set_task(1.0, "player_input_password", id)
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])
}
}
好像能保存,但是在遊戲好像不能讀取
高手們可不可以指出我的錯誤呢
------------------------------------
另一個問題就是
怎樣修改get_user_msgid("StatusText") - 瞄準目標的顏色
希望各位大大不要見怪
小弟實在不明白才發問