I thought m_iClip2 was for secondary guns specifically? I've tried it and it didn't seem to do anything. Unless I'm missing something.
I've made it work using a different approach, might be overly complicated. When client makes a gun selection:
PHP Code:
if (iOneTapEnabled == 1)
{
Client_GiveWeaponAndAmmo(iClient, sWeapons[iSelectedWeapon][0], _, 0, _, 1);
}
When 'weapon_fire' is hooked:
PHP Code:
public void EventOTap(Event event, const char[] name, bool dontBroadcast)
{
if (iOneTapEnabled == 1)
{
int iUserID = GetEventInt(event, "userid");
int iClient = GetClientOfUserId(iUserID);
CreateTimer(0.2, GiveAmmo, iClient);
}
}
public Action GiveAmmo(Handle timer, any client)
{
for (int iSlot = 0; iSlot < 2; iSlot++)
{
int iEntity;
if ((iEntity = GetPlayerWeaponSlot(client, iSlot)) != -1)
{
char sWeapon[64];
GetEntityClassname(iEntity, sWeapon, sizeof(sWeapon));
Client_SetWeaponPlayerAmmo(client, sWeapon, 1);
Client_SetWeaponClipAmmo(client, sWeapon, 0);
}
}
}
__________________