SA-MP Forums Archive
GetPlayerWeaponData returns nonsense - 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: GetPlayerWeaponData returns nonsense (/showthread.php?tid=325574)



GetPlayerWeaponData returns nonsense - Thoma.s.Heck - 13.03.2012

Hi. Sometimes, during the tests of my AntiCheat script, script detect weapon cheat (adding weapons). Once per minute script checks player weapons by GetPlayerWeaponData, stores to PVars and checks cheat. I print weapon in PVar and weapon returned by GetPlayerWeaponData and in PVar is 0, but GPWData returns a weaponid. But the problem is, that I have no weapon and GPWData returns ID. It happens sometimes, I don't know why. Does anybody know why? Thanks.
--------------------
Sorry for my english.


Re: GetPlayerWeaponData returns nonsense - Rac3r - 14.03.2012

GetPlayerWeapon() used OnPlayerConnect and unspawned will 'POSSIBLY' return nonsense.
Similar to GetPlayerWeaponData(), but that also 'POSSIBLY' returns nonsense if the player is in a vehicle.

Would be nice if they worked everytime, but they don't. Just make sure player is spawned and onfoot before comparing with your PVars.


Re: GetPlayerWeaponData returns nonsense - Thoma.s.Heck - 14.03.2012

Thanks, I'll try it.