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));
}