Difference between revisions of "Give"

From Valve Developer Community
Jump to: navigation, search
(adding ent_create at the bottom)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{wrongtitle|title=give}}
+
'''<code>give</code>''' is a console command that gives the player (or, rather, spawns beneath their feet) any specified entity.
  
To use the "Give" command, you must have sv_cheats set to 1.<br>
+
This command requires <code>[[sv_cheats]] 1</code> in some games. Valve did not mark this as a cheat in Portal 2, and it allows for some very clever uses in challenge mode.
"Give" gives you an entity (or, rather, spawns that entity beneath your feet.)<br>
 
"Give" commands are used in this way: give [entity name here.]<BR>
 
To spawn a Weapon: give [weapon name here.]<br><br>
 
The Weapon names for Counter-Strike Source are:<br>
 
'''Rifles'''
 
  
weapon_m4a1 (M4A1)<br>
+
{{note|Some entities will not work properly with this command because they need to be set up through Hammer.}}
weapon_p90 (P90 or C90(Thats copyright)<br>
 
weapon_ak47 (AK47 or Cv47)<br>
 
weapon_aug (Bullpup)<br>
 
weapon_g3sg1 (G3SG1)<br>
 
weapon_m249 (M249)<br>
 
weapon_m3 (M3 Shotgun)<br>
 
weapon_mac10 (Mac10)<br>
 
weapon_mp5navy (MP5)<br>
 
weapon_sg552 (SG552)<br>
 
weapon_scout (Scout Sniper)<br>
 
weapon_sg550 (SG550)<br>
 
weapon_ump45 (UMP)<br>
 
weapon_tmp (TMP)<br>
 
weapon_xm1014 (Auto Shotgun)<br>
 
weapon_awp (Heavy Snipe)<br>
 
weapon_galil (IDF Defender)<br>
 
weapon_famas (Famas)<br>
 
<br>'''Pistols'''<br>
 
  
weapon_deagle (Desert Eagle)<br>
+
{{tip|Using a {{ent|point_servercommand}} entity to <code>give</code> the player something, is usually more reliable than the <code>[[point_template]] ForceSpawn</code> seen in the [[Newgame_spawn]] [[prefab]], because the <code>give</code> command is not bound to a physical place, whereas the <code>point_template</code> will dump entities at the original spawnpoint when {{ent|buildcubemaps}} is fired.{{confirm|This just sounds a little weird?}}}}
weapon_usp (USP)<br>
 
weapon_glock (Glock)<br>
 
weapon_p228 (P228)<br>
 
weapon_elite (Dual Elites)<br>
 
weapon_fiveseven (FiveSeven)<br><br>
 
  
{{CCExample|In Counter-Strike Source, this equips you with a shotgun: |give [[weapon_m3]]}}
+
==Syntax==
 +
<pre>give ENTITY</pre>
  
{{CCExample|In Half-Life 2, this equips you with a shotgun: |give [[weapon_shotgun]]}}
+
In Half-Life 2, <code>give [[weapon_rpg]]</code> will spawn a rocket launcher under the player (which they will usually immediately pick up).
  
[[Category:Console Commands]]
+
==See Also==
 +
*{{ent|ent_create}}, a command like <code>give</code>, but things spawn where the player is looking.
 +
*[[:Category:Weapons]] - A list of [[Half-Life 2]] weapons.
 +
*[[:Category:Items]] - A list of [[Half-Life 2]] items and ammo.
 +
*[[:Category:Counter-Strike:_Source_Entities]] - A list of mostly [[Counter-Strike: Source]] weapons and ammo.
 +
 
 +
[[Category: Console Commands]]

Latest revision as of 13:26, 14 July 2018

give is a console command that gives the player (or, rather, spawns beneath their feet) any specified entity.

This command requires sv_cheats 1 in some games. Valve did not mark this as a cheat in Portal 2, and it allows for some very clever uses in challenge mode.

Note:Some entities will not work properly with this command because they need to be set up through Hammer.
Tip:Using a point_servercommand entity to give the player something, is usually more reliable than the point_template ForceSpawn seen in the Newgame_spawn prefab, because the give command is not bound to a physical place, whereas the point_template will dump entities at the original spawnpoint when buildcubemaps is fired.
Confirm:This just sounds a little weird?

Syntax

give ENTITY

In Half-Life 2, give weapon_rpg will spawn a rocket launcher under the player (which they will usually immediately pick up).

See Also