For example, I want to give any weapon more ammo, then it could have normally -> I do this
PHP Code:
void GiveAmmoCurrentWeapon(int client, int amount)
{
int weaponIndex = -1;
//First we try to find weapon in slot0 (primary), if nothing was found check slot1(pistol)
for(int i = 0; i <= 1 && weaponIndex == -1 ; i++)
{
weaponIndex = GetPlayerWeaponSlot(client, i);
}
//if we have found a weapon
if(weaponIndex != -1 && IsValidEdict(weaponIndex))
{
//Set reserve ammo
SetEntProp(weaponIndex, Prop_Send, "m_iPrimaryReserveAmmoCount", GetEntProp(weaponIndex, Prop_Send, "m_iPrimaryReserveAmmoCount") + amount);
//Set current ammo
SetEntProp(weaponIndex, Prop_Send, "m_iClip1", GetEntProp(weaponIndex, Prop_Send, "m_iClip1") + amount);
}
}
Everything works fine except player with additive ammo can press reload button and game will allow him to do it, ammo will be reseted to normal. Is there any way to prevent reloading if you have too much ammo?