AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   TF2Items (https://forums.alliedmods.net/forumdisplay.php?f=146)
-   -   Display item/attribute names (https://forums.alliedmods.net/showthread.php?t=339365)

Hyreon 09-04-2022 16:22

Display item/attribute names
 
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.

PC Gamer 09-08-2022 17:46

Re: Display item/attribute names
 
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); 



All times are GMT -4. The time now is 05:04.

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