This article's documentation is for anything that uses the Source engine. Click here for more information.

Player weaponstrip: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Pretty sure this entity is almost in every game)
 
(25 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{Entity also in GoldSrc}}
{{LanguageBar}}
{{base point|player_weaponstrip}}  
{{TabsBar|main=gs|base=player_weaponstrip}}
{{Ent not in fgd}}
{{CD|CStripWeapons|file1=player.cpp}}
{{this is a|logical entity|name=player_weaponstrip|sprite=1}}
This entity strips the player of their weapons and/or suit.


==Entity description==
{{bug|hidetested=1|In {{portal|4}} and {{portal2|4}}, the player's weapon will lower and become non-functional, but will not actually disappear. Fixed in {{p2ce|4}}.{{workaround|Fire a DisableDraw input to the <code>viewmodel</code> entity with a slight delay after triggering the weaponstrip. (This does ''not'' prevent later picked up weapons from appearing.)}}}}
This entity strips the player of their weapons and/or suit.
{{bug|tested={{hls}}|If player changes the map after their weapons are stripped, the <code>viewmodel</code> of the last held weapon will appear but will be non-functional. This is fixed by picking up a new weapon. {{not|{{bms}}}}}}


{{bug|This entity does NOT function properly in Portal.{{clarify}} Use [[trigger_weapon_strip]] instead.}}
{{note|In multiplayer, only the <code>!activator</code> is targeted. This means the input needs to be fired as a result of a player interaction, such as touching a trigger or pressing a button. In games with [[VScript]], <code>EntFireByHandle()</code> can instead be used to fire the input with a specific player as the activator.}}


== Keyvalues ==
== Keyvalues ==
Line 11: Line 15:


== Inputs ==
== Inputs ==
{{IO|Strip|Strip player's weapons}}
{{I|Strip|Strip player's weapons.}}
{{IO|StripWeaponsAndSuit|Strip player's weapons and suit
{{I|StripWeaponsAndSuit|Strip player's weapons and suit.}}
{{note|Unless modified, Strip and StripWeaponAndSuit only work if in a single-player game, or where the player fills the role of !Activator. That being said, for multiplayer utilization, consider using a [[trigger_once]] or [[trigger_multiple]] to activate these inputs.}}}}
{{I|StripActiveWeapon|only={{l4d2}}|Removes the active weapon.}}
{{I Targetname}}
{{I|StripWeaponByClassname|only={{l4d2}}|Removes a weapon by classname, eg 'weapon_gascan'.}}
 
== Outputs ==
{{O Targetname}}


==See also==
==See also==
* [[trigger_weapon_strip]] - Similiar brush entity.
* {{ent|trigger_weapon_strip}} - Similiar brush entity.
* {{ent|point_weaponstrip}} - Similiar point entity which strips specified weapon {{only|{{bms}}}}.

Latest revision as of 01:10, 25 July 2025

English (en)中文 (zh)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the Counter-Strike: SourceDay of Defeat: SourceTeam Fortress 2Left 4 DeadCounter-Strike: Global Offensive FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CStripWeapons
CPointEntity
CBaseEntity
C++ player.cpp
Player weaponstrip.png

player_weaponstrip is a logical entity available in all Source Source games.

This entity strips the player of their weapons and/or suit.

Icon-Bug.pngBug:In Portal Portal and Portal 2 Portal 2, the player's weapon will lower and become non-functional, but will not actually disappear. Fixed in Portal 2: Community Edition Portal 2: Community Edition.
PlacementTip.pngWorkaround:Fire a DisableDraw input to the viewmodel entity with a slight delay after triggering the weaponstrip. (This does not prevent later picked up weapons from appearing.)
Icon-Bug.pngBug:If player changes the map after their weapons are stripped, the viewmodel of the last held weapon will appear but will be non-functional. This is fixed by picking up a new weapon. (not in Black Mesa)  (tested in: Half-Life: Source)
Note.pngNote:In multiplayer, only the !activator is targeted. This means the input needs to be fired as a result of a player interaction, such as touching a trigger or pressing a button. In games with VScript, EntFireByHandle() can instead be used to fire the input with a specific player as the activator.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

Strip
Strip player's weapons.
StripWeaponsAndSuit
Strip player's weapons and suit.
StripActiveWeapon  (only in Left 4 Dead 2)
Removes the active weapon.
StripWeaponByClassname  (only in Left 4 Dead 2)
Removes a weapon by classname, eg 'weapon_gascan'.

See also