player

From Source Entities
Jump to navigation Jump to search
Info.png

This entity is not in the stock FGD files by default.
It should not be placed (in Hammer) because this usually will crash the game.

Code classes:

player is a point entity present in all Source games. This entity represents the player(s) in every Source game.

Important: Make sure to never remove a player entity by any means. The associated player will not be able to do anything and will likely crash.

Note: L4d.pngL4d2-small.pngThe special infected are also players (except for witches). This decision could have been made to streamline coding for Versus mode. For common infected, see infected. To detect a certain special infected, use filter_activator_infected_class.

Note: Asw.pngThe player entity actually sends all its player input to an asw_marine entity which represents the actual characters in the game, like a puppet. This might have something to do with the fact that players can switch characters mid-game.

Note: In multiple games, ent_text will report that your player targetname matches your Steam username. This is not actually happening (it would be very easy to exploit).

Note: Csgo-small.pngBots are considered cs_bots by some parts of code, but are considered players by other parts.

Note: Parenting objects to a player tends to result in odd movement. logic_measure_movement is a good workaround.

Inputs[edit | edit source]

SetHealth <integer>
Sets the player's Health (health).
SetHUDVisibility <boolean>
Sets if the HUD is visible or not.
SetFogController <target_destination>
Makes this player use fog settings from a specified env_fog_controller.
HandleMapEvent <string> (only available in Hl2.pngCss.pngDods.pngTf2.png)
To do: Description. Not in the 2013 SDK.
IgnoreFallDamage <float> (only available in Hl2.pngP1.pngL4d2-small.png)
Makes the player immune to fall damage for the specified number of seconds. If they fall from a height that would normally cause fall damage, they will become vulnerable to fall damage immediately after it.
IgnoreFallDamageWithoutReset <float> (only available in Hl2.pngP1.pngL4d2-small.png)
Makes the player immune to absolutely all fall damage for the specified number of seconds.
OnSquadMemberKilled  (only available in Hl2.pngP1.png)
Tells the player that a squad member has died. Their associated HUD element will get removed. This is not an output.[Confirmed]
DisableFlashlight  (only available in Hl2.pngP1.png)
Turns off and prevents the player flashlight from working.
EnableFlashlight  (only available in Hl2.pngP1.png)
Re-enables the player flashlight.
ForceDropPhysObjects  (only available in Hl2.pngP1.png)
Makes the player drop any object being held, whether its with +use or the gravity gun.
OnRescueZoneTouch  (only available in Css.pngL4d.pngL4d2-small.pngCsgo-small.png)
To do: Tells the player that they rescued a hostage? Appears to do nothing. This is not an output.[Confirmed]
IgnitePlayer <integer> (only available in Tf2.png)
This input used to set players on fire for the specified number of seconds. Since the Jungle Inferno update, it has only caused fire-related sounds (e.g. pain sounds) to play.
SetCustomModel <model> (only available in Tf2.png)
Changes the model the player appears as. The player will lose all animations, and their weapon models and tf_wearable models will float in the air. The only way to set the model back to normal seems to be to force a class change.
SetCustomModelOffset <vector> (only available in Tf2.png)
If the player has a model set with SetCustomModel, this provides an offset that will move the model certain XYZ distances from the origin.
SetCustomModelRotation <vector> (only available in Tf2.png)
Sets the player model to a specific Pitch Yaw and Roll. This may cause the model to stop rotating as the player looks around.
ClearCustomModelRotation  (only available in Tf2.png)
If the player has a model set with SetCustomModel, this will clear any custom rotation and make the model rotate to follow the player's eyes.
SetCustomModelRotates <boolean> (only available in Tf2.png)
If the player has a model set with SetCustomModel, this will set if that model is allowed to rotate to follow the player's eyes.
SetCustomModelVisibleToSelf <boolean> (only available in Tf2.png)
If the player has a model set with SetCustomModel, this will set if that model is visible to that player, if they're in thirdperson view.
SetForcedTauntCam <boolean> (only available in Tf2.png)
1 makes the player go into thirdperson. 0 will force the player back to firstperson, unless they were using the thirdperson console command.
ExtinguishPlayer  (only available in Tf2.png)
If the player was set on fire via normal means (such as a flamethrower, not the Ignite input), this input extinguishes them.
BleedPlayer <integer> (only available in Tf2.png)
Makes the player bleed for the specified number of seconds.
TriggerLootIslandAchievement  (only available in Tf2.png)
This input is fired on koth_lakeside_event when the player touches the caged skull on the loot island. It apparently causes an achievement to be unlocked, in normal gameplay.
TriggerLootIslandAchievement2  (only available in Tf2.png)
This input is fired on koth_lakeside_event when the player touches the caged skull on the loot island. It apparently causes an achievement to be unlocked, in normal gameplay.
SpeakResponseConcept <string> (only available in Tf2.pngL4d2-small.png)
Makes the player speak a response concept. Example: Tf2.pnghalloweenlongfall. To do: Make a full list for tf2 and l4d2? See the script files in scripts/talker/.
RollRareSpell  (only available in Tf2.png)
Makes the player roll for a random rare-tier spell. The map must have spells already on it for this input to work.
RoundSpawn  (only available in Tf2.png)
Tells the player entity that a new round has begun. Doesn't have any visible effect it seems.
SetCommentaryStatueMode <boolean> (only available in L4d.pngL4d2-small.png)
Intended for freezing zombies when in developer commentary mode. Survivor HUDs and health can become bugged if sent this input.
DisableLedgeHang  (only available in L4d2-small.png)
Makes the player unable to hang onto ledges (which requires a teammate to help them up). Instead, they will walk straight off the edge.
EnableLedgeHang  (only available in L4d2-small.png)
Lets the player hang onto ledges again.
TeleportToSurvivorPosition <target_destination> (only available in L4d2-small.png)
Teleports the player to the specified info_survivor_position and freezes them there.
ReleaseFromSurvivorPosition  (only available in L4d2-small.png)
Lets the player move freely again if they were forced to stand at an info_survivor_position.
SetGlowEnabled <boolean> (only available in L4d2-small.png)
Sets if this player is allowed to glow through walls if not visible.
RemoveWeaponUpgrades  (only available in L4d2-small.png)
Removes laser sights from guns.
CancelCurrentScene  (only available in L4d2-small.png)
Makes the player's character quit talking immediately.

See Also[edit | edit source]