GetClosestVehicle
#3

PHP код:
native IsValidVehicle(vehicleid);
GetClosestVehicle(playeridFloat:range) {
   new 
Float:VehiclePos[4], nearestID;
   
nearestID 65535;
   for(new 
vehicleid 0vehicleid MAX_VEHICLESvehicleid++) {
      if(
IsValidVehicle(vehicleid)) {
         
GetVehiclePos(vehicleidVehiclePos[1], VehiclePos[2], VehiclePos[3]);
         if(
IsPlayerInRangeOfPoint(playeridrangeVehiclePos[1], VehiclePos[2], VehiclePos[3])) {
            
nearestID vehicleid;
            break;
         }
      }
   }
   return 
nearestID;

Reply


Messages In This Thread
GetClosestVehicle - by Jonesy96 - 14.07.2016, 15:40
Re: GetClosestVehicle - by Stinged - 14.07.2016, 16:20
Re: GetClosestVehicle - by Luicy. - 14.07.2016, 16:25
Re: GetClosestVehicle - by Jonesy96 - 14.07.2016, 16:28
Re: GetClosestVehicle - by Konstantinos - 14.07.2016, 16:30
Re: GetClosestVehicle - by Jonesy96 - 14.07.2016, 16:53

Forum Jump:


Users browsing this thread: 2 Guest(s)