Get detonator frequencySolved

Hi all

Can't get frequency from detonator when player uses it

 

         void OnPlayerInput(BasePlayer player, InputState input, Item item)
        {
            if (input.WasJustReleased(BUTTON.FIRE_PRIMARY))
            {
                
                 if (player == null) return;
				if (!DataBasePlayer.InfoData.ContainsKey(player.userID)) return;
                Item activeItem = new Item();
                if (item != null) activeItem = item;
                else activeItem = player.GetActiveItem();
                ulong userid = player.userID;
                var position = DataBasePlayer.InfoData[player.userID].sethome;
                if (activeItem != null && activeItem.info.shortname == "rf.detonator")
                {
                 var entity = BaseNetworkable.serverEntities.Find((uint)player.userID) as RFBroadcaster;
                
                        
                        var detonator = activeItem.GetWorldEntity() as Detonator;
                        Server.Broadcast(detonator.GetFrequency().ToString());
                        player.StartSleeping();
                        player.MovePosition(position);
            }    
    }
      }
    }

id what the var entity line is but thats not correct usage for finding baseplayer.

1jlVJ3Kafru7nmx.png Razor

id what the var entity line is but thats not correct usage for finding baseplayer.


How do I find a player with a detonator?

Merged post

I solved the problem, I did not notice that the Detonator class is inherited from HeldEntity

Nevertheless thank you :)
Locked automatically