Announcement!
Since I have no free time, also due to lack of interest, I cannot support this plugin anymore. I hope someone would make a mem-hacking version.
* Download files from Links section (below)
* Put tf2itemsinfo.smx in /addons/sourcemod/plugins/
* Put tf2itemsinfo.txt in /addons/sourcemod/data/
* Put tf2itemsinfo.sp in /addons/sourcemod/scripting/
* Put tf2itemsinfo.inc in /addons/sourcemod/scripting/includes/
/**
* @brief Get item classname
*
* @param iItemDefinitionIndex -
* @param strItemClass String to store item class
* @param iItemClassLength String length
* @param iPlayerClass Player class
*
* @return False is item doesn't exist, true otherwise
**/
native TF2II_GetItemClass( iItemDefinitionIndex, String:strItemClass[], iItemClassLength, TFClassType:iPlayerClass = TFClass_Unknown );
/**
* @brief Get item slot number
*
* @param iItemDefinitionIndex -
* @param iPlayerClass Player class
*
* @return Item slot number
**/
native TF2ItemSlot:TF2II_GetItemSlot( iItemDefinitionIndex, TFClassType:iPlayerClass = TFClass_Unknown );
/**
* @brief Get item slot name
*
* @param iItemDefinitionIndex -
* @param strItemSlot String to store item slot
* @param iItemSlotLength String length
*
* @return False is item doesn't exist, true otherwise
**/
native bool:TF2II_GetItemSlotName( iItemDefinitionIndex, String:strItemSlot[], iItemSlotLength );
/**
* @brief Get item slot number (as in items_game.txt)
*
* @param iItemDefinitionIndex -
* @param iPlayerClass Player class
*
* @return Item slot number
**/
native TF2ItemSlot:TF2II_GetListedItemSlot( iItemDefinitionIndex, TFClassType:iPlayerClass = TFClass_Unknown );
/**
* @brief Get item slot name (as in items_game.txt)
*
* @param iItemDefinitionIndex -
* @param strItemSlot String to store item slot
* @param iItemSlotLength String length
*
* @return False is item doesn't exist, true otherwise
**/
native bool:TF2II_GetListedItemSlotName( iItemDefinitionIndex, String:strItemSlot[], iItemSlotLength );
/**
* @brief Is item can be used by this class?
*
* @param iItemDefinitionIndex -
* @param iClass -
*
* @return True if true, false otherwise.
**/
native bool:TF2II_IsItemUsedByClass( iItemDefinitionIndex, TFClassType:iClass );
/**
* @brief Get number of attributes
*
* @param iItemDefinitionIndex -
*
* @return Number of attributes
**/
native _:TF2II_GetItemNumAttributes( iItemDefinitionIndex );
/**
* @brief -
*
* @param iItemDefinitionIndex -
* @param iSlotAttribute The attribute slot index, ranges from 0 to 15
*
* @return The attribute ID; -1 on failure
**/
native _:TF2II_GetItemAttributeID( iItemDefinitionIndex, iSlotAttribute );
/**
* @brief -
*
* @param iItemDefinitionIndex -
* @param iSlotAttribute The attribute slot index, ranges from 0 to 15
*
* @return Attribute value
**/
native Float:TF2II_GetItemAttributeValue( iItemDefinitionIndex, iSlotAttribute );
/**
* @brief Check equip regions for conflicts
*
* @param strEquipRegionA First equip region
* @param strEquipRegionB Second equip region
*
* @return Attribute ID on success, -1 otherwise
**/
native bool:TF2II_IsConflictRegions( const String:strEquipRegionA[], const String:strEquipRegionB[] );
/**
* @brief Get quality number by name
*
* @param strQualityName Quality name
*
* @return Quality number on success, -1 otherwise
**/
native TF2ItemQuality:TF2II_GetQualityByName( const String:strAttributeName[] );
/**
* @brief Get quality name
*
* @param iQuality -
* @param strQualityName String to store quality name
* @param iQualityNameLength String length
*
* @return True on success, false otherwise
**/
native bool:TF2II_GetQualityName( iAttributeID, String:strAttributeName[], iAttributeNameLength );
/**
* @brief Get attribute ID by name
*
* @param strAttributeName Attribute name
*
* @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_GetAttributeNameByID( iAttributeID, String:strAttributeName[], iAttributeNameLength );
Other stuff
PHP Code:
/**
* @brief Check equip regions for conflicts
*
* @param strEquipRegionA First equip region
* @param strEquipRegionB Second equip region
*
* @return Attribute ID on success, -1 otherwise
**/
native bool:TF2II_IsConflictRegions( const String:strEquipRegionA[], const String:strEquipRegionB[] );
/**
* @brief Get quality number by name
*
* @param strQualityName Quality name
*
* @return Quality number on success, -1 otherwise
**/
native TF2ItemQuality:TF2II_GetQualityByName( const String:strAttributeName[] );
/**
* @brief Get quality name
*
* @param iQuality -
* @param strQualityName String to store quality name
* @param iQualityNameLength String length
*
* @return True on success, false otherwise
**/
native bool:TF2II_GetQualityName( iAttributeID, String:strAttributeName[], iAttributeNameLength );
/**
* @brief Get attribute ID by name
*
* @param strAttributeName Attribute name
*
* @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_GetAttributeNameByID( iAttributeID, String:strAttributeName[], iAttributeNameLength );
/**
* @brief Note: all arguments are optional. Set them to detail your search query.
*
* @param strItemClass Item class name
* @param strItemSlot Item slot name
* @param iUsedByClasses Classes (bits)
* @param strTool Tool type
*
* @return Array of item IDs
**/
native Handle:TF2II_FindItems( const String:strItemClass[] = "", const String:strItemSlot[] = "", iUsedByClasses = TF2II_CLASS_NONE, const String:strTool[] = "" );
/**
* @brief -
*
* @param bAllEffects Print valid or all effects?
*
* @return Array of results
**/
native Handle:TF2II_ListEffects( bAllEffects = true );
Fowrards (events)
PHP Code:
/**
* @brief Called when an item schema is parsed (or reloaded)
**/
forward TF2II_OnItemSchemaUpdated();
/**
* @brief Called when someone's trying to find items
*
* @param iClient Caller
* @param strQuery Search query
* @param hResults Array of results
* @param bByClassname Is searching by classname?
*
* @noreturn
**/
forward TF2II_OnSearchCommand( iClient, const String:strQuery[], &Handle:hResults, bool:bByClassname );
/**
* @brief Called when some plugin's trying to find items
*
* @param strItemClass Item class name
* @param strItemSlot Item slot name
* @param iUsedByClasses Classes (bits)
* @param strTool Tool type
* @param hResults Array of results
*
* @noreturn
**/
forward TF2II_OnFindItems( const String:strItemClass[], const String:strItemSlot[], iUsedByClasses, const String:strTool[], &Handle:hResults );
Stock functions
PHP Code:
/**
* @brief Get quality color by quality number
*
* @param nQuality -
*
* @return Hex code
**/
stock _:TF2II_GetQualityColor( TF2ItemQuality:nQuality = TF2ItemQuality_Normal );
/**
* @brief Get slot number by name
*
* @param strSlot Slot name
* @param iClass Player class
*
* @return Item slot number
**/
stock TF2ItemSlot:TF2II_GetSlotByName( const String:strSlot[], TFClassType:iClass = TFClass_Unknown );
Changelogs:
Spoiler
Code:
14.11.13:
* Version: 1.8.17.6:
* Fixed AttribData array size thing. Stupid me.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
13.11.13:
* Version: 1.8.17.5:
* Added sm_tf2ii_fix01 convar to skip 'string' attributs that currently cannot be handled by TF2Items
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
29.07.13:
* Version: 1.8.17.4:
* Fixed throwing an error when item schema is not precached.
* Files updated:
* tf2itemsinfo.txt
* tf2itemsinfo.smx
* tf2itemsinfo.sp
15.07.13:
* Version: 1.8.17.3:
* Added extra info for sm_fi/pi command:
* Added optional second argument
* Added TF2II_PROP_PROPER_NAME flag
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
29.06.13:
* Version: 1.8.17.2:
* Fixed sm_fic/sm_sic printing items' class names instead of display names.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
15.06.13:
* Version: 1.8.17:
* Minor bug fixes.
* Version: 1.8.17.1:
* Minor bug fixes.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
14.06.13:
* Version: 1.8.16.4:
* Now attributes are stores to DB.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
14.06.13:
* Version: 1.8.16.3:
* Fixed TF2_FindItems is working too slow.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
12.06.13:
* Version: 1.8.16.1:
* Attempt to fix memory leaks.
* Version: 1.8.16.2:
* Attempt to fix memory leaks;
* Added ability to store item data to DB:
* Added sm_tf2ii_db console variable;
* Leave sm_tf2ii_db empty to disable this feature.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
25.05.13:
* Version: 1.8.16:
* Updated missing MarkAsOptional functions;
* Fixed ItemData_KeyValues isn't saving data from prefabs (FlaminSarge's fix).
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
07.12.12:
* Version: 1.8.15:
* Added TF2II_Get(Item/Attrib)KeyValues function.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
30.11.12:
* Version: 1.8.14:
* Added TF2II_GetItemAttributes function.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
29.10.12:
* Version: 1.8.13:
* Added TF2II_Get(Item/Attrib)Key(/Float/String) function.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
16.10.12:
* Version: 1.8.12:
* Minor bug fixes.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
11.10.12:
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.txt
* tf2itemsinfo.sp
* tf2itemsinfo.inc
08.10.12:
* Version: 1.8.11:
* Some backwards compatibility (again).
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
02.10.12:
* Version: 1.8.10:
* Some backwards compatibility.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
29.09.12:
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
28.09.12:
* Version: 1.8.9:
* Fixed bundles are parsed as melee;
* Fixed equipment region name cutting;
* Added TF2II_GetListedItemSlot and TF2II_GetListedItemSlotName;
* Added sm_tf2ii_updater console variable so you can disable autoupdate.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.txt
* tf2itemsinfo.sp
* tf2itemsinfo.inc
16.09.12:
* Version: 1.8.8:
* Fixed TF2II_FindItemsIDsByCond not working.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
12.09.12:
* Version: 1.8.7:
* Fixed data overwride order.
* Fixed pagination
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
12.09.12:
* Version: 1.8.6:
* Changed data overwride order;
* Fixed used_by_classes checker worked incorrect.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
11.09.12:
* Version: 1.8.5:
* Added alot of functions to work with attributes.
* Removed Herobrine
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
01.09.12:
* Version: 1.8.4:
* Fixed TF2II_FindItems searching by tool type incorrectly.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
30.08.12:
* Version: 1.8.3:
* Some functions are came back; Again;
* Some functions are marked as deprecated; Again;
* Fixed unused parameters are required for TF2II_GetItemQuality().
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
28.08.12:
* Version: 1.8.2:
* Some functions are came back;
* Some functions are marked as deprecated.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
27.08.12:
* Version: 1.8.1:
* sm_ii/sm_pi now says about holiday restrictions.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.txt
25.08.12:
* Version: 1.8.0:
* Added many defines;
* Marked TF2II_GetItemName as an optional;
* Removed many functions (such as TF2II_FindItemsIDsByCond);
* Added TF2II_FindItems;
* Added TF2II_ItemHasProperty;
* Renamed TF2II_ListAttachableEffects to TF2II_ListEffects;
* Renamed TF2II_OnSearchItems to TF2II_OnSearchCommand;
* Added TF2II_OnFindItems;
* Fixed pagination (total number of pages);
* Optimized memory usage (I hope so);
* No longer uses TF2Items extension;
* No longer uses TF2Items Randomizer gamedata.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
10.08.12:
* Version: 1.7.14:
* Added sm_pi command (same as sm_ii);
* Updated pagination so page numbers starts with 1 (instead of 0).
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
04.08.12:
* Version: 1.7.13:
* Added pagination for items/attributes search;
* Lowered items-per-page from 50 to 20;
* Lowered minimal characters limit from 4 to 2;
* The Flying Guillotine marked as medieval weapon;
* Added TF2WeaponSlot_Sapper in include file.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
* tf2itemsinfo.txt
03.08.12:
* Version: 1.7.12:
* Fixed sapper using wrong slot number.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.txt
15.07.12:
* Version: 1.7.11:
* sm_sa/sm_fi/sm_fic now uses string of arguments instead of just first word.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.txt
26.06.12:
* Version: 1.7.10:
* Added command sm_ii (print item data).
* Updated gamedata
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.txt
26.06.12:
* Version: 1.7.9:
* Removed commands: sm_tf2ii_search, sm_tf2ii_find, sm_searchitems, sm_finditems, sm_searchattrs, sm_findattrs;
* Added commands: sm_sic, sm_fic (find items by classname);
* Added TF2II_OnSearchItems forward.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
24.06.12:
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
18.06.12:
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
17.06.12:
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
12.06.12:
* Version: 1.7.8:
* Added TF2ItemQuality_ToborA;
* Added quality parser;
* Added TF2II_GetQualityName, TF2II_GetQualityByName.
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
06.06.12:
* Version: 1.7.7:
* Fixed wrong SDKCall name (EquipWearables instead of CTFPlayer::EquipWearables);
* Removed sm_tf2ii_search, sm_tf2ii_find, sm_tf2ii_s, sm_tf2ii_f commands;
* Added sm_searchattrs, sm_findattrs, sm_sa, sm_fa - search for attributes;
* Added sm_fi command (same as sm_si);
* Now you can find items by their ID (if you forgot item name);
* Updated enums (code only; no actual changes).
* Files updated:
* tf2itemsinfo.smx
* tf2itemsinfo.sp
* tf2itemsinfo.inc
1.7.6:
* Compatibility with future TF2Items Randomizer update.
1.7.5:
* Fixed MEMORY LEAK errors.
1.7.4:
* Added sm_tf2ii_search command so if you forgot item id, you can find it by name!
1.7.3:
* Updated bUsedByClasses array size/type in TF2II_FindItemsIDsByCond.
1.7.2:
* Added TF2II_ItemCanBeStrange native;
* Added TF2II_GetQualityColor stock;
* Updated data file.
1.7.1:
* Fixed handle passing in TF2II_GetItemEquipRegions.
1.7:
* Added TF2II_GetItemEquipRegions and TF2II_IsConflictRegions functions.
1.6.1:
* Renamed functions:
* TF2II_GetItemClassByID to TF2II_GetItemClass;
* TF2II_GetItemSlotByID to TF2II_GetItemSlot;
* TF2II_GetItemSlotNameByID to TF2II_GetItemSlotName;
* TF2II_GetItemQualityNameByID to TF2II_GetItemQualityName.
1.6:
* Added TF2II_ItemHolidayRestriction stock (checkin if item restricted by selected holiday);
* Updated data-file;
* Now supports GoD-Tony's Updater plugin.
1.5:
* Stocks is now a natives;
* Added data-file (contains extra data about items);
* Updated TF2II_GetNamedItem so it returns handle (also, removed second param);
* Updated TF2II_GiveNamedItem so it returns entity id;
* (26.04.12) hidden update:
* Renamed TF2II_GetItemToolType to TF2II_GetToolType;
* Added TF2II_OnItemSchemaUpdated forward (no params).
1.4:
* Changed TF2II_FindItemsIDsByCond so now it returns an array (also, removed first param);
* Fixed memory leaks (I hope so);
* Added some stocks;
* Added TF2II_ListAttachableEffects native.
1.3:
* Added TF2II_GetItemMinLevel, TF2II_GetItemMaxLevel, TF2II_GetItemQuality natives;
* Fixed giving Saxxy.
1.2:
* Added TF2II_GetNamedItem and TF2II_GiveNamedItem natives.
1.1:
* Added TF2II_FindItemsIDsByCond native.
1.0: (15.04.12)
* Initial release.