Hi guys, im trying to make a plugin who can destroy walls of players.
the requirement is; only the guy who placed the wall, can destroy the wall.
i tried that:
but it isnt working?Code:if (entity.userID == player.userID) { entity.KillMessage();
can you help me please?
Killing an entity?
Discussion in 'Rust Development' started by Alfred 2, Jan 25, 2018.
-
Code:
if (entity.ownerID == player.userID) { entity.KillMessage(); }
-
im totaly lost with this, how can i bind "player.eyes.HeadRay()" with "entity.ownerID == player.userID" ?
[DOUBLEPOST=1516914640][/DOUBLEPOST]i tried:
Code:[ChatCommand("r")] void cmdChatR(BasePlayer player, string command, string[] args) { if (args == null || args.Length == 0) { RaycastHit hit; var hitSomething = Physics.Raycast(player.eyes.HeadRay(), out hit, g_config.maxDist); if (!hitSomething) { SendReply(player, "Too far away"); return; } var entity = hit.GetEntity(); if (entity.ownerID == player.userID) { SendReply(player, "Das ist deins!"); } } }