View Issue Details

IDProjectCategoryView StatusLast Update
0006253Multi Theft Auto : San AndreasServerpublic2013-03-06 10:51
ReporterMaddDogg14Assigned ToJusonex 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSWindows 7OS VersionWindows NT. 6.1
Product Version 
Target Version1.3.2Fixed in Version1.3.2 
Summary0006253: Projectile weapon ammo (slot 8) is not synchronized correctly
Description

I noticed that the server side versions of the functions getPedAmmoInClip() and getPedTotalAmmo() return value 1 for slot 8 (projectile weapons), if there is actually no (0) ammo.
If there is at least 1 ammo in that slot, it returns the correct amount of ammo, so if you carry 12 molotoves, it also returns 12 as total ammo. But if you carry none (0), it returns 1.
The client side versions on the other hand work fine! So it seems to me that the problem lies in the synchronization.

The whole thing can be extremely annoying, since I just cannot reliably check, how much ammo the player still has in that slot, when working server side.
I utilize the above functions in an inventory system, which needs to know the total ammo to synchronize the inventory values with it, so I currently have a big problem with the bug, because I would need to build a workaround and add many lines to my inventory system in order to get a correct value.

I would very much appreciate seeing this getting fixed very soon (with 1.1?), thank you. :)

Steps To Reproduce
  1. Write a short script, which prints you the result of getPedAmmoInClip() and getPedTotalAmmo() for slot 8 (projectile weapon slot).
  2. Now in game make sure you don't carry any molotoves, grenades, or similar (slot 8).
  3. Have a look at how much ammo is carried in that slot.
  4. You will see that, even you carry nothing in that slot, it shows you the value 1 instead of 0.
Additional Information

Look at the screenshot to see the difference between the server- and client-side print outs.

TagsNo tags attached.

Relationships

has duplicate 0006668 closed Multi Theft Auto : San Andreas After you throwed your last grenade the system still says you have 1 left. 
has duplicate 0006736 closed New issues getPedTotalAmmo 8th slot always returns 1 

Activities

arranTuna

2011-07-15 17:36

manager   ~~0013981

Had exact same problem with my weapon saving had to write a hack to ignore grenades/molotovs/satchels/teargas with 1 ammo else players would always spawn with 1 ammo when leaving with 0.

Jusonex

2013-03-03 19:26

administrator   ~~0018219

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=5141

Issue History

Date Modified Username Field Change