Cstrike: Add cs_get_weapon_info() native

This commit is contained in:
Arkshine
2015-07-25 16:17:50 +02:00
parent 60cdbeb219
commit 600a15a57b
7 changed files with 125 additions and 0 deletions

View File

@ -1062,6 +1062,17 @@ stock cs_get_weapon_class(weapon_id)
}
/**
* Returns some information about a weapon.
*
* @param weapon_id Weapon id, see CSW_* constants
* @param type Info type, see CS_WEAPONINFO_* constants
*
* @return Weapon information value
* @error If weapon_id and type are out of bound, an error will be thrown.
*/
native any:cs_get_weapon_info(weapon_id, CsWeaponInfo:type);
/**
* Called when CS internally fires a command to a player.
*

View File

@ -346,3 +346,13 @@ enum CsAmmoType
CS_AMMO_57MM = 8,
CS_AMMO_357SIG = 9,
};
enum CsWeaponInfo
{
CS_WEAPONINFO_COST = 0,
CS_WEAPONINFO_CLIP_COST = 1,
CS_WEAPONINFO_BUY_CLIP_SIZE = 2,
CS_WEAPONINFO_GUN_CLIP_SIZE = 3,
CS_WEAPONINFO_MAX_ROUNDS = 4,
CS_WEAPONINFO_AMMO_TYPE = 5,
};