Quote:
Originally Posted by raghava
Below code is working for clips & secondary ammo (like grenades, rocket & grenades laucher).
On screen Mags are displaying (as 5 Mags) but when reloaded, its showing as 0 Mags or 5 Mags but no ammo clips to shoot.
Whats the wrong with the code
Code:
new activeweapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
SetEntProp(weapon, Prop_Send, "m_iClip1", 30); ///--> Ammo working
new m_iPrimaryAmmoType = GetEntProp(activeweapon, Prop_Send, "m_iPrimaryAmmoType");
SetEntProp(client, Prop_Send, "m_iAmmo", 5, _, m_iPrimaryAmmoType); // Mags only displaying but not working
|
Try this...
SetEntProp(weapon, Prop_Data, "m_iClip1", 30);
SetEntProp(weapon, Prop_Send, "m_iClip1", 30);
SetEntProp(client, Prop_Data, "m_iAmmo", 5, _, m_iPrimaryAmmoType);
SetEntProp(client, Prop_Send, "m_iAmmo", 5, _, m_iPrimaryAmmoType);
If that doesn't work then you may have to catch when the weapon reload ends and set it there...