Im trying to block usp reload and i found this code on the internet
Code:
RegisterHam(Ham_Weapon_Reload, "weapon_usp", "Reload_Post", 1);
Code:
public Reload_Post(weapon_entity)
{
new id = pev(weapon_entity, pev_owner);
if (!is_user_connected(id))
return HAM_IGNORED;
if( g_iCurrentDay == DAY_LASERDOME )
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
But the usp is reloading anyways when i giving it 1 bullet
Here is my give 1 bullet code
Code:
if( g_iCurrentDay == DAY_LASERDOME )
{
get_user_ammo( iPlayer, CSW_USP, clip, ammo )
if ( ammo <= 0 )
{
cs_set_weapon_ammo(fm_get_weapon_id(iPlayer, "weapon_usp"), 1);
new ent = find_ent_by_owner( 0, "weapon_usp", iPlayer )
cs_set_weapon_silen( ent, 1 )
}
}
Code:
stock fm_get_weapon_id(index, const weapon[])
{
new ent = -1;
while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", weapon)) != 0)
{
if(index == pev(ent, pev_owner))
return ent;
}
return 0;
}
__________________