18.04.2011, 13:51
The GetPlayerDistanceToPoint function should work, it is this:
pawn Код:
CMD:getdistance(playerid, params[])
{
new id, string[230];
new Float:x,Float:y,Float:z;
if(sscanf(params, "u", id)) return Msg(playerid, color, ""#red"USAGE: "#green"/getdistance <playerid>");
if(!Connect(playerid)) return Msg(playerid, color, NOT_CONNECTED);
GetPlayerPos(id, x, y, z); // This was missing
format(string,sizeof(string),""#red"Distance to "#green"%s (id: %d): "#blue"%d",GetMyName(id),id,GetPlayerDistanceToPoint(playerid,x,y,z));
Msg(playerid, color, string);
return 1;
}