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

Quote:
Originally Posted by Schneider
Посмотреть сообщение
pawn Код:
new shortest=-1, Float:shortdistance=9999.9, Float:distance;
for(new x; x<6; x++)
{
    distance = GetPlayerDistanceFromPoint(playerid, GPSBANKS[x][0], GPSBANKS[x][1], GPSBANKS[x][2]);
    if(distance < shortdistance)
    {
        shortest = x;
        shortdistance = distance;
    }
}
SetPlayerCheckpoint(playerid, GPSBANKS[shortest ][0], GPSBANKS[shortest ][1], GPSBANKS[shortest ][2], 7.0);
Thanks, I've seen you helping around the forums. Keep it up!

+REP
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)