open.mp forum
[Pawn] [HELP] Fully eliminating weapon when no ammo left - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] [HELP] Fully eliminating weapon when no ammo left (/showthread.php?tid=1515)



[HELP] Fully eliminating weapon when no ammo left - Smyle - 2021-01-11

Hey.



So, since a while ago i was having an issue when finishing using a weapon (when i shot the last bullet left). As we all know, when we're using GetPlayerWeaponData, old weapons with no ammo left are still returned and basically that fucks everything up if you're checking if a player already has that specific weapon by using the GetPlayerWeaponData function.



So my question is: Is there any way we can like reset or eliminate that weapon when whe shot the last bullet for the last time? As i said, the weapon vanishes, but it still shows up on GetPlayerWeaponData.



I already tried to remove it when shooting and checking if it was the last bullet using OnPlayerWeaponShot, but i had no success on it.



Please, help!? 䑃 to those who?can give me a good answer.



Thank yall.



RE: [HELP] Fully eliminating weapon when no ammo left - gzxmx94 - 2021-01-12

And why can't you keep track of the weapons the player has with GivePlayerWeapon (㩳➫姦ꦢ璡) ?


RE: [HELP] Fully eliminating weapon when no ammo left - Pinch - 2021-01-12

https://github.com/BrunoBM16/samp-packet-list/wiki/Packet-List#id_weapons_update---id-204

Use pawn raknet and IPacket 204


EDIT: Why are y'all paining yourselves, just use fixes bro
https://github.com/pawn-lang/sa-mp-fixes


RE: [HELP] Fully eliminating weapon when no ammo left - Smyle - 2021-01-14

Thank you, @Pinch.



That should work. REP as promised.