Raised This Month: $ Target: $400

Display item/attribute names

Post New Thread Reply   
Thread Tools Display Modes
Author Message
New Member
Join Date: Sep 2022
Old 09-04-2022 , 17: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.

Last edited by Hyreon; 09-04-2022 at 17:23.
Hyreon is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 09-08-2022 , 18: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];
PrintToChat(client"%N received item %d (%s)"clientitemindexitemname); 
PC Gamer is offline

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 05:27.

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