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

Solved [TF2] New Weapon with Current Attributes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 03-07-2019 , 16:21   [TF2] New Weapon with Current Attributes
Reply With Quote #1

Hi, I'm trying to find a way of giving a new weapon to a player and having all of the current weapon attributes.
I want to avoid remaking all weapons and their certain attributes, similar to Give Weapon but instead get their up-to-date attributes.
I'm not sure if there is a feature already in TF2Items or TF2Attributes that can do this.
If not, thank you anyways.
__________________

Last edited by Batfoxkid; 03-07-2019 at 16:34. Reason: Added Solved Title
Batfoxkid is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 03-07-2019 , 16:30   Re: [TF2] New Weapon with Current Attributes
Reply With Quote #2

In TF2Items, you can use the PRESERVE_ATTRIBUTES flag.

Alternatively, you can spawn the weapon entity by class, set defindex / initialized / quality / level and use EquipPlayerWeapon (or the EquipWearable SDKCall for shields / boots / &c.) to apply the equipment. For that, you can refer to Give Bots Weapons or my Jungle Inferno Equipment Granter stock functions.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Batfoxkid
Senior Member
Join Date: Nov 2018
Location: ''On the map''
Old 03-07-2019 , 16:34   Re: [TF2] New Weapon with Current Attributes
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
In TF2Items, you can use the PRESERVE_ATTRIBUTES flag.

Alternatively, you can spawn the weapon entity by class, set defindex / initialized / quality / level and use EquipPlayerWeapon (or the EquipWearable SDKCall for shields / boots / &c.) to apply the equipment. For that, you can refer to Give Bots Weapons or my Jungle Inferno Equipment Granter stock functions.
Ah, thank you.
__________________
Batfoxkid 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 22:37.


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