SA-MP Forums Archive
GetPlayerWeapon as a passenger - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: GetPlayerWeapon as a passenger (/showthread.php?tid=566717)



GetPlayerWeapon as a passenger - Albon - 07.03.2015

According to wiki prior to version 0.3z RC1 this bug was still in place but it's still a bug in the new version and I can't seem to work around with it and apply it in my anti cheat.


Re: GetPlayerWeapon as a passenger - Abagail - 07.03.2015

It doesn't say RC1. It says R1-2. This is obviously a client and not a server version. Although, I doubt the validity of such information try using the R1-2 client.

UPDATE: Apparently MP2 updated the wiki page with that new info-bit however I do not recall anything being changed. What is the function reporting, -1?


Re: GetPlayerWeapon as a passenger - Albon - 07.03.2015

Nope it's returning the weapon ID which the player entered with to the vehicle, so if I switch to another weapon inside the vehicle the function will not return the current weapon ID.


Re: GetPlayerWeapon as a passenger - Abagail - 07.03.2015

That's what it's supposed to be I believe. I never saw anything suggesting that the client suddenly sent such sync information as a passenger.

FYI: The reason this occurs is because weapon data isn't being sent to the server while players are in a vehicle. It's supposed to be this way - there is no real way to detect the weaponID of a player whilst in a vehicle. However you can use SetPlayerArmedWeapon to prevent them from using any weapons inside a vehicle.


Re: GetPlayerWeapon as a passenger - RoboN1X - 08.03.2015

I can confirm this happened again,

@Abagail, it was a server update and it was announced.
Quote:
Originally Posted by Kalcor
View Post
This update is for SA-MP server owners only

- The player's current weapon ID was not correctly reported to pawn scripts when they were passengering in a vehicle.
It's not just passenger but also driver the last time i tested with 0.3z R4.


Re: GetPlayerWeapon as a passenger - Abagail - 08.03.2015

Yes however I believe that it means when the vehicle is first entered. With that logic, it won't detect if weapons are changed / removed with SetPlayerArmedWeapon.


Re: GetPlayerWeapon as a passenger - Crayder - 09.03.2015

Unless however we hooked SetPlayerArmedWeapon and GetPlayerWeapon to return the weapon that was set it would be fixed. This would be a great addition to the fixes include.


Respuesta: Re: GetPlayerWeapon as a passenger - Malganys - 09.03.2015

Quote:
Originally Posted by Crayder
View Post
Unless however we hooked SetPlayerArmedWeapon and GetPlayerWeapon to return the weapon that was set it would be fixed. This would be a great addition to the fixes include.
But if exists code that fix it in SA-MP source, no need to add it to fixes include, need to be looked by Kalcor or spookie.