Raised This Month: $51 Target: $400
 12% 

Solved [TF2] Item quality text not appearing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 11-18-2018 , 21:28   [TF2] Item quality text not appearing
Reply With Quote #1

I'm currently editing a script that gives bots weapons but when I set the quality for an item the item only changes the text color of the item.
For example changing the Lugermorph quality to Vintage only shows the Lugermorph in blue color instead of having Vintage Lugermorph all in blue.

Is there a way that I can fix that, if yes then how?

Last edited by manicogaming; 11-04-2020 at 14:49.
manicogaming is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-19-2018 , 11:04   Re: [TF2] Item quality text not appearing
Reply With Quote #2

If you are using TF2Items, TF2Items can't change weapon name, it can just change the quality
__________________
Whai is offline
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 11-19-2018 , 12:59   Re: [TF2] Item quality text not appearing
Reply With Quote #3

Quote:
Originally Posted by Whai View Post
If you are using TF2Items, TF2Items can't change weapon name, it can just change the quality
No I'm not using TF2Items.
The plugin that I am editing is this one:
https://forums.alliedmods.net/showthread.php?t=287668
manicogaming is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-19-2018 , 13:07   Re: [TF2] Item quality text not appearing
Reply With Quote #4

Well, I don't think you can rename a weapon but when I take a look on datamaps I can see :

Code:
CTFWeaponBase - tf_weapon_base
- CTFWeaponBaseFallThink (Offset 0) (FunctionTable)(0 Bytes)
- m_flNextPrimaryAttack (Offset 1444) (Save)(4 Bytes)
- m_flNextSecondaryAttack (Offset 1448) (Save)(4 Bytes)
- m_flTimeWeaponIdle (Offset 1452) (Save)(4 Bytes)
- m_bInReload (Offset 1456) (Save)(1 Bytes)
- m_bFireOnEmpty (Offset 1457) (Save)(1 Bytes)
- m_hOwner (Offset 1424) (Save)(4 Bytes)
- m_iState (Offset 1496) (Save)(4 Bytes)
- m_iszName (Offset 1500) (Save)(4 Bytes)
- m_iPrimaryAmmoType (Offset 1504) (Save)(4 Bytes)
- m_iSecondaryAmmoType (Offset 1508) (Save)(4 Bytes)
- m_iClip1 (Offset 1512) (Save)(4 Bytes)
- m_iClip2 (Offset 1516) (Save)(4 Bytes)
...
So maybe you can rename the weapon
__________________
Whai is offline
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 11-19-2018 , 14:36   Re: [TF2] Item quality text not appearing
Reply With Quote #5

Quote:
Originally Posted by Whai View Post
Well, I don't think you can rename a weapon but when I take a look on datamaps I can see :

Code:
CTFWeaponBase - tf_weapon_base
- CTFWeaponBaseFallThink (Offset 0) (FunctionTable)(0 Bytes)
- m_flNextPrimaryAttack (Offset 1444) (Save)(4 Bytes)
- m_flNextSecondaryAttack (Offset 1448) (Save)(4 Bytes)
- m_flTimeWeaponIdle (Offset 1452) (Save)(4 Bytes)
- m_bInReload (Offset 1456) (Save)(1 Bytes)
- m_bFireOnEmpty (Offset 1457) (Save)(1 Bytes)
- m_hOwner (Offset 1424) (Save)(4 Bytes)
- m_iState (Offset 1496) (Save)(4 Bytes)
- m_iszName (Offset 1500) (Save)(4 Bytes)
- m_iPrimaryAmmoType (Offset 1504) (Save)(4 Bytes)
- m_iSecondaryAmmoType (Offset 1508) (Save)(4 Bytes)
- m_iClip1 (Offset 1512) (Save)(4 Bytes)
- m_iClip2 (Offset 1516) (Save)(4 Bytes)
...
So maybe you can rename the weapon
I tried it and when compiling it gave me an error:
error 035: argument type mismatch (argument 3)
manicogaming is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-19-2018 , 14:38   Re: [TF2] Item quality text not appearing
Reply With Quote #6

did you use
Code:
SetEntPropString
__________________
Whai is offline
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 11-19-2018 , 14:42   Re: [TF2] Item quality text not appearing
Reply With Quote #7

Quote:
Originally Posted by Whai View Post
did you use
Code:
SetEntPropString
Sorry but I don't know much about SourcePawn I just edit some basic functions of plguins sometimes.
In this code where should I add that?

Code:
bool CreateWeapon(int client, char[] classname, int itemindex, int quality, int level = 0)
{
	int weapon = CreateEntityByName(classname);
	
	if (!IsValidEntity(weapon))
	{
		return false;
	}
	
	char entclass[64];
	GetEntityNetClass(weapon, entclass, sizeof(entclass));
	SetEntData(weapon, FindSendPropInfo(entclass, "m_iItemDefinitionIndex"), itemindex);	 
	SetEntData(weapon, FindSendPropInfo(entclass, "m_bInitialized"), 1);
	SetEntData(weapon, FindSendPropInfo(entclass, "m_iEntityQuality"), quality);

	if (level)
	{
		SetEntData(weapon, FindSendPropInfo(entclass, "m_iEntityLevel"), level);
	}
	else
	{
		SetEntData(weapon, FindSendPropInfo(entclass, "m_iEntityLevel"), GetRandomUInt(1,99));
	}

	switch (itemindex)
	{
		case 810:
		{
			SetEntData(weapon, FindSendPropInfo(entclass, "m_iObjectType"), 3);
		}
		case 998:
		{
			SetEntData(weapon, FindSendPropInfo(entclass, "m_nChargeResistType"), GetRandomUInt(0,2));
		}
	}
	
	DispatchSpawn(weapon);
	SDKCall(g_hWeaponEquip, client, weapon);
	return true;
}
manicogaming is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-19-2018 , 16:15   Re: [TF2] Item quality text not appearing
Reply With Quote #8

After some test, I can’t set the name of the weapon so I think it’s impossible to change name
__________________
Whai is offline
manicogaming
AlliedModders Donor
Join Date: Aug 2014
Old 11-19-2018 , 16:59   Re: [TF2] Item quality text not appearing
Reply With Quote #9

Quote:
Originally Posted by Whai View Post
After some test, I can’t set the name of the weapon so I think it’s impossible to change name
Ohh, but Thanks for your help.
manicogaming is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-19-2018 , 21:59   Re: [TF2] Item quality text not appearing
Reply With Quote #10

Quote:
Originally Posted by manicogmaing View Post
I tried it and when compiling it gave me an error:
error 035: argument type mismatch (argument 3)
Datadesc vars are not inherently networked. While you can look them up to change them, no one else (including yourself in some cases) would see the change unless the var is also in the send table.
psychonic 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 06:54.


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