[Question] Checking Aircraft Landing Gears (PAWN.RakNet?) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question] Checking Aircraft Landing Gears (PAWN.RakNet?) (
/showthread.php?tid=654975)
[Question] Checking Aircraft Landing Gears (PAWN.RakNet?) -
Sasino97 - 10.06.2018
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.
Re: [Question] Checking Aircraft Landing Gears (PAWN.RakNet?) -
NaS - 10.06.2018
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.
Re: [Question] Checking Aircraft Landing Gears (PAWN.RakNet?) -
Sasino97 - 10.06.2018
Quote:
Originally Posted by NaS
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.