public CmdBlocked(id) { if(bInfinityClip[id]) return PLUGIN_HANDLED;
return PLUGIN_CONTINUE; }
public OnItemDeployPost(ent) { if(!is_valid_ent(ent)) return; //for safety
static id; id = get_pdata_cbase(ent, 41, 4); if(!is_user_alive(id) || !bInfinityClip[id]) return; //for safety @ player don't have infinity clips
cs_set_weapon_ammo(ent, 32767) //set infinity clip new iParams[1]; iParams[0] = ent; set_task(0.1, "TaskSetBpAmmo", id, iParams, 1) //HL1 engine is weird it need task to set bpammo }
public TaskSetBpAmmo(iParams[], id) { if(!is_user_alive(id) || !bInfinityClip[id]) return; //for safety
new ent = iParams[0] if(!is_valid_ent(ent)) return; //for safety
new wpnid = cs_get_weapon_id(ent); if((WPN_NO_RELOAD & (1<<wpnid))) return; //unreload weapon
This method only suitable to use on server that has no weapon drop feature. Because when you drop your weapon and someone pickup it he will get the infinity clip in weaponbox too. But that ammo will be reset if he reload the weapon.