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 |
|
|
|