Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock GetClosestVehicle(playerid, Float: fRadius) // by RyDeR`
- {
- new
- iClosestID = INVALID_VEHICLE_ID,
- Float: fFinalDistance,
- Float: fDistance,
- Float: fX,
- Float: fY,
- Float: fZ;
- GetPlayerPos(playerid, fX, fY, fZ);
- fFinalDistance = fRadius;
- for(new i; i != MAX_VEHICLES; i++)
- {
- if((fDistance = GetVehicleDistanceFromPoint(i, fX, fY, fZ)) < fFinalDistance)
- {
- fFinalDistance = fDistance;
- iClosestID = i;
- }
- }
- return iClosestID;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement