AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   TF2 Giving weapons to another class (https://forums.alliedmods.net/showthread.php?t=75822)

ThatGuy 08-12-2008 22:31

TF2 Giving weapons to another class
 
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.

DJ Tsunami 08-13-2008 10:42

Re: TF2 Giving weapons to another class
 
No.

DiscoBBQ 08-13-2008 11:31

Re: TF2 Giving weapons to another class
 
It must have been possible at one point by pred:

http://alliedmods.net/~pred/cp_dustbowl0002.jpg

bl4nk 08-13-2008 14:25

Re: TF2 Giving weapons to another class
 
Quote:

Originally Posted by DJ Tsunami (Post 669030)
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.

DJ Tsunami 08-14-2008 09:38

Re: TF2 Giving weapons to another class
 
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.

bl4nk 08-17-2008 13:13

Re: TF2 Giving weapons to another class
 
2 Attachment(s)
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.

curlefry 08-17-2008 13:57

Re: TF2 Giving weapons to another class
 
Hm, I tried to give my Pyro a bat, and the server crashed. :(

/givenameditem [UE]Curlefry tf_weapon_bat

ThatGuy 08-17-2008 20:11

Re: TF2 Giving weapons to another class
 
Thanks for posting it !
I really appreciate it.

Quote:

Originally Posted by bl4nk (Post 671155)

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

bl4nk 08-17-2008 20:34

Re: TF2 Giving weapons to another class
 
The offsets might have changed since I last tested it. I'll check that out later tonight.

Fredd 08-18-2008 05:10

Re: TF2 Giving weapons to another class
 
bl4nk: other solution is to bug pred about those windows signatures for playerclasses ctx files ;]


All times are GMT -4. The time now is 05:30.

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