Merge pull request #330 from WPMGPRoSToTeMa/csgetuserweapon

Add cs_get_user_weapon_entity() and cs_get_user_weapon() natives
This commit is contained in:
Vincent Herbet
2016-01-23 17:53:54 +01:00
2 changed files with 63 additions and 0 deletions

View File

@ -1085,6 +1085,32 @@ native bool:cs_get_translated_item_alias(const alias[], itemname[], maxlength);
*/
native any:cs_get_weapon_info(weapon_id, CsWeaponInfo:type);
/**
* Returns active weapon entity.
*
* @param playerIndex Player index
*
* @return Weapon entity index on success or 0 if there is no active weapon
* @error If the client index is not within the range of 1 to
* maxClients, or the client is not connected, an error will be
* thrown.
*/
native cs_get_user_weapon_entity(playerIndex);
/**
* Returns weapon index of the active weapon.
*
* @note More reliable than get_user_weapon.
*
* @param playerIndex Player index
*
* @return Weapon index on success or 0 if there is no active weapon
* @error If the client index is not within the range of 1 to
* maxClients, or the client is not connected, an error will be
* thrown.
*/
native cs_get_user_weapon(playerIndex);
/**
* Returns a weapon class id associated with a weapon id.
*