I’m working on it, all doors opening/closing at the same time is working using /door 5
.
IMPORTANT - READ FIRST
- I’m NOT a scripter, I’m 100% sure a real one can code what I did a long way better. Until his arrive, please don’t kill me for what I did (how I did).
- There’s something I’m still working on: If you’re using a two-doors car (like the Adder) you can open all doors but you can’t close them, since after you opened them the
/door 5
command won’t do anything. I’m working on it and I hope I will fix. Meanwhile you can close them using /door 1
and /door 2
. Sorry about that.
- I translated the script in Italian and replaced the “[Vehicle]” notification text using “[EVC]”, be aware of that.
You have to make 2 edits in the client.lua file:
- Add this at line 86:
Code
elseif args[1] == "5" then -- Every door
door = nil
all = 1
- Add this at line 120:
Code
elseif door == nil and all == 1 then
if IsPedInAnyVehicle(ped, false) then
if GetVehicleDoorAngleRatio(vehLast, 0) > 0 and GetVehicleDoorAngleRatio(vehLast, 1) > 0 and GetVehicleDoorAngleRatio(vehLast, 2) > 0 and GetVehicleDoorAngleRatio(vehLast, 3) > 0 then
SetVehicleDoorShut(vehLast, 0, false)
SetVehicleDoorShut(vehLast, 1, false)
SetVehicleDoorShut(vehLast, 2, false)
SetVehicleDoorShut(vehLast, 3, false)
ShowInfo("[~y~EVC~w~] Portiere ~b~chiuse~w~.")
else
SetVehicleDoorOpen(vehLast, 0, false, false)
SetVehicleDoorOpen(vehLast, 1, false, false)
SetVehicleDoorOpen(vehLast, 2, false, false)
SetVehicleDoorOpen(vehLast, 3, false, false)
ShowInfo("[~y~EVC~w~] Portiere ~b~aperte~w~.")
end
else
if distanceToVeh < 4 then
if GetVehicleDoorAngleRatio(vehLast, 0) > 0 and GetVehicleDoorAngleRatio(vehLast, 1) > 0 and GetVehicleDoorAngleRatio(vehLast, 2) > 0 and GetVehicleDoorAngleRatio(vehLast, 3) > 0 then
SetVehicleDoorShut(vehLast, 0, false)
SetVehicleDoorShut(vehLast, 1, false)
SetVehicleDoorShut(vehLast, 2, false)
SetVehicleDoorShut(vehLast, 3, false)
ShowInfo("[~y~EVC~w~] Portiere ~b~chiuse~w~.")
else
SetVehicleDoorOpen(vehLast, 0, false, false)
SetVehicleDoorOpen(vehLast, 1, false, false)
SetVehicleDoorOpen(vehLast, 2, false, false)
SetVehicleDoorOpen(vehLast, 3, false, false)
ShowInfo("[~y~EVC~w~] Portiere ~b~aperte~w~.")
end
else
ShowInfo("[~y~EVC~w~] Troppo distante dal ~b~veicolo~w~.")
end
end
Hope it helps. Gonna edit when (IF) I’ll fix.