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

TF2 Giving weapons to another class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThatGuy
Senior Member
Join Date: Nov 2007
Old 08-12-2008 , 22:31   TF2 Giving weapons to another class
Reply With Quote #1

Is it possible to give one class another weapon? for example, giving the scout a rocket launcher or something.

If so, would someone please give me an example of how to do it, you dont have to build a plugin just to show, just a small example ? Sorry if its a noob question, but thanks.
__________________
ThatGuy is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-13-2008 , 10:42   Re: TF2 Giving weapons to another class
Reply With Quote #2

No.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
DiscoBBQ
Veteran Member
Join Date: Jan 2005
Location: Clemson, South Carolina
Old 08-13-2008 , 11:31   Re: TF2 Giving weapons to another class
Reply With Quote #3

It must have been possible at one point by pred:

__________________
"Every man is guilty of all the good he did not do"
DiscoBBQ is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-13-2008 , 14:25   Re: TF2 Giving weapons to another class
Reply With Quote #4

Quote:
Originally Posted by DJ Tsunami View Post
No.
Actually, this is incorrect. I figured out a way to do it again (with a little help from DS and pRED). I'll put something together in a little bit for you guys to use.
bl4nk is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-14-2008 , 09:38   Re: TF2 Giving weapons to another class
Reply With Quote #5

Err, that's just the skin. They have the weapons that belong to their class, but not the skin that belongs to their class, because they haven't properly respawned.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-17-2008 , 13:13   Re: TF2 Giving weapons to another class
Reply With Quote #6

Here's what I wrote up a few days ago. It gives a good example of how to do it properly, but there are still a few bugs with the weapon scripts that need to be worked out before it will work 100%.

Things to note:
Weapons that you equip inherit the values of the original weapon that was in that slot. Say you're a scout and you give yourself a rocketlauncher. The rocketlauncher would have 6 shots per clip, and 32 extra rockets because of the scattergun.

Also, if you look at the plugin, I made a trie for every weapon. I use that trie to determine the slot each weapon or item is located in. I do this because if you don't strip that slot and then equip the weapon, the client will have use the "use" command (ex. "use tf_weapon_rocketlauncher") to pull the weapon out.

That's about all I have to say right now. I'm going to head out for the rest of the day. If I think of something else while I was out, I'll try posting it later.
Attached Files
File Type: txt givenameditem.games.txt (195 Bytes, 1526 views)
File Type: sp Get Plugin or Get Source (givenameditem.sp - 2089 views - 4.1 KB)
bl4nk is offline
curlefry
Senior Member
Join Date: Jun 2008
Location: Georgia, USA
Old 08-17-2008 , 13:57   Re: TF2 Giving weapons to another class
Reply With Quote #7

Hm, I tried to give my Pyro a bat, and the server crashed.

/givenameditem [UE]Curlefry tf_weapon_bat
__________________
curlefry is offline
Send a message via MSN to curlefry
ThatGuy
Senior Member
Join Date: Nov 2007
Old 08-17-2008 , 20:11   Re: TF2 Giving weapons to another class
Reply With Quote #8

Thanks for posting it !
I really appreciate it.

Quote:
Originally Posted by bl4nk View Post

Things to note:
Weapons that you equip inherit the values of the original weapon that was in that slot. Say you're a scout and you give yourself a rocketlauncher. The rocketlauncher would have 6 shots per clip, and 32 extra rockets because of the scattergun.

Ah not a problem, I could just change their ammo clip/size after i give them the weapon, right? Then again they could just refill it back up from the cabinet..

Edit: So far every weapon i've tried giving has crashed the server haha
__________________

Last edited by ThatGuy; 08-17-2008 at 20:22.
ThatGuy is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-17-2008 , 20:34   Re: TF2 Giving weapons to another class
Reply With Quote #9

The offsets might have changed since I last tested it. I'll check that out later tonight.
bl4nk is offline
Fredd
Veteran Member
Join Date: Jul 2007
Old 08-18-2008 , 05:10   Re: TF2 Giving weapons to another class
Reply With Quote #10

bl4nk: other solution is to bug pred about those windows signatures for playerclasses ctx files ;]
__________________
Need a private coder? AMXX, SourceMOD, MMS? PM me!
Fredd 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 18:08.


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