Raised This Month: $32 Target: $400
 8% 

[TF2] Quality Labels


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 01-13-2021 , 03:39   [TF2] Quality Labels
Reply With Quote #1

What code, if any, can I use to properly set the quality name on a weapon?

If I use the code below the correct quality color is properly displayed when you view the item. However, the quality label such as vintage, genuine, unusual, self-made will not be displayed.

PHP Code:
bool CreateWeapon(int clientchar[] classnameint itemindexint qualityint level 0)
{
    
int weapon CreateEntityByName(classname);

    if (!
IsValidEntity(weapon))
    {
        return 
false;
    }
    
    
char entclass[64];
    
GetEntityNetClass(weaponentclasssizeof(entclass));
    
SetEntProp(weaponProp_Send"m_iItemDefinitionIndex"itemindex);     
    
SetEntProp(weaponProp_Send"m_bInitialized"1);
    
SetEntData(weaponFindSendPropInfo(entclass"m_iEntityQuality"), quality);    
    
SetEntProp(weaponProp_Send"m_iEntityLevel"level);


    
DispatchSpawn(weapon);
    
EquipPlayerWeapon(clientweapon);
    
    return 
true;     

Quality Numbers and Colors (borrowed from TF2Items post): http://imgur.com/53erbdK


For example, let's suppose I use the code above to create a weapon with quality of '11' which is 'Strange' quality. When that weapon is viewed the weapon name will appear with an orange color (which is Strange quality) but the word 'Strange' will be missing in the weapon name.

Last edited by PC Gamer; 01-13-2021 at 03:44.
PC Gamer is offline
Reply



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 09:59.


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