From a6e9f4377163a8691f4448297d3b8560d1383cd5 Mon Sep 17 00:00:00 2001 From: second_coming Date: Mon, 11 Apr 2016 16:39:00 +0100 Subject: [PATCH] various fixes --- scripts/occupationPublicBus.sqf | 10 ++++++++-- scripts/occupationVehicle.sqf | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 71069e9..1f32ec8 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -30,6 +30,9 @@ busDriver setCaptive true; _publicBus = createVehicle ["Exile_Car_Ikarus_Party", _spawnLocation, [], 0, "CAN_COLLIDE"]; SC_publicBusArray = SC_publicBusArray + [_publicBus]; _publicBus setVariable ["SC_assignedDriver", busDriver,true]; +_publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; +_publicBus addEventHandler ["getin", "_this call SC_fnc_getInBus;"]; + _group addVehicle _publicBus; clearBackpackCargoGlobal _publicBus; clearItemCargoGlobal _publicBus; @@ -93,17 +96,20 @@ while {true} do else { _currentDriver = driver _publicBus; - if(isPlayer _currentDriver) then + if(_currentDriver != busDriver) then { + _publicBus setFuel 0; [_currentDriver] orderGetin false; + _currentDriver action ["eject", _publicBus]; }; if(isnull _currentDriver) then { sleep 0.1; busDriver assignAsDriver _publicBus; - busDriver moveInDriver _publicBus; + busDriver moveInDriver _publicBus; [busDriver] orderGetin true; + _publicBus lockDriver true; }; _publicBus setFuel 1; uiSleep 3; diff --git a/scripts/occupationVehicle.sqf b/scripts/occupationVehicle.sqf index 89a3688..0d3f016 100644 --- a/scripts/occupationVehicle.sqf +++ b/scripts/occupationVehicle.sqf @@ -105,9 +105,9 @@ if(_vehiclesToSpawn >= 1) then _vehicle setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true]; _vehicle setFuel 1; _vehicle engineOn true; - _vehicle lock 0; - _vehicle setVehicleLock "UNLOCKED"; - _vehicle setVariable ["ExileIsLocked", 0, true]; + _vehicle lock true; + _vehicle setVehicleLock "LOCKED"; + _vehicle setVariable ["ExileIsLocked", 1, true]; _vehicle setSpeedMode "LIMITED"; _vehicle limitSpeed 60; _vehicle action ["LightOn", _vehicle];