This function was added in SA-MP 0.3c R3 and will not work in earlier versions!
Calculate the distance between a player and a map coordinate.
|playerid||The ID of the player to calculate the distance from.|
|Float:X||The X map coordinate.|
|Float:Y||The Y map coordinate.|
|Float:Z||The Z map coordinate.|
The distance between the player and the point as a float.
/* when the player types '/vend' into the chat box, they'll see this.*/
public OnPlayerCommandText(playerid, cmdtext)
if (strcmp(cmdtext, "/vend", true) == 0)
Float: fDistance = GetPlayerDistanceFromPoint(playerid, 237.9, 115.6, 1010.2),
format(szMessage, sizeof(szMessage), "You're %0.2f meters away from the vending machine.", fDistance);
SendClientMessage(playerid, 0xA9C4E4FF, szMessage);