[Question] Checking Aircraft Landing Gears (PAWN.RakNet?)
#1

Hello SA-MP Community,
I am creating an aircraft instrument panel with text draws.
As far as you know, is there a way to check within the server whether the landing gear of an aircraft is open? Even using PAWN.RakNet or similar plugins.
Thank you in advance.
Reply
#2

You will need PawnRakNet as you already said.

The Landing gear is part of the car sync:

https://github.com/urShadow/Pawn.Rak...ion-structures

See PR_InCarSync.

If you don't know how to do get the actual data, you can check out the examples on the wiki which explains it for other data (the method is the same though).

As the car sync isn't actually stored but just repeatedly sent to the server, you can intercept that package, extract the gear state and store it in an Array (per-player, and only for players in airplanes). At least that's how I would do it.


Another way would be using one of the YSF Forks (iirc one of them has GetPlayerLandingGearState). But these are more vulnerable to changes in the SAMP Server than PawnRakNet so I would personally prefer the above method.
Reply
#3

Quote:
Originally Posted by NaS
View Post
You will need PawnRakNet as you already said.

The Landing gear is part of the car sync:

https://github.com/urShadow/Pawn.Rak...ion-structures

See PR_InCarSync.

If you don't know how to do get the actual data, you can check out the examples on the wiki which explains it for other data (the method is the same though).

As the car sync isn't actually stored but just repeatedly sent to the server, you can intercept that package, extract the gear state and store it in an Array (per-player, and only for players in airplanes). At least that's how I would do it.


Another way would be using one of the YSF Forks (iirc one of them has GetPlayerLandingGearState). But these are more vulnerable to changes in the SAMP Server than PawnRakNet so I would personally prefer the above method.
Thank you very much.
I had tried YSF, kurta's version, but it returned always 1 regardless of the landing gear state, so it most likely has the problem you said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)