• How do I mesuare the distance between the me and another player?
    1 replies, posted
I'd like to do that I have a SWEP that should draw a specific hud no the screen if the the current player is X distant from another player and draw another hud if it's Y distant from another player. For example: [CODE] if playerDistanceFromAnother > 100 then drawHUD1(); elseif playerDistanceFromAnother < 100 then drawHUD2(); end [/CODE] So basically I'd like to know how to calculate the distance between 2 player (the current player/user and another player), could someone explain me how can I do that? I think I should draw a line between this two player and measure its size or maybe get the (x, y, z) coordinates of both player and perform a simple subtraction, but could someone explain me how I could do that?
Sorry, you need to Log In to post a reply to this thread.