Checking What Co-ords are Closest to a Player.
#7

Код:
new shortest = -1, Float:shortdistance= 100.0, Float:distance;

for(new x; x != sizeof GPSBANKS; x++)
{
	if((distance = GetPlayerDistanceFromPoint(playerid, GPSBANKS[x][0], GPSBANKS[x][1], GPSBANKS[x][2])) < shortdistance) //line 28785
	{
		shortest = x;
		shortdistance = distance;
	}
	if(shortest != -1) SetPlayerCheckpoint(playerid, GPSBANKS[shortest][0], GPSBANKS[shortest][1], GPSBANKS[shortest][2], 7.0);
}
Should work, figure it out on your own next time, not only "give code".
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)