[Request] Is player in range

Results 1 to 2 of 2
  1. #1
    Enthusiast 444k is offline
    MemberRank
    Feb 2008 Join Date
    SeattleLocation
    26Posts

    [Request] Is player in range

    I'm trying to figure out a way to detect coordinates.

    Pretty much something that checks to see if a player is in a distance of xyz.

    Could someone lend me a hand? Thanks in advance.
    Last edited by GigaToni; 09-09-14 at 12:30 PM.


  2. #2
    Custom Title Enabled GigaToni is offline
    MemberRank
    Aug 2009 Join Date
    GER / FRLocation
    2,329Posts

    Re: [Help] Coding Question

    Look in the server at ZombieSpawn it detects if the is in range


    EDIT:
    Here it is:


    ServerGameLogic.cpp Line ~1191:
    if((plr->GetPosition() - pos).LengthSq() < distSq)
    pos is your position
    plr->GetPosition() is obviously the player pos
    and distSq is the max distance squared (x²)
    Last edited by GigaToni; 09-09-14 at 12:19 PM.



Advertisement