[Release] External Vehicle Commands - /trunk, /hood from outside your vehicle [1.3]

Hey @FAXES , nice script!

Anyway, seems like the notifications about doors closed/open are not working. In your code you used “TriggerEvent” instead of “ShowInfo”. You should fix the last block in this way:

Code
    if door ~= nil then
        if IsPedInAnyVehicle(ped, false) then
            if GetVehicleDoorAngleRatio(veh, door) > 0 then
                SetVehicleDoorShut(veh, door, false)
                ShowInfo("^*[Veicolo] ~g~Portiera chiusa.")
            else	
                SetVehicleDoorOpen(veh, door, false, false)
                ShowInfo("^*[Veicolo] ~g~Portiera aperta.")
            end
        else
            if distanceToVeh < 4 then
                if GetVehicleDoorAngleRatio(vehLast, door) > 0 then
                    SetVehicleDoorShut(vehLast, door, false)
                    ShowInfo("[Veicolo] ~g~Portiera chiusa.")
                else	
                    SetVehicleDoorOpen(vehLast, door, false, false)
                    ShowInfo("[Veicolo] ~g~Portiera aperta.")
                end
            else
                ShowInfo("[Veicolo] ~y~Troppo distante dal veicolo.")
            end
        end
    end

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:

  1. Add this at line 86:
Code
    elseif args[1] == "5" then -- Every door
		door = nil
        all = 1
  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.

2 Likes

Release 1.2

  • Added a keybinding to open the trunk. Default Ctrl + E

See OP for downloads

@FAXES is there anyway you can make this into a menu?

@FAXES can you please make the script more advance by adding inventoryhud when we write /trunk?? It will make the trunk more useful.

You can edit it. It’s a standalone resource…

@FAXES i am not a developer and dont know anything about code… thats why i was asking your help to add an inventory in that

I know might be a weird question, did you just edit the Code of the Chatresource css file or is it a custom one ?

No? There’s no edits in it :stuck_out_tongue:

i ment in your video :smiley: not talking about your release here haha

Release - 1.3


  • Updated resource manifest.

Nice work! Is it ok if I make a few changes to the text popups and maybe add a few commands?

It doesn’t work, I tried doing /trunk and /hood out side the car and it doesn’t work

Hello I keep getting a error, Couldn’t find resource ExternalVehicleCommands. Is there a resource lua that should go with it?

thanks! nice script :slight_smile:

One comes with it, did you install it correctly?

1 Like

Yes it is installed just like the rest I have in.

It works great, but it does not allow to to use these commands on any vehicle, just the one you were previously inside. Is there a fix so you can do this on anyones vehicle?

More practical when LEO are trying to search a vehicle, etc.

Nice Script

1 Like