Raised This Month: $106 Target: $400
 26% 

[TF2] Item quality text not appearing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
manicogmaing
Member
Join Date: Aug 2014
Old 11-18-2018 , 22: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?
manicogmaing is online now
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 11-19-2018 , 12: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
manicogmaing
Member
Join Date: Aug 2014
Old 11-19-2018 , 13: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
manicogmaing is online now
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 11-19-2018 , 14: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
manicogmaing
Member
Join Date: Aug 2014
Old 11-19-2018 , 15: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)
manicogmaing is online now
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 11-19-2018 , 15:38   Re: [TF2] Item quality text not appearing
Reply With Quote #6

did you use
Code:
SetEntPropString
__________________
Whai is offline
manicogmaing
Member
Join Date: Aug 2014
Old 11-19-2018 , 15: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;
}
manicogmaing is online now
Whai
Member
Join Date: Jul 2018
Location: In Hell
Old 11-19-2018 , 17: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
manicogmaing
Member
Join Date: Aug 2014
Old 11-19-2018 , 17: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.
manicogmaing is online now
psychonic

BAFFLED
Join Date: May 2008
Old 11-19-2018 , 22: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


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 14:47.


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