What function would i use.
#10

Maybe this?

pawn Код:
forward Float:GetDistanceBetweenPlayers(playerid,targetplayerid);

public Float:GetDistanceBetweenPlayers(playerid,targetplayerid)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!IsPlayerConnected(playerid) || !IsPlayerConnected(targetplayerid)) {
        return -1.00;
    }
    GetPlayerPos(playerid,x1,y1,z1);
    GetPlayerPos(targetplayerid,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
What function would i use. - by Haydz - 20.12.2010, 00:28
Re: What function would i use. - by blackwave - 20.12.2010, 00:30
Re: What function would i use. - by Haydz - 20.12.2010, 00:32
Re: What function would i use. - by Lorenc_ - 20.12.2010, 00:37
Re: What function would i use. - by Calgon - 20.12.2010, 04:37
Re: What function would i use. - by Scenario - 20.12.2010, 05:24
Re: What function would i use. - by Sledge - 20.12.2010, 07:15
Re: What function would i use. - by CrucixTM - 20.12.2010, 07:41
Re: What function would i use. - by Lorenc_ - 20.12.2010, 08:10
Re: What function would i use. - by Nibblet - 20.12.2010, 08:51

Forum Jump:


Users browsing this thread: 2 Guest(s)