04.09.2015, 11:58
Not tested, you may try this, it will send you a message ingame with the closest spot coordinates (there are more optimized ways to this)
Код:
GetClosestCoordinate(playerid) { new Float:dist, whichone; dist = GetPlayerDistanceFromPoint(playerid, 1929.37,-1776.23,13.546; whichone = 1; if(dist < GetPlayerDistanceFromPoint(playerid, 1833.11,-1842.56,13.578)) { dist = GetPlayerDistanceFromPoint(playerid, 1833.11,-1842.56,13.578); whichone = 2; } if(dist < GetPlayerDistanceFromPoint(playerid,1833.11,-1842.56,13.578)) { dist = GetPlayerDistanceFromPoint(playerid,1833.11,-1842.56,13.578); whichone = 3; } if(dist < GetPlayerDistanceFromPoint(playerid,1533.11,-842.56,3.578)) { dist = GetPlayerDistanceFromPoint(playerid,1533.11,-842.56,3.578); whichone = 4; } if(dist < GetPlayerDistanceFromPoint(playerid,-53.11,-12.56,6.578)) whichone = 5; switch(whichone) { case 1: return SendClientMessage(playerid, -1, "Closest coords are : 1929.37,-1776.23,13.546; case 2: return SendClientMessage(playerid, -1, "Closest coords are : 1833.11,-1842.56,13.578; case 3: return SendClientMessage(playerid, -1, "Closest coords are : 1833.11,-1842.56,13.578; case 4: return SendClientMessage(playerid, -1, "Closest coords are : 1533.11,-842.56,3.578; case 5: return SendClientMessage(playerid, -1, "Closest coords are : -53.11,-12.56,6.578; } }