How to check if a car is driven?
#1

Is there something like IsDriven? Or do I have to make something myself? Ty!
Reply
#2

If there is no function listed here, you will have to script your own function.

Just enumerate all players and check whether they are in the vehicle.

Код:
//This function checks whether a vehicle has a driver or not.
forward IsVehicleDriven(vehicleid);

public IsVehicleDriven(vehicleid)
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
   if(IsPlayerInVehicle(i, vehicleid) && !GetPlayerVehicleSeat(i))
   {
     return 1;
   }
  }
  return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)