native custom_weapon_add(const wpnname[], melee = 0, const logname[] = "");
Adds a custom weapon to the stats system.
-
The weapon name should be the full display name of the gun such as
"Desert Eagle" while the logname should be "weapon_deagle".
- wpnname — Full weapon name
- melee — If nonzero the weapon will be considered a melee weapon
- logname — Weapon short name
Cusom weapon id (>0) on success, 0 if no more custom weapons
can be added
native custom_weapon_dmg(weapon, att, vic, damage, hitplace = 0);
Triggers a damage event on a custom weapon, adding it to the internal stats.
-
This will also call the client_damage() and client_kill() forwards if
applicable.
-
For a list of possible body hitplaces see the HIT_* constants in
amxconst.inc
- weapon — Custom weapon id
- att — Attacker client index
- vic — Victim client index
- damage — Damage dealt
- hitplace — Optional body hitplace
-
If the weapon id is not a custom weapon, an invalid client
index, damage value or hitplace is provided, an error will
be thrown.
native custom_weapon_shot(weapon, index);
Adds a shot event on a custom weapon to the internal stats.
- weapon — Custom weapon id
- index — Client index
-
If the weapon id is not a custom weapon or an invalid client
index is provided, an error will be thrown.
native xmod_is_melee_wpn(wpnindex);
Returns if the weapon is considered a melee weapon.
-
For a list of default CS weapon ids see the CSW_* constants in
amxconst.inc, this function also works on custom weapons.
-
For the default CS weapons this obviously returns true only for
CSW_KNIFE.
- wpnindex — Weapon id
1 if weapon is a melee weapon, 0
- If an invalid weapon id is provided an error will be thrown.
native xmod_get_wpnname(wpnindex, name[], len);
Retrieves the full weapon name of a weapon id.
-
For a list of default CS weapon ids see the CSW_* constants in
amxconst.inc, this function also works on custom weapons.
-
For the default CS weapons this obviously returns true only for
CSW_KNIFE.
- wpnindex — Weapon id
- name — Buffer to copy weapon name to
- len — Maximmum buffer size
Number of cells written to buffer
- If an invalid weapon id is provided an error will be thrown.
native xmod_get_wpnlogname(wpnindex, name[], len);
Retrieves the weapon log name of a weapon id.
-
For a list of default CS weapon ids see the CSW_* constants in
amxconst.inc, this function also works on custom weapons.
-
For the default CS weapons this obviously returns true only for
CSW_KNIFE.
- wpnindex — Weapon id
- name — Buffer to copy weapon log name to
- len — Maximmum buffer size
Number of cells written to buffer
- If an invalid weapon id is provided an error will be thrown.
native xmod_get_maxweapons();
Returns the maximum amount of weapons that the stats system supports.
Maximum number of weapons supported
native xmod_get_stats_size();
Returns the number of stats tracked by the stats system.
Number of stats tracked