This article was converted from a previous version of TWHL and may need to be reviewed
- The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
- Some information may be out of date
- After the article is re-formatted and updated, remove this notice and the Review Required category.
- Some older tutorials are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
Stripping and Equipping Weapons in Counter-Strike
Resources Required: Up to date
FGD, found
here.
Introduction
The premise is simple: to equip weapons at the start of a round or by trigger later in the round and to make sure they can only use those weapons if you so desire. Actually putting this concept into a playable level involves some minor entity work, so if you are unfamiliar with the
multi_manager
,
game_playerequip
,
player_weaponstrip
, and the
info_map_parameters
, then read the brief description's below.
Note: Tutorials covering and full descriptions of all these entities can be found on this site, and require virtually no hunting, and limited knowledge of HL to understand their principles and properties.multi_manager`: An entity that allows you to trigger multiple events/entities after a single previous event has taken place. For example, the door opens, triggers the `multi_manager
, the
multi_manager
triggers an alarm (
ambient_generic
), and a flashing light, then after 10 seconds it triggers another 'multi_manager' to turn everything off again.
game_player_equip`: The entity used to equip the player with the weapons you require. For example, the player runs through a trigger, which runs the `game_player_equip
which "gives" the player ammo, Kevlar, grenades or a gun.
`player_weaponstrip`: The player runs through a trigger, targeting this entity, removing all weapons/items currently in the player's possession.
`info_map_parameters`: An entity which allows you to set certain parameters within the map, such as weapon buying, and bomb blast radius etc. Quite a limited entity and only mentioned here as an example of different methods of achieving the same goal.
Making a Map Where Everyone Gets the Same Equipment
First things first, make your map, if you're just testing out the entity setup it can be a big open room. If not, please put some effort into it.
game_player_equip
is typically used for fy, aim, and knife maps. However, just because you want to give players certain weapons doesn't mean the map must be of the fy_ strain, you could be making an escape style map, where the CTs start in a jail, and are only equipped with a knife and Glock (or whatever takes your fancy). Perhaps a scout map set in a "forest", with two bases, separated by a canyon. The possibilities are endless.
If you are equipping everyone on the map with the same weapons, all you need is a
game_player_equip
in the map. Choose what you wish to equip in the entity, make sure the "use only" flag is
NOT ticked, click apply, and it's all set. If you have the latest FGD installed then all the keyvalues will be very clearly labeled. Note that merely having a
game_player_equip
present on the map will cause all players to spawn with nothing (except for the bomb if there are bomb targets). This is true even if the "use only" flag is ticked. So if you have a
game_player_equip
on the map, make sure you give back the knife unless you specifically wanted to take it away.
An example map might be an M3/Deagle map. You'll want to equip the M3, the Deagle, an appropriate amount of ammo for each gun, and the players knife unless you want to take it away from them. You could optionally equip other items like kevlar and grenades. To do this, set the following keyvalues in the
game_player_equip
entity. For ease of making this table, the keyvalues used will be the actual keyvalues you see with smart edit turned off and only the keyvalues that need to be changed will be shown. As stated before, if you have the latest FGD, smart edit will have all the keyvalues you need with helpful labels. With an older FGD, you may have to add the keyvalues yourself with smart edit turned off.
Property Name | Value |
---|
weapon_knife | 1 |
weapon_deagle | 1 |
weapon_m3 | 1 |
ammo_50ae | 2 |
ammo_buckshot | 4 |
item_kevlar | 1 |
weapon_hegrenade | 1 |
Now every player will be equipped with those items on the start of each round. There's still one more thing to do.
Prevent Players from Buying
There are two ways to do this. One is to make a small cube out of a trigger texture out of reach of the players. Turn it into a
func_buyzone
and now buyzones will no longer be created near spawn points. Leaving the buyzone unassigned will prevent this for both teams.
The second option is to put an
info_map_parameters
entity in your map and choose to prevent both teams from buying.
I prefer using both these methods at once to both get rid of the buyzone icon in spawn and allow the message to players that they aren't allowed to buy to appear when they press the buy button or any other buy binds.
Congratulations, you now have a working m3/deagle map!
The Desert Eagle
Another Effect
An interesting principal for giving the player a weapon at a certain point in a map. This could be a Deagle/USP/M4A1/etc. The theory is the same, just change the variables like the weapon names and ammo etc.
This particular set up is for a locker that contains an AK47 that is supposedly picked up by the player:
Make your locker, with a door etc. Right behind the door (don't have it in any way poking through the door) create a
trigger_once and in its
Target line enter
akmm.
Now place a
cycler_sprite inside the locker; this will be the most awkward task. In the sprite line enter
models/ak47.mdl. Now you have the gun lying on the floor of the locker. You could try tweaking the
Pitch,
Yaw and
Roll in the
cycler_sprite's properties to position the model how you want it.
Name the
cycler_sprite akd.
Right next to the locker (it could be all the way across the map, but for tidiness put it next to the locker) place a
multi_manager. Open it up and name it
akmm, turn off Smart Edit, click on add, and enter this:
Key:
akd (short for AK Disappear)
Value:
0.1 (this is 0.1 seconds, adjust it as neccesary)
Add again, and then:
Key:
akg (short for AK Give)
Value:
0.1Place a
env_render entity, name it
akd, open its properties and set its
Render Mode to
Solid and its
FX Amount to
1.
Place a
game_playerequip, open it up and name it
akgScroll down through its list of guns and select
ak47Turn off Smart Edit and click add:
Key:
ammo_762natoValue:
4 (gives four clips)
Other Uses
There are several things that you can do to make this entity set-up more interesting: you could make a Quake-like level using a
func_rotating
in conjunction with some home-made textures (a picture of a CS gun of your choice on a
{BLUE background for instance), and use
env_render
entities and
multi_manager
entities to trigger the disappearance of the
func_rotating
and to equip the player with the gun on the picture.
You could have a metal detector or security scanner device type thingy that when walked through, sets off an alarm and strips the player of all their weapons. However, avoid leaving a player with no weapons, as this makes for a pretty tedious game of CS.
The Armoury Entity
The
armoury_entity
allows you to put weapons on the ground to be picked up. Not all weapons are available for this entity, including pistols. Make sure you do not put this entity inside the ground or inside a player spawn. They usually have a decent amount of ammo but are not maxed out. You can change the quantity of weapons available in a single
armoury_entity
.
Weapon and Ammo Glossary
- weapon_usp (USP45)
- weapon_glock18 (Glock 18)
- weapon_deagle (Desert Eagle)
- weapon_p228 (P228)
- weapon_elite (Beretta Elites)
- weapon_fiveseven (Five-Seven)
- weapon_m3 (Benelli M3)
- weapon_xm1014 (Benelli XM1014)
- weapon_mp5navy (MP5/Navy)
- weapon_tmp (TMP)
- weapon_p90 (FN P90)
- weapon_mac10 (Mac-10)
- weapon_ump45 (UMP45)
- weapon_ak47 (AK47)
- weapon_sg552 (SG552)
- weapon_m4a1 (M4A1)
- weapon_aug (Aug)
- weapon_scout (Scout)
- weapon_awp (AWP)
- weapon_g3sg1 (G3/SG-1)
- weapon_sg550 (SG550)
- weapon_m249 (M249)
- item_kevlar (Kevlar)
- item_assaultsuit (Kevlar + Ballistic Helmet)
- weapon_flashbang (Flash Bang)
- weapon_hegrenade (High-Explosive Grenade)
- weapon_smokegrenade (Smoke Grenade)
- item_thighpack (Defuse Kit)
- weapon_c4 (C4 Plastique Bomb, don't use this, it doesn't spawn a "real" bomb)
- item_healthkit (give the player health in increments)
- 1 = 15hp
- 2 = 30hp
- 3 = 45hp
- 4 = 60hp
- 5 = 75hp
- 6 = 90hp
- 7 = 100hp
- item_battery (give the player kevlar armor in increments)
- 1 = 15pts
- 2 = 30pts
- 3 = 45pts
- 4 = 60pts
- 5 = 75pts
- 6 = 90pts
- 7 = 100pts
- item_longjump (HL Long Jump module, I don't know if this actually will work in CS, also, if it's like the longjump in HL, you won't be able to strip it)
USE weapon_hegrenade
USE weapon_hegrenade