Ads keep us online. Without them, we wouldn't exist. We don't have
paywalls or sell mods - we never will. But every month we have large bills
and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3
The following tutorial will allow you to strip weapons from every player in the map using triggers and other entities.
As a reference to how this tutorial will work out in a map, you can check out a map I created called "melee_ringking" which uses the techniques explained here. http://www.fpsbanana.com/maps/38943.
During this tutorial I am going to assume you know how to create brushes, brush entities, point entities, and have at least intermediate experience mapping. If at any time you can not find an entity I suggest uploading the HL2.fgd into Hammer along with the TF2.fgd.
1. Create a room and the point entity "info\_player\_teamspawn" anywhere in the room (for testing purposes).
2. Create the point entity "point\_servercommand" and place it somewhere in your map. (The weapons of all players will be stripped using server commands like you would type in a console).
3. Edit the properties of "point\_servercommand" and set its Name to something you can refer to later. I named mine "servercommand".
4. Create the brush entity "trigger\_multiple" and place where you want the weapon stripping to happen. (I placed mine over the entire map)
5. Edit the properties of "trigger\_multiple" and change the value "Delay before Reset" to a very low value such as zero or 0.001.
6. Click the [Outputs] tab inside the trigger_multiple window.
7. Then you should edit the outputs so it looks something like what is shown in Screenshot 1.
The reason for more than 1 output is because there is a character limit for each line so they must be separated into 4 or more (depending on how many commands you have) different parts in order to fit every command in there. Be sure to add a 0.01 delay increase between each line so that the trigger knows in which order to trigger the actions. The first command in the list of commands should always be sv\_cheats 1 and the last command should be sv\_cheats 0 if you are using commands that require cheats. Cheats is required in order for the server to strip the weapons from every player. Remember that each command is separated by a ; as can be seen in the screenshot.
The list of all TF2 weapons can be found in the SCRIPTS subfolder of the TF folder inside the team fortress 2 content.gcf, as shown in Screenshot 2. (this can be found using GCFScape)
Compile, add lights and stuff, then test. :)
Using this technique you can strip any weapons you want to whatever degree you want. You could also add in more commands to suit your interests which adds a lot of versatility to what you can accomplish with Hammer.
PLEASE NOTE: This is just a technique and may not be the best way to perform this sort of task. If anyone would like to share their ideas of alternative ways of stripping weapons feel free to leave a message. I will also help with any questions I get regarding this tutorial :)
Here is an idea.
Onteamswon1/sv_cheats 1; noclip; sv_cheats 0;
Onteamswon2/sv_cheats 1; noclip; sv_cheats 0;
You could also have everyone use the kill commaned every time their is a cap to force everyone to start at the new reasoned.
With a good imagination anything could be possible.
Nice tute there, its is very relevant for a map I've got on the go atm.
I suggest putting in a point_clientcommand which is set to run "slot3" on the client, which changes to melee weapon.
One question i have is whether the users get their guns back when they respawn, and could you make a prefab of this, it would make it easier to implement.
I have followed you Tut to the letter. But have a big problem.
I have it set up that you are ported to a cage suspended in the middle of the room. when you are teleported to the cage the weapon does not vanish it just stops working and the only option you have for a weapon to change to is the melee weapon. ( not what I wanted but close enough).
The REAL problem is that when you get ported into the cage. the scree/map/enviroment goes black like looking at a negitive. and if you go outside of the trigger brush there is no light.
Fps_THEPWNER, Thank you brother, Hey would you be willing to let me decompile your map to check out your script? I would like to make a cp defence map tiered into multiple sections only allowing certain class and weapons for each tier. Dude, check out interlopers.net. You might get a kick out of the content for tf2 mapping there. Jive