killer200
|
分享:
▼
x0
|
[1.6][插件] 請求插件高手救救我!!!!
(關於Nvault的...)
小弟想在Diablo2插件中加入自制的轉生系統,但不會儲存一些數據.... 例如:我想儲存該玩家轉生後的重力,在下次入server時自動設定該玩家的重力. 應該怎樣做...
public SaveData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id, name, 31) format(vaultkey, 63, "%s-mod", name) format(vaultdata, 255, "%i#%i#%i#", get_user_gravity(id)) nvault_set(g_vault, vaultkey, vaultdata) } public LoadData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id,name,31) format(vaultkey, 63, "%s-caxp", name) format(vaultdata, 255, "%i#%i#%i#", get_user_gravity(id)) nvault_get(g_vault, vaultkey, vaultdata, 255) replace_all(vaultdata, 255, "#", " ") new get_user_gravity(id) parse(vaultdata, get_user_gravity(id))
// str_to_num 是把字串轉變為數字 // 由於讀出來的是字串, 所以要轉變 get_user_gravity(id) = str_to_num(get_user_gravity(id)) } 這樣嗎...???
|
My name is killer200~~~~~~~~~~~~
|
x0
[樓 主]
From:香港 | Posted:2012-12-28 23:04 |
|
|
觀眾甲
|
分享:
▲
▼
public SaveData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id, name, 31) format(vaultkey, 63, "%s-mod", name) format(vaultdata, 255, "%.1f", get_user_gravity(id)) nvault_set(g_vault, vaultkey, vaultdata) } public LoadData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id,name,31) format(vaultkey, 63, "%s-mod", name) format(vaultdata, 255, "%.1f", get_user_gravity(id)) nvault_get(g_vault, vaultkey, vaultdata, 255) replace_all(vaultdata, 255, "#", " ") new Float:data1[33] parse(vaultdata, data1, 32) set_user_gravity(id, str_to_float(data1)) } 這樣可以嗎= =?
|
|
x0
[3 樓]
From:美國 | Posted:2012-12-29 14:58 |
|
|
killer200
|
分享:
▲
▼
format(vaultdata, 255, "%.1f", get_user_gravity(id))
那個 %.1f 是甚麼....??
那麼我有其他數據
public SaveData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id, name, 31) format(vaultkey, 63, "%s-mod", name) format(vaultdata, 255, "%.1f%.1f", get_user_gravity(id),get_user_maxspeed(id)) nvault_set(g_vault, vaultkey, vaultdata) } public LoadData(id) { new name[32], vaultkey[64], vaultdata[256] get_user_name(id,name,31) format(vaultkey, 63, "%s-mod", name) format(vaultdata, 255, "%.1f%.1f", get_user_gravity(id),get_user_maxspeed(id)) nvault_get(g_vault, vaultkey, vaultdata, 255) replace_all(vaultdata, 255, "#", " ") new Float:data1[33] parse(vaultdata, data1, 32) set_user_gravity(id, str_to_float(data1)) set_user_maxspeed(id, str_to_float(data1)) } 這樣嗎...???
[ 此文章被killer200在2012-12-29 18:39重新編輯 ]
|
My name is killer200~~~~~~~~~~~~
|
x1
[4 樓]
From:香港 | Posted:2012-12-29 18:32 |
|
|
|