|
不知道哪里出错了,菜单可以打开,但是按相应按键后没效果
- /*本插件由ReD战队 夜琴制作
- BY:[ ReD ] > YeqinG < [Amxx]*/
- #include <amxmodx>
- #include <amxmisc>
- #include <fun>
- #include <engine>
- #include <cstrike>
- #include <fakemeta>
- #include <hamsandwich>
- new bool:sbs[33]=false
- new bool:yezb[33]=false
- new bool:sj[33]=false
- new bool:dz[33]=false
- public plugin_init()
- {
- register_concmd( "say /shop","ShowMenu", -1, "xscd" )
- register_menucmd(register_menuid("\ySilent战队 商店菜单:"), 1023, "MenuCommand" )
- /*register_event("CurWeapon","daozi","b")*/
- RegisterHam(Ham_TakeDamage ,"player","falldamage")
- RegisterHam(Ham_Spawn,"player","ye",1)
- register_forward(FM_PlayerPreThink,"shijiao")
- return PLUGIN_CONTINUE
- }
- public daozi(id)
- {
- if(is_user_alive(id)&&dz[id]==true&&get_user_weapon(id)==CSW_KNIFE)
- {
- set_pev(id,pev_viewmodel2,"models/Yq_d.mdl")
- }
- else if(is_user_alive(id)&&dz[id]==false&&get_user_weapon(id)==CSW_KNIFE)
- {
- set_pev(id,pev_viewmodel2,"models/v_knife.mdl")
- }
- }
- public shijiao(id)
- {
- if(is_user_alive(id)&&sj[id]==true)
- {
- set_pev(id,pev_fov,180.0)
- set_pev(id,pev_view_ofs,{0.0,0.0,0.01})
- }
- }
- public plugin_precache()
- {
- precache_model("models/player/gsg9/gsg9.mdl")
- precache_model("models/player/arctic/arctic.mdl")
- precache_model("models/player/Yq_ct/Yq_ct.mdl")
- precache_model("models/player/Yq/Yq.mdl")
- precache_model("models/player/Yq_t/Yq_t.mdl")
- precache_model("models/v_knife.mdl")
- precache_model("models/Yq_d.mdl")
- return PLUGIN_CONTINUE
- }
- public ye(id)
- {
-
- dz[id]=false
- yezb[id]=false
- set_pev(id,pev_fov,90.0)
- set_pev(id,pev_view_ofs,{0.0,0.0,20.0})
- sj[id]=false
- if(cs_get_user_team(id)==CS_TEAM_CT&&get_user_flags(id) & ADMIN_LEVEL_A)
- {
- cs_set_user_model(id,"Yq_ct")
- }
- else if(cs_get_user_team(id)==CS_TEAM_T&&get_user_flags(id) & ADMIN_LEVEL_A)
- {
- cs_set_user_model(id,"Yq_t")
- }
- else if(cs_get_user_team(id)==CS_TEAM_CT)
- {
- cs_set_user_model(id,"gsg9")
- }
- else if(cs_get_user_team(id)==CS_TEAM_T)
- {
- cs_set_user_model(id,"arctic")
- }
- }
- public ShowMenu( id )
- {
- new caidan[512]
- new keys
- new YQ = format( caidan, 511, "\rSilent战队 商店菜单:^n" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w1. \y信春哥,得永生($16000复活)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w2. \y信春哥,摔不死($10000五秒摔不死)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w3. \y信春哥,能逃生!($5000能隐身耶)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w4. \y信曾哥,能加血!($6000瞬间加100血量)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w5. \y信夜琴,射CT($10000琴哥给你AWP)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w6. \y信夜琴,能装逼($0免费带你飞)" )
- YQ += format( caidan[YQ], 511-YQ, "^n\w7. \y信夜琴,能换衣($10000给你一件敌对的衣服)." )
- YQ += format( caidan[YQ], 511-YQ, "^n\w8. \y变身迷你狗!($8000让你变成非常小的狗)")
- YQ += format( caidan[YQ], 511-YQ, "^n\w9. \y尼泊尔大屌刀($500给你宝刀)" )
- YQ += format( caidan[YQ], 511-YQ, "^n^n\w0. 退出菜单" )
- keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
- show_menu( id, keys, caidan, -1 )
- return PLUGIN_CONTINUE
- }
- public fuhuo(id)
- {
- new a=16000
- new b=cs_get_user_money(id)
- new name[32]
- get_user_name(id,name,31)
- if(b>=a&&!is_user_alive(id))
- {
- cs_set_user_money (id,b-a,1)
- client_print(0,print_chat,"[Silent战队]玩家%s使用了复活道具",name)
- ExecuteHamB(Ham_CS_RoundRespawn,id)
- }
- else if (b<a)
- {
- client_print(id,print_chat,"[Silent战队]金钱不足%d",a)
- }
- else if (is_user_alive(id))
- {
- client_print(id,print_chat,"[Silent战队]那么想复活,你先死了好了!")
- }
- }
- public shuaibusi(id)
- {
- new a=10000
- new b=cs_get_user_money(id)
- new name[32]
- get_user_name(id,name,31)
- if(b>=a&&is_user_alive(id))
- {
- cs_set_user_money (id,b-a,1)
- client_print(0,print_chat,"[Silent战队]玩家%s说信春哥,摔不死!",name)
- sbs[id]=true
- set_task(5.0,"fall",id)
- }
- else if(b<a)
- {
- client_print(id,print_chat,"[Silent战队]金钱不足")
- }
- else if(!is_user_alive(id))
- {
- client_print(id,print_chat,"[Silent战队]首先你必须是活的!")
- }
- }
- public fall(id)
- {
- sbs[id]=false
- client_print(id,print_chat,"[Silent战队]真男人时间结束,不要再跳楼了")
- }
- public falldamage(id,victim, inf, attacker, Float:damage, damage_type)
- {
- if(sbs[id]==false&&damage_type != DMG_FALL)return HAM_IGNORED
- return HAM_SUPERCEDE
- }
- public jiaxue(id)
- {
- new a=6000
- new b=cs_get_user_money(id)
- new name[32]
- get_user_name(id,name,31)
- if(b>=a&&is_user_alive(id))
- {
- cs_set_user_money (id,b-a,1)
- client_print(0,print_chat,"[Silent战队]玩家%s说信曾哥,给我血!结果顺利获得100HP!",name)
- new x=get_user_health(id)
- set_user_health (id,x+100)
- }
- else if(b<a)
- {
- client_print(id,print_chat,"[Silent战队]金钱不足")
- }
- else if(!is_user_alive(id))
- {
- client_print(id,print_chat,"[Silent战队]首先你必须是活的!")
- }
- }
- public yinshen(id)
- {
- new a=5000
- if(cs_get_user_money(id)>=a&&is_user_alive(id))
- {
- new name[32]
- get_user_name(id,name,31)
- new b=cs_get_user_money(id)
- b=b-5000
- cs_set_user_money (id,b,1)
- set_pev(id,pev_effects,EF_NODRAW)
- client_print(id,print_chat,"[Silent战队]购买成功,隐身5秒!")
- set_task(5.0,"YSJS",id)
- client_print(0,print_chat,"[Silent战队]玩家 %s 使用了逃生道具!",name)
- }
- else if(cs_get_user_money(id)<=a)
- {
- client_print(id,print_chat,"[Silent战队]金钱不足!")
- }
- else if(!is_user_alive(id))
- {
- client_print(id,print_chat,"[Silent战队]死亡状态无法购买")
- }
- return PLUGIN_HANDLED
- }
- public YSJS(id)
- {
- set_pev(id,pev_effects,0)
- client_print(id,print_chat,"[Silent战队]隐身时间结束")
- }
- public AWP(id)
- {
- new a=10000
- new b=cs_get_user_money(id)
- new name[32]
- get_user_name(id,name,31)
- if(b>=a&&is_user_alive(id)&&cs_get_user_team(id)==CS_TEAM_T)
- {
- cs_set_user_money (id,b-a,1)
- client_print(0,print_chat,"[Silent战队]玩家%s信仰夜琴,夜琴高兴给了他一把AWP!",name)
- cs_set_weapon_ammo(give_item(id,"weapon_awp"),2)
- cs_set_user_bpammo(id,CSW_AWP,0)
- }
- else if(cs_get_user_team(id)==CS_TEAM_CT)
- {
- client_print(id,print_chat,"[Silent战队]渣渣CT想打T的小JJ?")
- }
- else if(b<a)
- {
- client_print(id,print_chat,"[Silent战队]金钱不足")
- }
- else if(!is_user_alive(id))
- {
- client_print(id,print_chat,"[Silent战队]首先你必须是活的!")
- }
- }
复制代码 |
|