Raised This Month: $ Target: $400
 0% 

Primary weapon in the secondary weapon slot.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kataan
Member
Join Date: May 2009
Old 07-18-2009 , 06:45   Primary weapon in the secondary weapon slot.
Reply With Quote #1

I would like pyro's to have flamethrower as primary and rocketlauncher as secondary. But only while my plugin is enabled, so when it is disabled it returns to the normal configuration.

I tried altering the code found on the giving weapons to another class thread (http://forums.alliedmods.net/showthr...=75822&page=12) but i did not have any luck as it tries to assign both weapons to the primary slot. Having two weapons works as long as they dont have the same weapon slot (which is no good for me.)

I then tried making my own tf_weapon_rocketlauncher_secondary.ctx but it couldnt be read (i restarted the server) so i'm assuming i can only edit the defaut ones such as tf_weapon_rocketlauncher.ctx, but i dont want this as i want to be able to return to the normal set up when i disable the plugin.

Or do I need to add my tf_weapon_rocketlauncher_secondary.ctx to a weapon list somewhere?

I'm stumped.
Any Ideas?

Thank you in advance.

-Kataan

Last edited by Kataan; 07-18-2009 at 07:06.
Kataan is offline
necrosect
Senior Member
Join Date: Jun 2008
Old 07-19-2009 , 09:06   Re: Primary weapon in the secondary weapon slot.
Reply With Quote #2

I think there's a long running problem with equipping weapons to classes (although it can be done) in tf2. It used to be easier I think but recently give_nameditem was broken.
necrosect is offline
Kataan
Member
Join Date: May 2009
Old 07-19-2009 , 21:09   Re: Primary weapon in the secondary weapon slot.
Reply With Quote #3

I am currently able to use the givenameditem to equip weapons, but the issue seems to be that you can not assign 2 items of the same slot type. If the flamethrower was primary (which it is), and the rocketlauncher was secondary, then it would not be a problem to equip both at the same time. As it is can equip any other combination of primary, secondary and melee. Just as long as each is the only thing in the slot.
Kataan is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-29-2009 , 16:58   Re: Primary weapon in the secondary weapon slot.
Reply With Quote #4

Yea, we need to be able to equip it to a specific slot.
Dragonshadow is offline
pRED*
Join Date: Dec 2006
Old 07-29-2009 , 17:05   Re: Primary weapon in the secondary weapon slot.
Reply With Quote #5

I'd assume the code for a specific weapon defines what slot it goes to.

This isn't something that could be done from SourcePawn, it would need an extensions.

291 CBaseCombatWeapon::GetSlot(void)const
292 CBaseCombatWeapon::GetPosition(void)const

Hooking those would be my best guess.
pRED* 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 04:16.


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