Skip to content

Commit 9f239bd

Browse files
committed
Tie the engine state to a variable
1 parent 9c29d20 commit 9f239bd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

amx/server/events.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,8 @@ addEventHandler('onVehicleEnter', root,
420420
end
421421

422422
if ManualVehEngineAndLights then
423-
if amx.vehicles[vehID].neverEntered ~= nil then
424-
if (getVehicleType(source) ~= "Plane" and getVehicleType(source) ~= "Helicopter") then
425-
setVehicleEngineState(source, false)
426-
end
423+
if (getVehicleType(source) ~= "Plane" and getVehicleType(source) ~= "Helicopter") then
424+
setVehicleEngineState(source, amx.vehicles[vehID].engineState)
427425
end
428426
end
429427
end

amx/server/syscalls.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function AddStaticVehicleEx(amx, model, x, y, z, angle, color1, color2, respawnD
246246
if(vehicle == false) then
247247
return false
248248
end
249-
249+
250250
if not g_PoliceVehicles[model] then
251251
if(color1 <= 0 and color1 >= 126) then color1 = math.random(1, 126) end
252252
if(color2 <= 0 and color2 >= 126) then color2 = math.random(1, 126) end
@@ -265,7 +265,7 @@ function AddStaticVehicleEx(amx, model, x, y, z, angle, color1, color2, respawnD
265265
for i=0, 4 do
266266
setVehicleLightState(vehicle, i, 0)
267267
end
268-
amx.vehicles[vehID].neverEntered = true
268+
amx.vehicles[vehID].engineState = false
269269
end
270270
end
271271
return vehID
@@ -2352,7 +2352,7 @@ function SetVehicleParamsEx(amx, vehicle, engine, lights, alarm, doors, bonnet,
23522352
local vehicleID = getElemID(vehicle)
23532353
g_Vehicles[vehicleID].alarm = alarm;
23542354
g_Vehicles[vehicleID].objective = objective;
2355-
2355+
g_Vehicles[vehicleID].engineState = engine;
23562356
return 1
23572357
end
23582358

0 commit comments

Comments
 (0)