Snarkpit Articles

Placing weapons with ammo

How to place weapons with ammo in CS:S
This tutorial will explain how to place weapons with more then 1 clip of ammo including the one in your weapon already for Counter-Strike Source.

First lets place a game_player_equip. This can be any location in your map as players won't see or bump into it. It needs to be inside you map somewhere though. Now open its properties. You can do this by holding Alt and hitting Enter. Set the name to something unique. I choose equip_tmp seeing as I am going to place a TMP in my map.

Article image


Next click on the SmartEdit button. Then click on the Add button. In this window enter the name of the ammo you want for key. I choose ammo_9mm for the TMP. The next spot is the value. Here is where you enter the number of clips you want the player to get when he/she picks up the gun. I entered 2. Then you click Ok. Next click on the Flags tab and check the Use Only checkbox. Now click Apply.

Article image


The next step is to place the actual weapon. For the TMP I placed the entity weapon_tmp. Once it is placed and positioned how you want it go to its properties by again holding Alt and hitting Enter. Click on the Outputs tab and then the Add button. Set My output named to OnPlayerPickup and Target entities named to the name you choose for the game_player_equip. It should be in the dropdown already. In my case it was equip_tmp. Click the Fire only one check box. Now click Apply and close the window.

Article image


Note: You will have to place another game_player_equip that gives everyone the standard weapons when they spawn or they will spawn with nothing. Once you place it (anywhere in your map) click the SmartEdit button and then click Add. Enter the following:

weapon_knife 1
weapon_usp 1
ammo_45acp 1
item_kevlar 1

Compile the map and it should work.

Discussion

Posted by elegyoficaros on Thu Oct 12th 2006 at 6:04pm

Posted by Addicted to Morphine on Mon Jun 26th 2006 at 8:13am

Sparky, could you update your tutorial with a list of all the weapons and the ammo types needed for the game_player_equips? I think that would be very helpful!
Posted by Sparky911 on Tue May 16th 2006 at 12:44pm
[Author]

How so?
Posted by Forceflow on Sun May 14th 2006 at 9:50pm

Not much of a tutorial, but certainly a handy tip.
Posted by Sparky911 on Thu Apr 20th 2006 at 2:54am
[Author]

Mainly used for fy maps but very useful :)
Posted by Orpheus on Thu Apr 20th 2006 at 1:42am

I have no idea how useful this tutorial is since I do not play CS but, you obviously felt the need to post it so I feel compelled to return the favor.

(Thanx for keeping the images down)