Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] [HELP] Fully eliminating weapon when no ammo left

 
  • 0 Vote(s) - 0 Average
Pawn [HELP] Fully eliminating weapon when no ammo left
Smyle
Offline

Burgershot Member
Posts: 7
Threads: 3
Joined: Jan 2021
Reputation: 0
Location: Brazil
#1
2021-01-11, 08:54 PM
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!  +REP to those who can give me a good answer.

Thank yall.
gzxmx94
Offline

Burgershot Member
Posts: 21
Threads: 2
Joined: Apr 2019
Reputation: 1
#2
2021-01-12, 12:21 PM (This post was last modified: 2021-01-12, 12:22 PM by gzxmx94.)
And why can't you keep track of the weapons the player has with GivePlayerWeapon (+OnPlayerWeaponShot) ?
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#3
2021-01-12, 02:59 PM (This post was last modified: 2021-01-12, 03:11 PM by Pinch.)
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
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
Smyle
Offline

Burgershot Member
Posts: 7
Threads: 3
Joined: Jan 2021
Reputation: 0
Location: Brazil
#4
2021-01-14, 01:35 PM
Thank you, @Pinch.

That should work. REP+ as promised.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode