View Issue Details

IDProjectCategoryView StatusLast Update
0000854GT-MP ServerAPIpublic2018-01-23 20:47
ReporterlegendAssigned To 
Status newResolutionopen 
Product Version0.1.6 
Target VersionFixed in Version 
Summary0000854: Wrong return values of API.GetPlayerWeaponAmmo
DescriptionAPI.GetPlayerWeaponAmmo returns sometimes completely wrong values.
Unfortunately I could not catch in which cases or for which weapons.

DarkIrata has the same problem.
TagsNo tags attached.



2018-01-06 18:43

reporter   ~0001267

In gta the non equipped ammo is the same for each weapon at the same slot.


2018-01-16 21:30

developer   ~0001311

I think I can reproduce it.


Server side:
public void Test1(Client player)
    API.givePlayerWeapon(player, WeaponHash.CombatPDW, 100, false, false);
    API.sendChatMessageToPlayer(player, "CombatPDW with 100 ammo");

public void Test2(Client player)
    API.givePlayerWeapon(player, WeaponHash.SMG, 200, false, false);
    API.sendChatMessageToPlayer(player, "SMG with 200 ammo");

public void GetAmmo(Client player)
    API.sendChatMessageToPlayer(player, $"Weapon {player.currentWeapon.ToString()}: {API.getPlayerWeaponAmmo(player, player.currentWeapon)}");
    API.triggerClientEvent(player, "PrintCurrentAmmo");

API.onServerEventTrigger.connect((eventName) =>
    if (eventName !== "PrintCurrentAmmo")

    const localPlayer = API.getLocalPlayer();
    const currentWeapon = API.getPlayerCurrentWeapon();
    const lastWeaponAmmo = API.returnNative("GET_AMMO_IN_PED_WEAPON", 0, localPlayer, currentWeapon);
    API.sendChatMessage(`Client: Weapon ${currentWeapon} with ${lastWeaponAmmo} ammo`);

Issue History

Date Modified Username Field Change
2018-01-06 14:27 legend New Issue
2018-01-06 18:43 Fabian Note Added: 0001267
2018-01-16 21:30 Silverdark Note Added: 0001311