Scripted Weapons (SWEPs) in your map
From GMod Wiki
Go to: Mapping Entities |
Mapping: SWEPs Placing |
Description: | How to place Scripted Weapons |
Original Author: | Cuel |
Created: | 25th April 2007 |
Introduction
In this tutorial you will be shown how to place Scripted Weapons from Garry's-mod into your map.
Placing Counter-Strike: Source SWEPs
We will start with CS: S SWEPs, since they seem to work in most gamemodes.
- Place any entity in hammer (not brushed based ones), where you want your weapon.
- Select your entity and bring up properties (Alt + Enter)
- In the Class field (name of the entity) type the name of your weapon (See list).
These are the current CS: S SWEPs
weapon_ak47
weapon_deagle
weapon_fiveseven
weapon_glock
weapon_m4
weapon_mac10
weapon_mp5
weapon_para
weapon_pumpshotgun
weapon_tmp
Hit Apply and run your map.
Other SWEPs
This method might not always work, and you mostly need your gamemode loaded for the SWEPs to work. If, they are in a gamemode of course.
Note: GMDM weapons will NOT work with this method. Check the example map to see how to place GMDM weapons.
The reason that this method might not always work is because sometimes the SWEPs might not have a world model, or they have another entity name then you type or some other error.
For this example, I will use LightRP version 1 gamemode.
- First, we will set LightRP gamemode as default.
- After you've set gamemode to LightRP, place any entity (not a brushed-based one), where you want your weapon.
- Go to <steamdir>garrysmod\garrysmod\gamemodes\LightRP\entities\weapons where we will find the SWEPs. As you can see, the folders are named;
arrest_stick, door_ram, keys, stools and stunstick.
I've tested arrest_stick and door_ram, they both worked. the keys did however not.
The name of the folders are the names we will type in hammer.
- Select the entity and bring up properties (Alt + Enter ).
- In the Class field (name of the entity) type your weapon name. (See Image)
- Compile and run your map!