1. 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"
     
  2. Calytic

    Calytic Community Admin Community Mod

  3. 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?
     
  4. Calytic

    Calytic Community Admin Community Mod

    the method you are looking for is BaseEntity.Distance

    Code:
    if(player.Distance(otherPlayer) < 10) {
         // do something
    }
     
  5. 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
     
  6. Calytic

    Calytic Community Admin Community Mod

    To find a player, you can search by name, ip address, or steamid

    Code:
    var targetPlayer = BasePlayer.Find(nameORipORsteamid);