|
发表于 2006-12-6 00:17:16
|
显示全部楼层
来自 中国–北京–北京–海淀区
回复: 谁有前面三局刀战的源码?
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN "RoundWeaponRestriction"
- #define VERSION "1.0"
- #define AUTHOR "Jim"
- new current_round = 0
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_logevent("round_start", 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_start() {
- current_round++
- }
- public round_restart() {
- current_round = 0
- }
- public hook_weapon(id) {
- if(current_round > 3)
- return
- new wpid = read_data(2)
- switch(current_round) {
- case 1: if(wpid!=6) engclient_cmd(id,"weapon_knife")
- case 2:{
- switch(wpid){
- case 4,6,9,25: return
- default:{
- client_print(id,print_center,"You can't use this weapon at this round.")
- engclient_cmd(id,"weapon_knife")
- }
- }
- }
- case 3:{
- switch(wpid){
- case 2,4,6,9,10,11,16,17,25,26: return
- default:{
- client_print(id,print_center,"You can't use this weapon at this round.")
- engclient_cmd(id,"weapon_knife")
- }
- }
- }
- }
- }
复制代码 本人的另一个垃圾版本。请笑纳。
第一局:knife,bomb
第二局:knife,bomb,flashbang,hegrenade,smokegrenade
第三局:第二局+手枪
第四局以后正常。 |
|