To be able to operate an aircraft in the left seat (pilot seat) and the right seat (co pilot seat)

Is there a mod that allows you to control and fly the aircraft in both left and right seat (pilot and co pilot seat) of an aircraft? Or a mod that lets you transfer controls to the co pilot side using maybe a /transfercontrol? If there is none, then it would be a good addition if someone could make one. It would be very useful for Flight School Roleplay.

Technically, a aircraft in gta:v is a vehicle type, and its owner/controller is the driver, Because of this limitation the person in the co-pilot seat cannot make any driving changes to the aircraft directly, all the controls and movements have to go through the driver himself.
You can communicate between the driver client and the copilot client but its not gonna be a direct communication.
Another way is communicating between the copilot and the server and make changes with server functions, but the server functions are very limited specially in case of aircraft natives.
So even if someone wanted to do something like this, first they would have to overcome these challenges. Which are not easy to say the least.
Would love to see someone spending time and researching on this and trying to solve this.

Heres a start, driving cars, but plane testing I never sorted actually turning the plane, the tasks ids that indicate they should turn sharp left/right only made the plane fly straight but I may have called the task incorrectly.

This is a very interesting way to approach this, However what if instead of Using tasks we simulate the actual buttons! WASD! , if the button was pressed for the passenger seat, we relay that button press onto the driver ( aka owner of the vehicle ) and simulate the button for the driver client!
i have not tested this theory yet. But i think this should be possible by using SetControlNormal.
We disable the Player input by DisableControl then use the SetControlNormal as long as the Passenger seat is doing it aswell.
This should make the movements more smooth ( not relying on the Tasks ) and also work for all type of movements for all vehicle types, for example nose diving with a plane!

This could work - The only downside I can see to this is that you’re limited by script performance and the latency of the copilot. So hopefully it’s optimized to hell! LOL

P.S. I was looking for this very thing:

Beside the latency and the script performance, the constant communication between co-pilot → server → driver is very demanding, scaling this to a server with 100-200 players. This can get very spam-like fast.
However with all these obstacles , right now using a simulated keyboard input or TaskVehicleTempAction can eventually lead to the desired outcomes we are searching for.

1 Like

Totally! I think your idea using SetControlNormal will be best. Also, not sure if possible, but you may get away with cutting out the server for performance reasons…

Lastly, I think the cherry on top would be killing the player ā€œsteeringā€ animation in the pilot seat and seeing if you can replicate that on the copilots seat…MAYBE EVEN the stick movement, but that may reuqire modifying the model itself…

Sounds like a great idea! Keep up the good work! <3

1 Like

Its funny cause I was desperately just going to swap the player between the pilot and copilot seat as a cheap parlor trick, but this could work…

There is a feature on some FiveM Roleplay server to swap seats, but in the case that the aircraft is full, theres no seat to swap in. And if in the case that the aircraft is not full, yes they can swap seat but there is this delay for a few second and that will make the aircraft pitch down erratically for a few seconds, detecting there is no driver. After the switch happen is the only time you can correct for the erratic pitch down attitude of the aircraft. Have tried it once

1 Like

Im glad Wetter42is here. Hey I love your work, with the aircraft handlings

1 Like

Good to be here bud! Handlings are just the beginnings. Keep an eye out, and I’ll help here where I can! <3

Also, wow, I didn’t know that…but it makes sense…when a Pilot is shot out of the pilot seat, it starts a ā€œCrash task.ā€

I think there’s a way to disable it…

Yep! Check this out:

Citizen.InvokeNative(0xD0AE4404447BE60A, vehiclename, true) --SET_DISABLE_AUTOMATIC_CRASH_TASK

This would have to be called on EVERY spawned vehicle though and would be a bit of a pain…or at least every plane the player is found in…

Also, this is only necessary if you wanna take the ā€˜swap’ route…which eeeh…I’d save for a last ditch effort to be honest! LOL

Works but wow is it a headache with different controls for vehicle types.

Performance wasn’t terrible from what I recall testing, latency is a slight issue as any communication between clients requires some network call. Working with events has appeared to function fine between just two clients, but given that statebags are uhhhm ā€œpresyncedā€ without having to handle events it would probably be really good to statebag the vehicle and just check the current state. Any synced statebags still have to be registered on the server at some point as far as I’m aware though so the resource would still require a server file.

1 Like