Biohazard mode have this function:
PHP Code:
register_event("CurWeapon", "event_curweapon", "be", "1=1")
PHP Code:
public event_curweapon(id)
{
if(!is_user_alive(id))
return PLUGIN_CONTINUE
static weapon
weapon = read_data(2)
static ammotype
ammotype = get_pcvar_num(cvar_ammo)
if(!ammotype || (AMMOWP_NULL & (1<<weapon)))
return PLUGIN_CONTINUE
static maxammo
switch(ammotype)
{
case 1: maxammo = g_weapon_ammo[weapon][MAX_AMMO]
case 2: maxammo = g_weapon_ammo[weapon][MAX_CLIP]
}
if(!maxammo)
return PLUGIN_CONTINUE
switch(ammotype)
{
case 1:
{
static ammo
ammo = cs_get_user_bpammo(id, weapon)
if(ammo < 1)
cs_set_user_bpammo(id, weapon, maxammo)
}
case 2:
{
static clip; clip = read_data(3)
if(clip < 1)
{
static weaponname[32]
get_weaponname(weapon, weaponname, 31)
static ent
ent = find_ent_by_owner(-1, weaponname, id)
cs_set_weapon_ammo(ent, maxammo)
}
}
}
return PLUGIN_CONTINUE
}
The purpose of this is to adjust whether the players have unlimited ammo,or unlimited clip.
My question is:Could this be implemented without the use of Curweapon?