Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting the trunk VehicleDoor

Featured Replies

I've been using the following to get the trunk door:

VehicleDoor[] doors = BombCar.GetDoors();
int door = doors.Length - 1;

This works fine if it's a 4 door car (sedan), but every other type of car returns an invalid door, is there another way to get this?

The doors don't incrementally count on a per car basis in the way you would expect. Try this, taken from one of the various natives:

doorIndex:
0 = Front Left Door
1 = Front Right Door
2 = Back Left Door
3 = Back Right Door
4 = Hood
5 = Trunk
6 = Back
7 = Back2

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

1 hour ago, LukeD said:

Yes, in the same way a 2 seater car wont have door indexes 2 and 3. They'll be invalid.

Is the array always going to have 8 items in it, though?

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

1 minute ago, Stealth22 said:

Is the array always going to have 8 items in it, though?

I'm not 100% certain to tell you the truth. Like I said the doors system seems to be the opposite of what you would expect.

I think that is the case if I remember correctly, but it's been a while.

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

  • Author

It looks like it does, I just added a bool that's  true if vehicle.doors[5] != null, then open 5 and 6, seems to work until now

So, the array does always have 8 items in it; and if the vehicle does not have a specific door it is not null...

Array doesn't always have all doors, but something is very strange:

This is from a normal sedan:

[11/06/2016 00:28:27.958] LSPD First Response: Door 0: Rage.VehicleDoor
[11/06/2016 00:28:27.958] LSPD First Response: Door 1: Rage.VehicleDoor
[11/06/2016 00:28:27.958] LSPD First Response: Door 2: Rage.VehicleDoor
[11/06/2016 00:28:27.959] LSPD First Response: Door 3: Rage.VehicleDoor
[11/06/2016 00:28:27.959] LSPD First Response: Door 4: Rage.VehicleDoor
[11/06/2016 00:28:27.959] LSPD First Response: Door 5: Rage.VehicleDoor

this is from a cabrio (2seater)

[11/06/2016 00:29:32.825] LSPD First Response: Door 0: Rage.VehicleDoor
[11/06/2016 00:29:32.825] LSPD First Response: Door 1: Rage.VehicleDoor
[11/06/2016 00:29:32.825] LSPD First Response: Door 2: Rage.VehicleDoor
[11/06/2016 00:29:32.825] LSPD First Response: Door 3: Rage.VehicleDoor

but on the last one vehicle.Doors[5].Open works for some reason...Even if the array only has 0-3, [5] is never null

 

Edit: Fixed it for now by switching on VehicleClass to get which doors to open...ofcourse the second car that spawned was a space docker...ugh

Also, for some reason the backdoors on Vans are Vehicle.Doors[2] & 3. not as the natives reference states

Edited by khorio

^ And this is why SearchWarrant just opens all the bloody doors at once lol. Clearly whoever had the task of writing the door logic for GTA was on some interesting substances

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.