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

[TF2] Changing attributtes on primary weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-10-2014 , 18:45   Re: [TF2] Changing attributtes on primary weapons
Reply With Quote #11

Quote:
Originally Posted by Dr. Greg House View Post
I know I've seen the code.
You haven't used the "increase/decrease primary max ammo"-attribute on the player there.
Yes, but if it wasn't updating ammo when you apply the attribute on the weapon until you regenerate the player, why would applying it to the player be any different?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 07-10-2014 , 20:00   Re: [TF2] Changing attributtes on primary weapons
Reply With Quote #12

It worked for me when I equipped players with weapons from different classes.
I'm too busy to go into the details but basically what I did was apply the "primary max ammo" attribute to the player.

EDIT: I looked up what exactly I did back then:

Quote:
new ammoType = GetEntProp(primaryWeapon, Prop_Send, "m_iPrimaryAmmoType");

SetEntProp(clientID, Prop_Send, "m_iAmmo", 200, _, ammoType);
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 07-10-2014 at 20:01.
Dr. Greg House is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 07-11-2014 , 05:00   Re: [TF2] Changing attributtes on primary weapons
Reply With Quote #13

Quote:
Originally Posted by Powerlord View Post
Unless you have some way of checking the item slot in TF2Items_OnGiveNamedItem, calling a timer/RequestFrame is a waste of resources, especially when you consider that TF2Items will be called for every item in your loadout (which may includes taunts these days, which would mean it'd get called up to 18 times).
Good point, although I'm pretty sure taunts aren't included anymore...still, I guess 10 times wouldn't be ideal
Quote:
Originally Posted by ShowTeKPT View Post
And also there is way of getting the classname of the weapon and preserving the attributes that the weapon already have?
Ex: "tf_weapon_scattergun"
TF2Attributes, if that's not what you're already using, won't touch the attributes that the weapon comes with (unless you want it to)
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP 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 11:54.


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