Hey community.
I testing some things to learn programming plugins.
I asked myself is it possible to create or use a function to ask is a player in near of coordinate x y z or near of a player?
And is it possible to edit the world chat that you can configurate in my plugin that I only can read player A text if I am in a radius of 20m.
I think I need the function "nearofaplayer"
Solved Checking if player is near a player?
Discussion in 'Rust Development' started by iMpAviDo, Nov 3, 2015.
-
Calytic Community Admin Community Mod
Chat Channels supports local/proximity chat
http://oxidemod.org/plugins/chat-channels.1301/ -
Thank you but I want to create a own for practise, because I need this function for more features for example a player can only teleport someone if he is in a radius of 10m of playerB
Someone know the function I descripted at top? -
Calytic Community Admin Community Mod
the method you are looking for is BaseEntity.Distance
Code:if(player.Distance(otherPlayer) < 10) { // do something }
-
Ok ty.
I will try it.
How I use the targetPlayer function?
I know I am "player" and the target is ?
Need it for example for teleportation -
Calytic Community Admin Community Mod
To find a player, you can search by name, ip address, or steamid
Code:var targetPlayer = BasePlayer.Find(nameORipORsteamid);