1. Code:
            private void OnExplosiveThrown(BasePlayer player, BaseEntity entity, InputState input)
            {
                if (test == true && permission.UserHasPermission(player.userID.ToString(), "test.test))
                {
                        var c4 = entity as TimedExplosive;
                        if (c4 == null) return;
                }
            }
    
    I want to use var c4 for all voids but I cant define it outside of void any idea?

    Because if plugin reload all c4 explode and damage or they stay there forever :D

    I want to kill them if plugin unload but Unload void cant find c4 because I couldnt define it where it can see.
     
    Last edited by a moderator: Jul 29, 2018
  2. Define List<BaseEntity> in your main class, so all your 'voids' can see this.
    Add each c4 entity in that list.
    When unload, do whatever you want to do with all entities in your list.
    But I don't understand why you do that and I don't think it's the best way to solve it.
     
  3. Thank you I will try. I m trying to code my first plugin. there must be better ways.