示例#1
0
 public static void TriggerDoor(GTANetworkServer.Vehicle vehicle, int doorId)
 {
     if (vehicle.isDoorOpen(doorId))
     {
         vehicle.closeDoor(doorId);
     }
     else
     {
         vehicle.openDoor(doorId);
     }
 }
示例#2
0
        public VehicleController(Data.Vehicle vehicleData, GTANetworkServer.Vehicle vehicle)
        {
            VehicleData = vehicleData;
            Vehicle     = vehicle;
            API.setVehicleEngineStatus(vehicle, false); // Engine is always off.

            if (vehicleData.JobId == JobsIdNonDataBase.BusDriver || vehicleData.Type == 1)
            {
                API.setVehicleLocked(vehicle, false);       // Driver door is opened for Buses.
            }
            else
            {
                API.setVehicleDoorState(vehicle, 0, false); // Driver door is always closed.
                API.setVehicleLocked(vehicle, true);        // Driver door is always locked.
            }
            EntityManager.Add(this);
        }
示例#3
0
 public void spawnVehicle()
 {
     prop = API.createVehicle(hash, new Vector3(x, y, z), new Vector3(rotationX, rotationY, rotationZ), color1, color2, dimension);
     API.consoleOutput("Vehicle: " + id + " | " + name + " :spawned at pos: " + "x: " + this.x + " | y: " + this.y + " | z: " + this.z);
 }
示例#4
0
 public static VehicleController GetVehicle(GTANetworkServer.Vehicle vehicle)
 {
     return(_VehicleControllers.Find(x => x.Vehicle == vehicle));;
 }