|
发表于 2006-11-16 12:09:17
|
显示全部楼层
来自 中国–北京–北京–海淀区
回复: 【求助】求第一局用刀,第二局只使用手枪和o3o4的插件
Post by wwww23
怎么样才能第三局用枪第四局平常呢,你这个源码已经有了,希望出个一局用刀,二局用刀和雷,三局用手枪,以后平常的,谢谢。 - #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN "Test"
- #define VERSION "1.0"
- #define AUTHOR "Jim"
- new current_round = 0
- new const weapon_banned[7] = {CSW_USP, CSW_GLOCK18, CSW_DEAGLE, CSW_ELITE, CSW_FIVESEVEN, CSW_P228, CSW_HEGRENADE}
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_logevent("round_count", 2, "1=Round_Start")
- register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
- register_event("CurWeapon", "hook_weapon", "b", "2!29")
- }
- public round_count()
- {
- current_round ++
- }
- public round_restart()
- {
- current_round = 0
- }
- public hook_weapon(id)
- {
- if(current_round >3)
- return PLUGIN_CONTINUE
- new wpid = read_data(2)
- if(current_round == 1)
- engclient_cmd(id, "weapon_knife")
- else if(current_round == 2 && wpid != CSW_HEGRENADE)
- engclient_cmd(id, "weapon_knife")
- else if(current_round == 3 && !IsValidWeapon(wpid))
- engclient_cmd(id, "weapon_knife")
- return PLUGIN_CONTINUE
- }
- bool:IsValidWeapon(wpid)
- {
- for(new i=0; i<7; i++)
- {
- if(wpid == weapon_banned[i])
- return true
- }
- return false
- }
复制代码 第一句刀,第二局刀和雷,第三局刀、手枪和雷,以后正常。(未测试,抱歉!)
注意以上两个源码中 C4也没法使用,如果要用c4的话在开始改为
register_event("CurWeapon", "hook_weapon", "b", "2!29", "2!6") |
|