[DEV] TF2 Item Info v1.2 (15.04.12)

What is it?
List of natives that could be useful for plugin devs.
Optional:
TF2Items extension.

Gamedata from TF2Items Randomizer.
How to configure?
Not possible.
CVars & CMDs:


PHP Code:







sm_tf2ii_version // version

// commands

sm_tf2ii_refresh // rescan items_game.txt 









Natives:


PHP Code:







/**

 * @brief Is item exists in items_game.txt

 *

 * @param iItemDefinitionIndex    -

 *

 * @return                        True if is it, false otherwose

 **/

native bool:TF2II_IsValidItemIDiItemDefinitionIndex );



/**

 * @brief Get item class

 *

 * @param iItemDefinitionIndex    -

 * @param strItemClass            String to store item class

 * @param iItemClassLength        String length

 *

 * @noreturn

 **/

native TF2II_GetItemClassByIDiItemDefinitionIndexString:strItemClass[], iItemClassLength );



/**

 * @brief Get item's slot number

 *

 * @param iItemDefinitionIndex    -

 *

 * @return                        Item slot number

 **/

native _:TF2II_GetItemSlotByIDiItemDefinitionIndex );



/**

 * @brief Get item slot name

 *

 * @param iItemDefinitionIndex    -

 * @param strItemSlot            String to store item slot

 * @param iItemSlotLength        String length

 *

 * @noreturn

 **/

native TF2II_GetItemSlotNameByIDiItemDefinitionIndexString:strItemSlot[], iItemSlotLength );



/**

 * @brief Is item paintable?

 *

 * @param iItemDefinitionIndex    -

 *

 * @return                        True if paintable, false otherwise

 **/

native bool:TF2II_IsItemUsedByClassiItemDefinitionIndexiClass );



/**

 * @brief Is item paintable?

 *

 * @param iItemDefinitionIndex    -

 *

 * @return                        True if paintable, false otherwise

 **/

native bool:TF2II_IsItemPaintableiItemDefinitionIndex );



/**

 * @brief Get number of attributes

 *

 * @param iItemDefinitionIndex    -

 *

 * @return                        Number of attributes

 **/

native _:TF2II_GetItemNumAttributesiItemDefinitionIndex );



/**

 * @brief -

 *

 * @param iItemDefinitionIndex    -

 * @param iSlotAttribute        The attribute slot index, ranges from 0 to 15

 * @param strAttributeName        String to store attribute name

 * @param iAttributeNameLength    String length

 *

 * @return                        The attribute name; empty on failure

 **/

native TF2II_GetItemAttributeNameiItemDefinitionIndexiSlotAttributeString:strAttributeName[], iAttributeNameLength );



/**

 * @brief -

 *

 * @param iItemDefinitionIndex    -

 * @param iSlotAttribute        The attribute slot index, ranges from 0 to 15

 *

 * @return                        The attribute ID; -1 on failure

 **/

native _:TF2II_GetItemAttributeIDiItemDefinitionIndexiSlotAttribute );



/**

 * @brief -

 *

 * @param iItemDefinitionIndex    -

 * @param iSlotAttribute        The attribute slot index, ranges from 0 to 15

 *

 * @return                        Attribute value

 **/

native Float:TF2II_GetItemAttributeValueiItemDefinitionIndexiSlotAttribute );



/**

 * @brief Get attribute name by ID

 *

 * @param strAttributeName        String to store attribute name

 * @param iAttributeNameLength    String length

 *

 * @return                        Attribute ID on success, -1 otherwise

 **/

native _:TF2II_GetAttributeIDByName( const String:strAttributeName[] );



/**

 * @brief Get attribute name by ID

 *

 * @param iAttributeID            -

 * @param strAttributeName        String to store attribute name

 * @param iAttributeNameLength    String length

 *

 * @return                        True on success, false otherwise

 **/

native bool:TF2II_GetAttributeNameByIDiAttributeIDString:strAttributeName[], iAttributeNameLength );



/**

 * @brief -

 *

 * @param hResults                DataPack to store items IDs

 * @param strItemClass            Item class name

 * @param iItemSlot                Item slot number

 * @param bFilterClass            Should we check class or not

 * @param bUsedByClasses        Array of classes with rights (example: bUsedByClasses[0]=true meaning that we should find items which scout can equip)

 *

 * @return                        Number of results; -1 on error

 **/

native _:TF2II_FindItemsIDsByCond( &Handle:hResults, const String:strItemClass[] = ""iItemSlot = -1, const String:strItemSlot[] = ""bool:bFilterClass nopebool:bUsedByClasses[10] = { nope, ... } );



/**

 * @brief Get item based on items_game.txt

 *

 * @param iItemDefinitionIndex    -

 * @param hItem                    -

 * @param iQuality                (see TF2ItemQuality_ above)

 * @param iLevel                Item level (from 1 to 127)

 *

 * @return                        True on success, false otherwise

 **/

native bool:TF2II_GetNamedItemiItemDefinitionIndex, &Handle:hItemiQuality TF2ItemQuality_UniqueiLevel );



/**

 * @brief Give item based on items_game.txt

 *

 * @param iClient                Target

 * @param iItemDefinitionIndex    -

 * @param iQuality                (see TF2ItemQuality_ above)

 * @param iLevel                Item level (from 1 to 127)

 *

 * @return                        True on success, false otherwise

 **/

native bool:TF2II_GiveNamedItemiClientiItemDefinitionIndexiQuality TF2ItemQuality_UniqueiLevel ); 









Links:

Changelog: http://files.xpenia.org/sourcemod/tf2ii/

Download: Plugin (Source code)

Includes: tf2itemsinfo.inc


Orignal From: [DEV] TF2 Item Info v1.2 (15.04.12)

No comments

Not a single link is allowed to submit in comment :o