
   /* AMX fakedeath.
   *
   * (c) Copyright 2002-2003, AssKicR
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <amxmisc>
   /*
   * Usage: amx_fakedeath <nick> <nick> <weapon> <hs>
   * Examples:
   *  amx_fakedeath AssKicR Lamer m4a1       - makes fakemessage: AssKicR
   killed Lamer With M4A1
   *  amx_fakedeath AssKicR haXXor m4a1 HS   - makes fakemessage: AssKicR
   killed haXXor with headshot from M4A1
   *  amx_fakedeath AssKicR l33t flashbang   - makes fakemessage: AssKicR
   killed l33t With flashbang
   *  amx_fakedeath AssKicR AssKicR grenade  - makes fakemessage: AssKicR
   killed self with grenade
   *
   * Changelog
   * Fixed Bug about showing as dead when fakekilled
   *
   */
   new gmsgScoreAttrib
   public admin_fd(id,level,cid) {
       if (!cmd_access(id,level,cid,3))
           return PLUGIN_HANDLED
               new arg[32], arg2[32], arg3[32], arg4[8]
               read_argv(1,arg,31)
               read_argv(2,arg2,31)
               read_argv(3,arg3,31)
               read_argv(4,arg4,7)
               new player = cmd_target(id,arg,7)
               new player2 = cmd_target(id,arg2,7)
       //        new weapon = read_argv(3,arg3,7)
               if (!player) return PLUGIN_HANDLED
               if (!player2) return PLUGIN_HANDLED
               new name[32]
               new name2[32]

               get_user_name(player,name,31)
               get_user_name(player2,name2,31)
               if ( (arg4[0]=='h') && (arg4[1]=='s') ) {
                   message_begin( MSG_ALL,
   get_user_msgid("DeathMsg"),{0,0,0},0)
                   write_byte(player)
                   write_byte(player2)
                   write_string(arg3)
                   message_end()
                   scoreboard(player2,0)
               }else{
                   message_begin( MSG_ALL,
   get_user_msgid("DeathMsg"),{0,0,0},0)
                   write_byte(player)
                   write_byte(player2)
                   write_byte(0)
                   write_string(arg3)
                   message_end()
                   scoreboard(player2,0)
               }
   //        console_print(id,"Client   ^"%s^"  has  killed  ^"%s^"  with
   ^"%s^"",player,player2,weapon)
               return PLUGIN_CONTINUE
   }
   public scoreboard(id,state){   // 0 - nothing, 1 - dead, 2 - bomb
      message_begin( MSG_ALL, gmsgScoreAttrib,{0,0,0},0)
      write_byte(id)
      write_byte(state)
      message_end()
      return PLUGIN_HANDLED
   }
   public plugin_init() {
       register_plugin("Fake DeathMsg","1.0.1","AssKicR")
       gmsgScoreAttrib = get_user_msgid("ScoreAttrib")
       register_concmd("amx_fakedeath","admin_fd",ADMIN_KICK,"<nick>,
   <nick>, <weapon>, <hs?>")
       return PLUGIN_CONTINUE
   }
