Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock GetVehicleAroundCoords(Float:x, Float:y, Float:z)
- {
- new Float:vDistance = INVALID_PLAYER_ID, Float:nvDistance, vehicleid = 0;
- for(new v = 1; v < MAX_VEHICLES; v++)
- {
- if(GetVehicleModel(v) < 400) continue;
- nvDistance = GetVehicleDistanceFromPoint(v, x, y, z);
- if(vDistance == INVALID_PLAYER_ID) vDistance = nvDistance;
- if(vDistance >= nvDistance) vDistance = nvDistance, vehicleid = v;
- }
- return vehicleid;
- }
- stock GetVehicleAroundCoords(Float:x, Float:y, Float:z, Float:distance = 7.0)
- {
- new Float:vDistance = INVALID_PLAYER_ID, Float:nvDistance, vehicleid = 0;
- for(new v = 1; v < MAX_VEHICLES; v++)
- {
- if(GetVehicleModel(v) < 400) continue;
- nvDistance = GetVehicleDistanceFromPoint(v, x, y, z);
- if(nvDistance > distance) continue;
- if(vDistance == INVALID_PLAYER_ID) vDistance = nvDistance;
- if(vDistance >= nvDistance) vDistance = nvDistance, vehicleid = v;
- }
- return vehicleid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement