Signature
stock bool:cs_is_valid_itemid(id, bool:weapon_only = false){ if(id <= CSI_NONE) { return false; } if(id > CSI_LAST_WEAPON && id != CSI_SHIELDGUN && weapon_only) { return false; } if(id >= CSI_MAX_COUNT) { return false; } return true;}
Description
Checks whether an item id is not out of bounds.
Parameters
- id — Item id (CSI_* constants)
-
weapon_only
—
If true, only the real weapon ids will be checked,
including shield as well
Returns
True if item id is valid, false otherwise