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