chriy 发表于 2007-8-9 15:04:51

关于开局小刀插件能使用C4的问题

#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Jim"
new current_round = 0
new const weapon_banned = {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)
                        return true
      }
      return false
}


以前的帖子里说,上面的一段改成下面的代码就可以使用C4,但我改了后在1.76下测试还是不行,是不是代码有错?
register_event("CurWeapon", "hook_weapon", "b", "2!29", "2!6")
页: [1]
查看完整版本: 关于开局小刀插件能使用C4的问题