19.02.2013, 13:04
pawn Код:
forward GetDistanceBetweenPlayers(p1, p2);
public GetDistanceBetweenPlayers(p1, p2)
{
new Float:x2,Float:y2,Float:z2; new Float:x1,Float:y1,Float:z1;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return GetPlayerDistanceFromPoint(p1, x2, y2, z2);
}
The best way to debug is to use a make do command like /showdistance to verify if the function works.