Help with range
#3

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Show the GetDistanceBetweenPlayers function, you could've gotten the xyz coords of the player and looped through all players to check isplayerinrangeofpoint of that one^
pawn Код:
public Float:GetDistanceBetweenPlayers(p1,p2){
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
        return -1.00;}
    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x2,y2,z2);
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));}
Reply


Messages In This Thread
Help with range - by PundacheMakalae - 29.01.2018, 17:27
Re: Help with range - by RogueDrifter - 29.01.2018, 17:36
Re: Help with range - by PundacheMakalae - 29.01.2018, 17:56
Re: Help with range - by Mugala - 29.01.2018, 19:55

Forum Jump:


Users browsing this thread: 1 Guest(s)