View Single Post
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, 1534 views)
File Type: sp Get Plugin or Get Source (givenameditem.sp - 2098 views - 4.1 KB)
bl4nk is offline