PHP Code:
/* Formatright © 2009, ConnorMcLeod
Infinite Ammo is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Infinite Ammo; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.0.1"
#define m_iClip 51
#define m_iClientClip 52
const NOCLIP_WPN_BS = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4)
public plugin_init()
{
register_plugin("Infinite Ammo", VERSION, "ConnorMcLeod")
new szWeapon[20]
for(new i=1; i<=CSW_P90; i++)
{
if( !(NOCLIP_WPN_BS & (1<<i)) && get_weaponname(i, szWeapon, charsmax(szWeapon)) )
{
RegisterHam(Ham_Item_UpdateClientData, szWeapon, "Weapon_UpdateClientData")
}
}
}
public Weapon_UpdateClientData(iEnt, id)
{
static iClip, iClientClip
iClip = get_pdata_int(iEnt, m_iClip, 4)
iClientClip = get_pdata_int(iEnt, m_iClientClip, 4)
if( iClip < iClientClip )
{
set_pdata_int(iEnt, m_iClip, iClientClip, 4)
return HAM_HANDLED
}
return HAM_IGNORED
}
__________________