Raised This Month: $ Target: $400
 0% 

Display item/attribute names


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hyreon
New Member
Join Date: Sep 2022
Old 09-04-2022 , 16:22   Display item/attribute names
Reply With Quote #1

Using TF2Items I have (somewhat?) successfully implemented random attribute changes. However, I need a way to display these attribute changes to the user.

How do I transform the numeric ID into a string that is readable by others? I'm looking for two things: turning the attribute ID into an attribute string, and turning the item ID into an item string.
Thanks.

Last edited by Hyreon; 09-04-2022 at 16:23.
Hyreon is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 09-08-2022 , 17:46   Re: Display item/attribute names
Reply With Quote #2

You can use TFEconData by the very talented nosoop to get an item name. It allows you to input an item index and it will return an item name. Here's a link: https://github.com/nosoop/SM-TFEconData

partial code example:
PHP Code:
            char itemname[64];
            
TF2Econ_GetItemName(itemindexitemnamesizeof(itemname));
            
PrintToChat(client"%N received item %d (%s)"clientitemindexitemname); 
PC Gamer is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode