Skip to content

Flamethrower ammo multiplied by ten #481

@ArranTuna

Description

@ArranTuna

Describe the bug
Give yourself 100 flamethrower
Use getPedTotalAmmo on slot 7

Returns 1000.

Caused false positive in my ammo cheat detection script and also if a server saves peoples ammo on quit they can keep quitting and their flame-thrower ammo multiples by ten.

To Reproduce

  • srun giveWeapon(getRandomPlayer(), 37, 100)
  • srun getPedTotalAmmo(getRandomPlayer(), 7)

Expected behavior
Not to be multiplied by 10.

Additional context
MTA10\mods\shared_logic\CClientPed.cpp line 1902 (GiveWeapon):

// Multiply ammo with 10 if flamethrower to get the numbers correct.
if ( weaponType == WEAPONTYPE_FLAMETHROWER ) uiAmmo *= 10;

Maybe just add the same kind of check in getPedTotalAmmo but divide by 10?

From https://bugs.mtasa.com/view.php?id=6639

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions