pohong
|
分享:
▼
x0
|
[1.6][插件] 【已解決】Menu-Skill問題
我自己寫完了後,試試用,結果血量技能只能升一級....請大家幫我作出修改。和血量裏沒有顯示另外的1血 複製程式
new health[33]
public plugin_init()
{
register_clcmd("skillmenu","skillmenu")
}
public skillmenu(id)
{
new show[256]
formatex(show,255,"\rSkill")
new menu = menu_create(show,"skillmenumenu")
formatex(show,255,"\wHealth[%d/100]",health[id])
menu_additem(menu,show,"1",0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public skillmenumenu(id, item, menu)
{
if( item == MENU_EXIT )
{
return PLUGIN_HANDLED;
menu_destroy(menu);
}
new data[6], iName[64]
new access, callback;
menu_item_getinfo(menu, item ,access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
if(get_user_sk(id) >= 1)
{
health[id] ++
skillmenu(id)
set_user_sk(id, get_user_sk(id) - 1)
}
else
{
client_print(id, print_chat, "You Have Not Skill Point")
skillmenu(id)
}
}
}
}
public fw_Player_Pre_Think(id)
{
if(!is_user_alive(id))
{
return
}
else
{
set_pev(id pev_health,float(pev(id, pev_health) + health[id])
}
}
[ 此文章被pohong在2013-08-06 21:12重新編輯 ]
|
|
x0
[樓 主]
From:未知地址 | Posted:2013-08-05 13:00 |
|
|
pohong
|
分享:
▲
▼
下面是引用 s8720419 於 2013-08-05 20:28 發表的 :
你取得point那邊判斷 應該有問題
一般來說 case 都會有效
除非你判斷寫錯,通常應該都會有效 不可能判錯。因為我試過用下面的client_print都是沒反應啊..... 複製程式
new data[6],IName[64]
new access, callback;
menu_item_getinfo(menu,access, data, 5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:
{
client_print(id, print_chat," Hello")
}
}
|
|
x0
[7 樓]
From:未知地址 | Posted:2013-08-05 20:51 |
|
|
|