I've found the native TASK_OPEN_VEHICLE_DOOR, however I can't seem to make it open the trunk of any vehicle.
My current code looks like this:
int doorTrunkIndex = Function.Call<int>(Hash.GET_ENTITY_BONE_INDEX_BY_NAME, vehicle, "boot"); Function.Call(Hash.TASK_OPEN_VEHICLE_DOOR, playerPed, vehicle, 1.0f, doorTrunkIndex, 1.0f);
I also tried supplying the doorIndex manually by entering some values:
- 0 seems to be the front doors, the ped seems to open on the side which he is closest too. So standing right of the vehicle will open right front door, and left will open left.
- 1 is the back doors, the ped also opens the one closest to him here.
- 2 seems to have the exact same result as 1.
- 3 does nothing.
- 4 does nothing.
- 5 does nothing.
- 6 does nothing.
- 7, 8, 9 and 10 also does nothing.
I also tried using the native called SET_VEHICLE_DOOR_OPEN, which could open the trunk when the doorIndex 5 was used, however it doesn't make the player walk up to the trunk and actually open it. (It did open, but the player didn't physically walk over to the trunk and open it, it just opened magically)