distance
#12

thanks for the code, but i got these errors:

warning 208: function with tag result used before definition, forcing reparse (line: 20456)
warning 208: function with tag result used before definition, forcing reparse (line: 20475)
error 017: undefined symbol "FLOAT_NAN" (line: 20459)
warning 213: tag mismatch (line: 20459)

my code:

pawn Код:
new Float:Distance;
        Distance = GetDistanceBetweenPlayers(killerid,playerid);
        format(string,sizeof(string),"Distance: %.2f",Distance);

pawn Код:
stock Float:GetDistanceBetweenPlayers(p1, p2) // line 20456
{
    if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
        return FLOAT_NAN; // line 20459

    new
        Float:x1,
        Float:y1,
        Float:z1,
        Float:x2,
        Float:y2,
        Float:z2;

    GetPlayerPos(p1,x1,y1,z1);
    GetPlayerPos(p2,x2,y2,z2);

    return GetDistanceBetweenPoints(x1, y1, z1, x2, y2, z2);
}

stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2) //line 20475
{
    x1 -= x2;
    y1 -= y2;
    z1 -= z2;
    return floatsqroot((x1 * x1) + (y1 * y1) + (z1 * z1));
}
Reply


Messages In This Thread
distance - by Headshot1108 - 13.08.2011, 19:09
Re: distance - by Riddick94 - 13.08.2011, 19:17
Re: distance - by Headshot1108 - 13.08.2011, 19:25
Re: distance - by Headshot1108 - 13.08.2011, 19:38
Re: distance - by [MG]Dimi - 13.08.2011, 19:52
Re: distance - by Headshot1108 - 13.08.2011, 19:58
Re: distance - by [MG]Dimi - 13.08.2011, 20:00
Re: distance - by Headshot1108 - 13.08.2011, 20:02
Re: distance - by Vince - 13.08.2011, 20:06
Re: distance - by Headshot1108 - 13.08.2011, 20:06
Re: distance - by [MG]Dimi - 13.08.2011, 20:09
Re: distance - by Headshot1108 - 13.08.2011, 20:37
Re: distance - by Vince - 13.08.2011, 20:55
Re: distance - by Headshot1108 - 13.08.2011, 21:21

Forum Jump:


Users browsing this thread: 3 Guest(s)