1. Hi I am using the void OnEntityDeath(BaseCombatEntity vic, HitInfo hitInfo) to select a player (based on if he is killer or victim).

    I would like to use the sendthereply and send a message1 to the attacker and a message2 to the victim. I use the id of the killer and I get no error. When I try in-game I see no message showing.
    Here is the code to send the attacker (uidk is the killer id reference)

    SendTheReply(uidk, "-25 to your profile");

    And here is the SendTheReply code used in many plugins which works with BasePlayer.
    I noticed that the attacker/victim that are from OnEntityDeath, are used in a BaseCombatEntity (not in GamePlayer).

    Code:
      private void SendTheReply(object source, string msg)
      {
      if (source is BasePlayer)
      SendReply((BasePlayer)source, msg);
      else if (source is ConsoleSystem.Arg)
      SendReply((ConsoleSystem.Arg)source, msg);
      else
      Puts(msg);
      }
    So I tried to change the sendreply to
    else if (source is BaseCombatEntity)

    SendReply((BaseCombatEntity)source, msg);


    But of course I get an error.

    Can you help me get the victim/killer msg inside that OnEntityDeath void? thanks
     
  2. Code:
    BasePlayer attacker = (BasePlayer)hitInfo.Initiator;
    BasePlayer player = (BasePlayer)entity.ToPlayer();SendReply(player, "Sth");
    SendReply(attacker, "Sth");
    
    Should work.
     
  3. Thx ill try that :)
     
    Last edited by a moderator: Aug 30, 2015