Cstrike: Add cs_get_item_id() and cs_get_translated_item_alias() natives

This commit is contained in:
Arkshine
2015-07-24 09:57:10 +02:00
parent c6628f22ee
commit e6a2434887
16 changed files with 877 additions and 67 deletions

View File

@ -1025,6 +1025,43 @@ native cs_create_entity(const classname[]);
*/
native cs_find_ent_by_class(start_index, const classname[]);
/**
* Returns the item id associated with an item name and its aliases.
*
* @note The item name is case sensitive an can be with or without
* weapon_ and item_ prefixes. This can be a command alias as well.
* Values examples: ak47, weapon_ak47, kevlar, item_kevlar, vest, bullpup, ...
*
* @param name Alias or classname
* @param classid If item is a weapon, variable to store the associated
* weapon class id in (CS_WEAPONCLASS_* constants)
*
* @return Item id (CSI_* constants)
*/
native any:cs_get_item_id(const name[], &CsWeaponClassType:classid = CS_WEAPONCLASS_NONE);
/**
* Returns an item name associated with a command alias.
*
* @note The alias is case sensitive.
* @note If not an alias to a weapon, buffer will be set with the original alias.
*
* @param alias Alias name
* @param itemname Buffer to store item name to
* @param maxlength Maximum buffer size
*
* @return True if alias is translated, false otherwise
*/
native bool:cs_get_translated_item_alias(const alias[], itemname[], maxlength);
/**
*
*/
stock cs_get_weapon_class(weapon_id)
{
}
/**
* Called when CS internally fires a command to a player.
*

View File

@ -129,9 +129,10 @@ enum
#define CSI_VESTHELM CSW_VESTHELM // Custom
#define CSI_DEFUSER 33 // Custom
#define CSI_NVGS 34 // Custom
#define CSI_SHIELD 35 // Custom - The value passed by the forward, more convenient for plugins.
#define CSI_PRIAMMO 36 // Custom
#define CSI_SECAMMO 37 // Custom
#define CSI_SHIELD 38 // Custom - The value passed by the forward, more convenient for plugins.
#define CSI_MAX_COUNT 38
/**
* Player's movements constants.