No Translation
Home
Steam Group
Discord
Bans/Mutes
Players Statistics
Rank Distribution
Rules / Info
Counter-Strike 2
Demo Archive

CS2 Vscript API

VScript API

Class Methods

CBaseEntity

FunctionSignatureDescription
AddEffectsvoid AddEffects( int nFlags )Adds the render effect flag.
ApplyAbsVelocityImpulsevoid ApplyAbsVelocityImpulse( Vector vecImpulse )Apply a Velocity Impulse
ApplyLocalAngularVelocityImpulsevoid ApplyLocalAngularVelocityImpulse( Vector angImpulse )Apply an Ang Velocity Impulse
Attribute_GetFloatValuefloat Attribute_GetFloatValue( string pName, float flDefault )Get float value for an entity attribute.
Attribute_GetIntValueint Attribute_GetIntValue( string pName, int nDefault )Get int value for an entity attribute.
Attribute_SetFloatValuevoid Attribute_SetFloatValue( string pName, float flValue )Set float value for an entity attribute.
Attribute_SetIntValuevoid Attribute_SetIntValue( string pName, int nValue )Set int value for an entity attribute.
DeleteAttributevoid DeleteAttribute( string pName )Delete an entity attribute.
EmitSoundvoid EmitSound( string soundname )Plays a sound from this entity.
EmitSoundParamsvoid EmitSoundParams( string soundname, int nPitch, float flVolume, float flDelay )Plays/modifies a sound from this entity. changes sound if nPitch and/or flVol or flSoundTime is > 0.
EyeAnglesQAngle EyeAngles( )Get the qangles that this entity is looking at.
EyePositionVector EyePosition( )Get vector to eye position - absolute coords.
FirstMoveChildhandle FirstMoveChild( )
FollowEntityvoid FollowEntity( handle hEnt, bool bBoneMerge )hEntity to follow, bool bBoneMerge
FollowEntityMergevoid FollowEntityMerge( handle hEnt, string pszBoneOrAttachName )hEntity to follow, string BoneOrAttachName
GatherCriteriavoid GatherCriteria( handle hResult )Returns a table containing the criteria that would be used for response queries on this entity. This is the same as the table that is passed to response rule script function callbacks.
GetAbsOriginVector GetAbsOrigin( )
GetAbsScalefloat GetAbsScale( )
GetAnglesQAngle GetAngles( )
GetAnglesAsVectorVector GetAnglesAsVector( )Get entity pitch, yaw, roll as a vector.
GetAngularVelocityVector GetAngularVelocity( )Get the local angular velocity - returns a vector of pitch,yaw,roll
GetBaseVelocityVector GetBaseVelocity( )Get Base? velocity.
GetBoundingMaxsVector GetBoundingMaxs( )Get a vector containing max bounds, centered on object.
GetBoundingMinsVector GetBoundingMins( )Get a vector containing min bounds, centered on object.
GetBoundstable GetBounds( )Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object.
GetCenterVector GetCenter( )Get vector to center of object - absolute coords
GetChildrenhandle GetChildren( )Get the entities parented to this entity.
GetContexttable GetContext( string name )Looks up a context and returns it if available. May return string, float, or null (if the context isn't found).
GetForwardVectorVector GetForwardVector( )Get the forward vector of the entity.
GetHealthint GetHealth( )Get the health of this entity.
GetLeftVectorVector GetLeftVector( )Get the left vector of the entity.
GetLocalAnglesQAngle GetLocalAngles( )Get entity local pitch, yaw, roll as a QAngle
GetLocalAngularVelocityQAngle GetLocalAngularVelocity( )Maybe local angvel
GetLocalOriginVector GetLocalOrigin( )Get entity local origin as a Vector
GetLocalScalefloat GetLocalScale( )
GetLocalVelocityVector GetLocalVelocity( )Get Entity relative velocity.
GetMassfloat GetMass( )Get the mass of an entity. (returns 0 if it doesn't have a physics object)
GetMaxHealthint GetMaxHealth( )Get the maximum health of this entity.
GetModelNamestring GetModelName( )Returns the name of the model.
GetMoveParenthandle GetMoveParent( )If in hierarchy, retrieves the entity's parent.
GetOriginVector GetOrigin( )
GetOwnerhandle GetOwner( )Gets this entity's owner
GetOwnerEntityhandle GetOwnerEntity( )Get the owner entity, if there is one
GetRightVectorVector GetRightVector( )Get the right vector of the entity. WARNING: This produces a left-handed coordinate system. Use GetLeftVector instead (which is aligned with the y axis of the entity).
GetRootMoveParenthandle GetRootMoveParent( )If in hierarchy, walks up the hierarchy to find the root parent.
GetSoundDurationfloat GetSoundDuration( string soundname, string actormodel )Returns float duration of the sound. Takes soundname and optional actormodelname.
GetSpawnGroupHandleint GetSpawnGroupHandle( )Returns the spawn group handle of this entity
GetTeamint GetTeam( )Get the team number of this entity.
GetTeamNumberint GetTeamNumber( )Get the team number of this entity.
GetUpVectorVector GetUpVector( )Get the up vector of the entity.
GetVelocityVector GetVelocity( )
HasAttributebool HasAttribute( string pName )See if an entity has a particular attribute.
IsAlivebool IsAlive( )Is this entity alive?
IsNPCbool IsNPC( )Is this entity an CAI_BaseNPC?
IsPlayerControllerbool IsPlayerController( )Is this entity a player controller?
IsPlayerPawnbool IsPlayerPawn( )Is this entity a player pawn?
Killvoid Kill( )
NextMovePeerhandle NextMovePeer( )
OverrideFrictionvoid OverrideFriction( float duration, float friction )Takes duration, value for a temporary override.
PrecacheScriptSoundvoid PrecacheScriptSound( string soundname )Precache a sound for later playing.
RemoveEffectsvoid RemoveEffects( int nFlags )Removes the render effect flag.
SetAbsAnglesvoid SetAbsAngles( float fPitch, float fYaw, float fRoll )Set entity pitch, yaw, roll by component.
SetAbsOriginvoid SetAbsOrigin( Vector origin )
SetAbsScalevoid SetAbsScale( float flScale )
SetAnglesvoid SetAngles( float fPitch, float fYaw, float fRoll )Set entity pitch, yaw, roll by component.
SetAngularVelocityvoid SetAngularVelocity( float pitchVel, float yawVel, float rollVel )Set the local angular velocity - takes float pitch,yaw,roll velocities
SetConstraintvoid SetConstraint( Vector vPos )Set the position of the constraint.
SetContextvoid SetContext( string pName, string pValue, float duration )Store any key/value pair in this entity's dialog contexts. Value must be a string. Will last for duration (set 0 to mean 'forever').
SetContextNumvoid SetContextNum( string pName, float fValue, float duration )Store any key/value pair in this entity's dialog contexts. Value must be a number (int or float). Will last for duration (set 0 to mean 'forever').
SetContextThinkvoid SetContextThink( string pszContextName, handle hThinkFunc, float flInterval )Set a think function on this entity.
SetEntityNamevoid SetEntityName( string pName )Set the name of an entity.
SetForwardVectorvoid SetForwardVector( Vector v )Set the orientation of the entity to have this forward vector.
SetFrictionvoid SetFriction( float flFriction )Set PLAYER friction, ignored for objects.
SetGravityvoid SetGravity( float flGravity )Set PLAYER gravity, ignored for objects.
SetHealthvoid SetHealth( int nHealth )Set the health of this entity.
SetLocalAnglesvoid SetLocalAngles( float fPitch, float fYaw, float fRoll )Set entity local pitch, yaw, roll by component
SetLocalOriginvoid SetLocalOrigin( Vector origin )Set entity local origin from a Vector
SetLocalScalevoid SetLocalScale( float flScale )
SetMassvoid SetMass( float flMass )Set the mass of an entity. (does nothing if it doesn't have a physics object)
SetMaxHealthvoid SetMaxHealth( int amt )Set the maximum health of this entity.
SetOriginvoid SetOrigin( Vector v )
SetOwnervoid SetOwner( handle pOwner )Sets this entity's owner
SetParentvoid SetParent( handle hParent, string pAttachmentname )Set the parent for this entity.
SetTeamvoid SetTeam( int iTeamNum )
SetVelocityvoid SetVelocity( Vector vecVelocity )
StopSoundvoid StopSound( string soundname )Stops a named sound playing from this entity.
TakeDamageint TakeDamage( handle hInfo )Apply damage to this entity. Use CreateDamageInfo() to create a damageinfo object.
TransformPointEntityToWorldVector TransformPointEntityToWorld( Vector vPoint )Returns the input Vector transformed from entity to world space
TransformPointWorldToEntityVector TransformPointWorldToEntity( Vector vPoint )Returns the input Vector transformed from world to entity space
Triggervoid Trigger( )Fires off this entity's OnTrigger responses.
ValidatePrivateScriptScopevoid ValidatePrivateScriptScope( )Validates the private script scope and creates it if one doesn't exist.

CBaseAnimGraph

FunctionSignatureDescription
GetGraphParametertable GetGraphParameter( string pszParam )Get the value of the given animGraph parameter
SetGraphLookTargetvoid SetGraphLookTarget( Vector vValue )Pass the desired look target in world space to the graph
SetGraphParametervoid SetGraphParameter( string pszParam, table svArg )Set the specific param value, type is inferred from the type in script
SetGraphParameterBoolvoid SetGraphParameterBool( string szName, bool bValue )Set the specific param on or off
SetGraphParameterEnumvoid SetGraphParameterEnum( string szName, int nValue )Pass the enum (int) value to the specified param
SetGraphParameterFloatvoid SetGraphParameterFloat( string szName, float flValue )Pass the float value to the specified param
SetGraphParameterIntvoid SetGraphParameterInt( string szName, int nValue )Pass the int value to the specified param
SetGraphParameterVectorvoid SetGraphParameterVector( string szName, Vector vValue )Pass the vector value to the specified param in the graph

CBaseFlex

FunctionSignatureDescription
GetCurrentScenehandle GetCurrentScene( )Returns the instance of the oldest active scene entity (if any).
GetSceneByIndexhandle GetSceneByIndex( int index )Returns the instance of the scene entity at the specified index.
ScriptPlayScenefloat ScriptPlayScene( string pszScene, float flDelay )Play specified vcd file

CBaseModelEntity

FunctionSignatureDescription
GetAttachmentAnglesVector GetAttachmentAngles( int iAttachment )Get the attachment id's angles as a p,y,r vector.
GetAttachmentForwardVector GetAttachmentForward( int iAttachment )Get the attachment id's forward vector.
GetAttachmentOriginVector GetAttachmentOrigin( int iAttachment )Get the attachment id's origin vector.
GetMaterialGroupHashunsigned GetMaterialGroupHash( )Get the material group hash of this entity.
GetMaterialGroupMaskuint64 GetMaterialGroupMask( )Get the mesh group mask of this entity.
GetModelScalefloat GetModelScale( )Get scale of entity's model.
GetRenderAlphaint GetRenderAlpha( )Get the alpha modulation of this entity.
GetRenderColorVector GetRenderColor( )Get the render color of the entity.
ScriptLookupAttachmentint ScriptLookupAttachment( string pAttachmentName )Get the named attachment id.
SetBodygroupvoid SetBodygroup( int iGroup, int iValue )Sets a bodygroup.
SetBodygroupByNamevoid SetBodygroupByName( string pName, int iValue )Sets a bodygroup by name.
SetLightGroupvoid SetLightGroup( string pLightGroup )Sets the light group of the entity.
SetMaterialGroupvoid SetMaterialGroup( string pMaterialGroup )Set the material group of this entity.
SetMaterialGroupHashvoid SetMaterialGroupHash( unsigned nHash )Set the material group hash of this entity.
SetMaterialGroupMaskvoid SetMaterialGroupMask( uint64 nMeshGroupMask )Set the mesh group mask of this entity.
SetModelvoid SetModel( string pModelName )
SetModelScalevoid SetModelScale( float flScale )Set scale of entity's model.
SetRenderAlphavoid SetRenderAlpha( int nAlpha )Set the alpha modulation of this entity.
SetRenderColorvoid SetRenderColor( int r, int g, int b )Sets the render color of the entity.
SetRenderModevoid SetRenderMode( int nMode )Sets the render mode of the entity.
SetSingleMeshGroupvoid SetSingleMeshGroup( string pMeshGroupName )Set a single mesh group for this entity.
SetSizevoid SetSize( Vector mins, Vector maxs )
SetSkinvoid SetSkin( int iSkin )Set skin (int).

CBasePlayerController

FunctionSignatureDescription
GetPawnhandle GetPawn( )Returns the pawn for this controller

CBasePlayerPawn

FunctionSignatureDescription
GetControllerhandle GetController( )Returns the controller for this pawn
GetEquippedWeaponstable GetEquippedWeapons( )Returns an array of all the equipped weapons
GetWeaponCountint GetWeaponCount( )Gets the number of weapons currently equipped
IsNoclippingbool IsNoclipping( )Returns true if the player is in noclip mode.

CBaseTrigger

FunctionSignatureDescription
Disablevoid Disable( )Disable's the trigger
Enablevoid Enable( )Enable the trigger
IsTouchingbool IsTouching( handle hEnt )Checks whether the passed entity is touching the trigger.

CBodyComponent

FunctionSignatureDescription
AddImpulseAtPositionvoid AddImpulseAtPosition( Vector Vector_1, Vector Vector_2 )Apply an impulse at a worldspace position to the physics
AddVelocityvoid AddVelocity( Vector Vector_1, Vector Vector_2 )Add linear and angular velocity to the physics object
DetachFromParentvoid DetachFromParent( )Detach from its parent
GetSequenceint GetSequence( )Returns the active sequence
IsAttachedToParentbool IsAttachedToParent( )Is attached to parent
LookupSequenceint LookupSequence( string string_1 )Returns a sequence id given a name
SequenceDurationfloat SequenceDuration( string string_1 )Returns the duration in seconds of the specified sequence
SetAngularVelocityvoid SetAngularVelocity( Vector Vector_1 )
SetMaterialGroupvoid SetMaterialGroup( utlstringtoken utlstringtoken_1 )
SetVelocityvoid SetVelocity( Vector Vector_1 )

CCustomGameEventManager

FunctionSignatureDescription
RegisterListenerint RegisterListener( string string_1, handle handle_2 )( string EventName, func CallbackFunction ) - Register a callback to be called when a particular custom event arrives. Returns a listener ID that can be used to unregister later.
Send_ServerToAllClientsvoid Send_ServerToAllClients( string string_1, handle handle_2 )( string EventName, table EventData )
Send_ServerToPlayervoid Send_ServerToPlayer( handle handle_1, string string_2, handle handle_3 )( Entity Player, string EventName, table EventData )
Send_ServerToTeamvoid Send_ServerToTeam( int int_1, string string_2, handle handle_3 )( int TeamNumber, string EventName, table EventData )
UnregisterListenervoid UnregisterListener( int int_1 )( int ListnerID ) - Unregister a specific listener

CDebugOverlayScriptHelper

FunctionSignatureDescription
Axisvoid Axis( Vector Vector_1, <unknown> <unknown>_2, float float_3, bool bool_4, float float_5 )Draws an axis. Specify origin + orientation in world space.
Boxvoid Box( Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a world-space axis-aligned box. Specify bounds in world space.
BoxAnglesvoid BoxAngles( Vector Vector_1, Vector Vector_2, Vector Vector_3, <unknown> <unknown>_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws an oriented box at the origin. Specify bounds in local space.
Capsulevoid Capsule( Vector Vector_1, <unknown> <unknown>_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a capsule. Specify base in world space.
Circlevoid Circle( Vector Vector_1, <unknown> <unknown>_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a circle. Specify center in world space.
CircleScreenOrientedvoid CircleScreenOriented( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a circle oriented to the screen. Specify center in world space.
Conevoid Cone( Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a wireframe cone. Specify endpoint and direction in world space.
Crossvoid Cross( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a screen-aligned cross. Specify origin in world space.
Cross3Dvoid Cross3D( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a world-aligned cross. Specify origin in world space.
Cross3DOrientedvoid Cross3DOriented( Vector Vector_1, <unknown> <unknown>_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws an oriented cross. Specify origin in world space.
DrawTickMarkedLinevoid DrawTickMarkedLine( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a dashed line. Specify endpoints in world space.
EntityAttachmentsvoid EntityAttachments( ehandle ehandle_1, float float_2, float float_3 )Draws the attachments of the entity
EntityAxisvoid EntityAxis( ehandle ehandle_1, float float_2, bool bool_3, float float_4 )Draws the axis of the entity origin
EntityBoundsvoid EntityBounds( ehandle ehandle_1, int int_2, int int_3, int int_4, int int_5, bool bool_6, float float_7 )Draws bounds of an entity
EntitySkeletonvoid EntitySkeleton( ehandle ehandle_1, float float_2 )Draws the skeleton of the entity
EntityTextvoid EntityText( ehandle ehandle_1, int int_2, string string_3, int int_4, int int_5, int int_6, int int_7, float float_8 )Draws text on an entity
FilledRect2Dvoid FilledRect2D( Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7 )Draws a screen-space filled 2D rectangle. Coordinates are in pixels.
HorzArrowvoid HorzArrow( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a horizontal arrow. Specify endpoints in world space.
Linevoid Line( Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a line between two points
Line2Dvoid Line2D( Vector2D Vector2D_1, Vector2D Vector2D_2, int int_3, int int_4, int int_5, int int_6, float float_7 )Draws a line between two points in screenspace
PopDebugOverlayScopevoid PopDebugOverlayScope( )Pops the identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
PushAndClearDebugOverlayScopevoid PushAndClearDebugOverlayScope( utlstringtoken utlstringtoken_1 )Pushes an identifier used to group overlays. Deletes all existing overlays using this overlay id.
PushDebugOverlayScopevoid PushDebugOverlayScope( utlstringtoken utlstringtoken_1 )Pushes an identifier used to group overlays. Overlays marked with this identifier can be deleted in a big batch.
RemoveAllInScopevoid RemoveAllInScope( utlstringtoken utlstringtoken_1 )Removes all overlays marked with a specific identifier, regardless of their lifetime.
SolidConevoid SolidCone( Vector Vector_1, Vector Vector_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a solid cone. Specify endpoint and direction in world space.
Spherevoid Sphere( Vector Vector_1, float float_2, int int_3, int int_4, int int_5, int int_6, bool bool_7, float float_8 )Draws a wireframe sphere. Specify center in world space.
SweptBoxvoid SweptBox( Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, <unknown> <unknown>_5, int int_6, int int_7, int int_8, int int_9, float float_10 )Draws a swept box. Specify endpoints in world space and the bounds in local space.
Textvoid Text( Vector Vector_1, int int_2, string string_3, float float_4, int int_5, int int_6, int int_7, int int_8, float float_9 )Draws 2D text. Specify origin in world space.
Texturevoid Texture( string string_1, Vector2D Vector2D_2, Vector2D Vector2D_3, int int_4, int int_5, int int_6, int int_7, Vector2D Vector2D_8, Vector2D Vector2D_9, float float_10 )Draws a screen-space texture. Coordinates are in pixels.
Trianglevoid Triangle( Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a filled triangle. Specify vertices in world space.
VectorText3Dvoid VectorText3D( Vector Vector_1, <unknown> <unknown>_2, string string_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws 3D text. Specify origin + orientation in world space.
VertArrowvoid VertArrow( Vector Vector_1, Vector Vector_2, float float_3, int int_4, int int_5, int int_6, int int_7, bool bool_8, float float_9 )Draws a vertical arrow. Specify endpoints in world space.
YawArrowvoid YawArrow( Vector Vector_1, float float_2, float float_3, float float_4, int int_5, int int_6, int int_7, int int_8, bool bool_9, float float_10 )Draws a arrow associated with a specific yaw. Specify endpoints in world space.

CEntities

FunctionSignatureDescription
CreateByClassnamehandle CreateByClassname( string string_1 )Creates an entity by classname
FindAllByClassnametable FindAllByClassname( string string_1 )Finds all entities by class name. Returns an array containing all the found entities.
FindAllByClassnameWithintable FindAllByClassnameWithin( string string_1, Vector Vector_2, float float_3 )Find entities by class name within a radius.
FindAllByModeltable FindAllByModel( string string_1 )Find entities by model name.
FindAllByNametable FindAllByName( string string_1 )Find all entities by name. Returns an array containing all the found entities in it.
FindAllByNameWithintable FindAllByNameWithin( string string_1, Vector Vector_2, float float_3 )Find entities by name within a radius.
FindAllByTargettable FindAllByTarget( string string_1 )Find entities by targetname.
FindAllInSpheretable FindAllInSphere( Vector Vector_1, float float_2 )Find entities within a radius.
FindByClassnamehandle FindByClassname( handle handle_1, string string_2 )Find entities by class name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByClassnameNearesthandle FindByClassnameNearest( string string_1, Vector Vector_2, float float_3 )Find entities by class name nearest to a point.
FindByClassnameWithinhandle FindByClassnameWithin( handle handle_1, string string_2, Vector Vector_3, float float_4 )Find entities by class name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByModelhandle FindByModel( handle handle_1, string string_2 )Find entities by model name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByModelWithinhandle FindByModelWithin( handle handle_1, string string_2, Vector Vector_3, float float_4 )Find entities by model name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByNamehandle FindByName( handle handle_1, string string_2 )Find entities by name. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByNameNearesthandle FindByNameNearest( string string_1, Vector Vector_2, float float_3 )Find entities by name nearest to a point.
FindByNameWithinhandle FindByNameWithin( handle handle_1, string string_2, Vector Vector_3, float float_4 )Find entities by name within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindByTargethandle FindByTarget( handle handle_1, string string_2 )Find entities by targetname. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
FindInSpherehandle FindInSphere( handle handle_1, Vector Vector_2, float float_3 )Find entities within a radius. Pass 'null' to start an iteration, or reference to a previously found entity to continue a search
Firsthandle First( )Begin an iteration over the list of entities
GetLocalPlayerControllerhandle GetLocalPlayerController( )Get the local player controller.
GetLocalPlayerPawnhandle GetLocalPlayerPawn( )Get the local player pawn.
Nexthandle Next( handle handle_1 )Continue an iteration over the list of entities, providing reference to a previously found entity

CEntityInstance

FunctionSignatureDescription
ConnectOutputvoid ConnectOutput( string string_1, string string_2 )Adds an I/O connection that will call the named function on this entity when the specified output fires.
Destroyvoid Destroy( )
DisconnectOutputvoid DisconnectOutput( string string_1, string string_2 )Removes a connected script function from an I/O event on this entity.
DisconnectRedirectedOutputvoid DisconnectRedirectedOutput( string string_1, string string_2, handle handle_3 )Removes a connected script function from an I/O event on the passed entity.
FireOutputvoid FireOutput( string string_1, handle handle_2, handle handle_3, table table_4, float float_5 )Fire an entity output
GetClassnamestring GetClassname( )
GetDebugNamestring GetDebugName( )Get the entity name w/help if not defined (i.e. classname/etc)
GetEntityHandleehandle GetEntityHandle( )Get the entity as an EHANDLE
GetEntityIndexint GetEntityIndex( )
GetIntAttrint GetIntAttr( string string_1 )Get Integer Attribute
GetNamestring GetName( )
GetOrCreatePrivateScriptScopehandle GetOrCreatePrivateScriptScope( )Retrieve, creating if necessary, the private per-instance script-side data associated with an entity
GetOrCreatePublicScriptScopehandle GetOrCreatePublicScriptScope( )Retrieve, creating if necessary, the public script-side data associated with an entity
GetPrivateScriptScopehandle GetPrivateScriptScope( )Retrieve the private per-instance script-side data associated with an entity
GetPublicScriptScopehandle GetPublicScriptScope( )Retrieve the public script-side data associated with an entity
RedirectOutputvoid RedirectOutput( string string_1, string string_2, handle handle_3 )Adds an I/O connection that will call the named function on the passed entity when the specified output fires.
RemoveSelfvoid RemoveSelf( )Delete this entity
SetIntAttrvoid SetIntAttr( string string_1, int int_2 )Set Integer Attribute
entindexint entindex( )

CEnvEntityMaker

FunctionSignatureDescription
SpawnEntityvoid SpawnEntity( )Create an entity at the location of the maker
SpawnEntityAtEntityOriginvoid SpawnEntityAtEntityOrigin( handle hEntity )Create an entity at the location of a specified entity instance
SpawnEntityAtLocationvoid SpawnEntityAtLocation( Vector vecAlternateOrigin, Vector vecAlternateAngles )Create an entity at a specified location and orientaton, orientation is Euler angle in degrees (pitch, yaw, roll)
SpawnEntityAtNamedEntityOriginvoid SpawnEntityAtNamedEntityOrigin( string pszName )Create an entity at the location of a named entity

CEnvProjectedTexture

FunctionSignatureDescription
SetFarRangevoid SetFarRange( float flRange )Set light maximum range
SetLinearAttenuationvoid SetLinearAttenuation( float flAtten )Set light linear attenuation value
SetNearRangevoid SetNearRange( float flRange )Set light minimum range
SetQuadraticAttenuationvoid SetQuadraticAttenuation( float flAtten )Set light quadratic attenuation value
SetVolumetricsvoid SetVolumetrics( bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset )Turn on/off light volumetrics: bool bOn, float flIntensity, float flNoise, int nPlanes, float flPlaneOffset

CHostage

FunctionSignatureDescription
IsBeingCarriedbool IsBeingCarried( )Get whether the hostage is currently being carried or not

CInfoData

FunctionSignatureDescription
QueryColorVector QueryColor( utlstringtoken tok, Vector vDefault )Query color data for this key
QueryFloatfloat QueryFloat( utlstringtoken tok, float flDefault )Query float data for this key
QueryIntint QueryInt( utlstringtoken tok, int nDefault )Query int data for this key
QueryNumberfloat QueryNumber( utlstringtoken tok, float flDefault )Query number data for this key
QueryStringstring QueryString( utlstringtoken tok, string pDefault )Query string data for this key
QueryVectorVector QueryVector( utlstringtoken tok, Vector vDefault )Query vector data for this key

CInfoWorldLayer

FunctionSignatureDescription
HideWorldLayervoid HideWorldLayer( )Hides this layer
ShowWorldLayervoid ShowWorldLayer( )Shows this layer

CLogicRelay

FunctionSignatureDescription
Triggervoid Trigger( handle hActivator, handle hCaller )Triggers the logic_relay

CMarkupVolumeTagged

FunctionSignatureDescription
HasTagbool HasTag( string pszTagName )Does this volume have the given tag.

CNativeOutputs

FunctionSignatureDescription
AddOutputvoid AddOutput( string string_1, string string_2 )Add an output
Initvoid Init( int int_1 )Initialize with number of outputs

CPhysicsProp

FunctionSignatureDescription
DisableMotionvoid DisableMotion( )Disable motion for the prop
EnableMotionvoid EnableMotion( )Enable motion for the prop
SetDynamicVsDynamicContinuousvoid SetDynamicVsDynamicContinuous( bool bIsDynamicVsDynamicContinuousEnabled )Enable/disable dynamic vs dynamic continuous collision traces

CPointClientUIWorldPanel

FunctionSignatureDescription
AcceptUserInputvoid AcceptUserInput( )Tells the panel to accept user input.
AddCSSClassesvoid AddCSSClasses( string pszClasses )Adds CSS class(es) to the panel
IgnoreUserInputvoid IgnoreUserInput( )Tells the panel to ignore user input.
IsGrabbablebool IsGrabbable( )Returns whether this entity is grabbable.
RemoveCSSClassesvoid RemoveCSSClasses( string pszClasses )Remove CSS class(es) from the panel

CPointTemplate

FunctionSignatureDescription
DeleteCreatedSpawnGroupsvoid DeleteCreatedSpawnGroups( )Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this.
ForceSpawnvoid ForceSpawn( )Spawns all of the entities the point_template is pointing at.
GetSpawnedEntitieshandle GetSpawnedEntities( )Get the list of the most recent spawned entities
SetSpawnCallbackvoid SetSpawnCallback( handle hCallbackFunc, handle hCallbackScope )SetSpawnCallback( hCallbackFunc, hCallbackScope, hCallbackData ) : Set a callback for when the template spawns entities. The spawned entities will be passed in as an array.

CPointWorldText

FunctionSignatureDescription
SetMessagevoid SetMessage( string pMessage )Set the message on this entity.

CSceneEntity

FunctionSignatureDescription
AddBroadcastTeamTargetvoid AddBroadcastTeamTarget( int int_1 )Adds a team (by index) to the broadcast list
Cancelvoid Cancel( )Cancel scene playback
EstimateLengthfloat EstimateLength( )Returns length of this scene in seconds.
FindCamerahandle FindCamera( )Get the camera
FindNamedEntityhandle FindNamedEntity( string string_1 )given an entity reference, such as !target, get actual entity from scene object
IsPausedbool IsPaused( )If this scene is currently paused.
IsPlayingBackbool IsPlayingBack( )If this scene is currently playing.
LoadSceneFromStringbool LoadSceneFromString( string string_1, string string_2 )Given a dummy scene name and a vcd string, load the scene
RemoveBroadcastTeamTargetvoid RemoveBroadcastTeamTarget( int int_1 )Removes a team (by index) from the broadcast list
Startvoid Start( handle handle_1 )Start scene playback, takes activatorEntity as param

CScriptKeyValues

FunctionSignatureDescription
GetValuetable GetValue( string string_1 )Reads a spawn key

CScriptParticleManager

FunctionSignatureDescription
CreateParticleint CreateParticle( string string_1, int int_2, handle handle_3 )Creates a new particle effect
CreateParticleForPlayerint CreateParticleForPlayer( string string_1, int int_2, handle handle_3, handle handle_4 )Creates a new particle effect that only plays for the specified player
DestroyParticlevoid DestroyParticle( int omdex, bool bDestroyImmediately )Destroy a particle, if bDestroyImmediately destroy it without playing end caps.
GetParticleReplacementstring GetParticleReplacement( string string_1, handle handle_2 )
ReleaseParticleIndexvoid ReleaseParticleIndex( int int_1 )Frees the specified particle index
SetParticleAlwaysSimulatevoid SetParticleAlwaysSimulate( int int_1 )
SetParticleControlvoid SetParticleControl( int int_1, int int_2, Vector Vector_3 )Set the control point data for a control on a particle effect
SetParticleControlEntvoid SetParticleControlEnt( int int_1, int int_2, handle handle_3, int int_4, string string_5, Vector Vector_6, bool bool_7 )
SetParticleControlOffsetvoid SetParticleControlOffset( int iIndex, int iPoint, Vector vecOffset )Set the linear offset for a control on a particle effect
SetParticleControlTransformvoid SetParticleControlTransform( int iIndex, int iPoint, Vector vOrigin, QAngle qAngles )Set the transform for a control on a particle effect
SetParticleControlTransformForwardvoid SetParticleControlTransformForward( int iIndex, int iPoint, Vector vOrigin, Vector vecForward )Set the origin and forward direction for a control on a particle effect

CScriptPrecacheContext

FunctionSignatureDescription
AddResourcevoid AddResource( string string_1 )Precaches a specific resource
GetValuetable GetValue( string string_1 )Reads a spawn key

Convars

FunctionSignatureDescription
GetBooltable GetBool( string name )Returns the convar as a boolean flag.
GetCommandClienthandle GetCommandClient( )Returns the player who issued this console command.
GetFloattable GetFloat( string name )Returns the convar as a float. May return null if no such convar.
GetInttable GetInt( string name )Returns the convar as an int. May return null if no such convar.
GetStrtable GetStr( string name )Returns the convar as a string. May return null if no such convar.
RegisterCommandvoid RegisterCommand( string name, handle fn, string helpString, int flags )Register a console command.
RegisterConvarvoid RegisterConvar( string name, string defaultValue, string helpString, int flags )Register a new console variable.
SetBoolvoid SetBool( string name, bool val )Sets the value of the convar to the bool.
SetFloatvoid SetFloat( string name, float val )Sets the value of the convar to the float.
SetIntvoid SetInt( string name, int val )Sets the value of the convar to the int.
SetStrvoid SetStr( string name, string val )Sets the value of the convar to the string.

GlobalSys

FunctionSignatureDescription
CommandLineChecktable CommandLineCheck( string name )Returns true if the command line param was used, otherwise false.
CommandLineFloattable CommandLineFloat( string name, float float_2 )Returns the command line param as a float.
CommandLineInttable CommandLineInt( string name, int int_2 )Returns the command line param as an int.
CommandLineStrtable CommandLineStr( string name, string string_2 )Returns the command line param as a string.

SteamInfo

FunctionSignatureDescription
IsPublicUniversebool IsPublicUniverse( )Is the script connected to the public Steam universe

Global Functions

Debug

FunctionSignatureDescription
DebugBreakvoid DebugBreak( )Breaks in the debugger
DebugDrawBoxvoid DebugDrawBox( Vector Vector_1, Vector Vector_2, Vector Vector_3, int int_4, int int_5, int int_6, int int_7, float float_8 )Draw a debug overlay box (origin, mins, maxs, forward, r, g, b, a, duration )
DebugDrawBoxDirectionvoid DebugDrawBoxDirection( Vector Vector_1, Vector Vector_2, Vector Vector_3, Vector Vector_4, Vector Vector_5, float float_6, float float_7 )Draw a debug forward box (cent, min, max, forward, vRgb, a, duration)
DebugDrawCirclevoid DebugDrawCircle( Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6 )Draw a debug circle (center, vRgb, a, rad, ztest, duration)
DebugDrawClearvoid DebugDrawClear( )Try to clear all the debug overlay info
DebugDrawLinevoid DebugDrawLine( Vector Vector_1, Vector Vector_2, int int_3, int int_4, int int_5, bool bool_6, float float_7 )Draw a debug overlay line (origin, target, r, g, b, ztest, duration)
DebugDrawLine_vColvoid DebugDrawLine_vCol( Vector Vector_1, Vector Vector_2, Vector Vector_3, bool bool_4, float float_5 )Draw a debug line using color vec (start, end, vRgb, a, ztest, duration)
DebugDrawScreenTextLinevoid DebugDrawScreenTextLine( float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9 )Draw text with a line offset (x, y, lineOffset, text, r, g, b, a, duration)
DebugDrawSpherevoid DebugDrawSphere( Vector Vector_1, Vector Vector_2, float float_3, float float_4, bool bool_5, float float_6 )Draw a debug sphere (center, vRgb, a, rad, ztest, duration)
DebugDrawTextvoid DebugDrawText( Vector Vector_1, string string_2, bool bool_3, float float_4 )Draw text in 3d (origin, text, bViewCheck, duration)
DebugScreenTextPrettyvoid DebugScreenTextPretty( float float_1, float float_2, int int_3, string string_4, int int_5, int int_6, int int_7, int int_8, float float_9, string string_10, int int_11, bool bool_12 )Draw pretty debug text (x, y, lineOffset, text, r, g, b, a, duration, font, size, bBold)
DoScriptAssertvoid DoScriptAssert( bool bool_1, string string_2 )#ScriptAssert:Asserts the passed in value. Prints out a message and brings up the assert dialog.

Printing

FunctionSignatureDescription
Msgvoid Msg( string string_1 )Print a message
PrintLinkedConsoleMessagevoid PrintLinkedConsoleMessage( string string_1, string string_2 )Print a console message with a linked console command
Sayvoid Say( handle handle_1, string string_2, bool bool_3 )Have Entity say string, and teamOnly or not
ScriptPrintMessageCenterAllvoid ScriptPrintMessageCenterAll( string string_1 )Prints an alert message in the center print method to all players.
ScriptPrintMessageCenterAllWithParamsvoid ScriptPrintMessageCenterAllWithParams( string string_1, string string_2, string string_3, string string_4 )Prints an alert message in the center print method to all players. Needs to pass token/message. param1, param2, param3. Can pass null if you need less than 3.
ScriptPrintMessageCenterTeamvoid ScriptPrintMessageCenterTeam( int int_1, string string_2 )Prints an alert message in the center print method to the specified team.
ScriptPrintMessageChatAllvoid ScriptPrintMessageChatAll( string string_1 )Prints a message in chat to all players.
ScriptPrintMessageChatTeamvoid ScriptPrintMessageChatTeam( int int_1, string string_2 )Prints a message in chat to the specified team.
ShowMessagevoid ShowMessage( string string_1 )Print a hud message on all clients
UTIL_MessageTextvoid UTIL_MessageText( int int_1, string string_2, int int_3, int int_4, int int_5, int int_6 )Sends colored text to one client.
UTIL_MessageTextAllvoid UTIL_MessageTextAll( string string_1, int int_2, int int_3, int int_4, int int_5 )Sends colored text to all clients.
UTIL_MessageTextAll_WithContextvoid UTIL_MessageTextAll_WithContext( string string_1, int int_2, int int_3, int int_4, int int_5, handle handle_6 )Sends colored text to all clients. (Valid context keys: player_id, value, team_id)
UTIL_MessageText_WithContextvoid UTIL_MessageText_WithContext( int int_1, string string_2, int int_3, int int_4, int int_5, int int_6, handle handle_7 )Sends colored text to one client. (Valid context keys: player_id, value, team_id)
UTIL_ResetMessageTextvoid UTIL_ResetMessageText( int int_1 )Clear all message text on one client.
UTIL_ResetMessageTextAllvoid UTIL_ResetMessageTextAll( )Clear all message text from all clients.
Warningvoid Warning( string string_1 )Print a warning

Training Course

FunctionSignatureDescription
ScriptGetBestTrainingCourseTimeint ScriptGetBestTrainingCourseTime( )Gets the player's best time for completing the timed course.
ScriptGetPlayerCompletedTrainingbool ScriptGetPlayerCompletedTraining( )Returns true if the player has completed the initial portion of the training map.
ScriptGetValveTrainingCourseTimeint ScriptGetValveTrainingCourseTime( )Gets Valve's best time for completing the timed course.
ScriptHighlightAmmoCountervoid ScriptHighlightAmmoCounter( )Sends an event that is just used by the instructor system to show a hint highlighting the ammo counter.
ScriptSetBestTrainingCourseTimevoid ScriptSetBestTrainingCourseTime( int int_1 )Sets the player's best time for completing the timed course.
ScriptSetMiniScoreHiddenvoid ScriptSetMiniScoreHidden( bool bool_1 )Toggles the visibility of the miniscoreboard hud element.
ScriptSetPlayerCompletedTrainingvoid ScriptSetPlayerCompletedTraining( bool bool_1 )Sets whether the player has completed the initial portion of the training map.
ScriptSetRadarHiddenvoid ScriptSetRadarHidden( bool bool_1 )Toggles the visibility of the radar hud element.
ScriptShowExitDoorMsgvoid ScriptShowExitDoorMsg( )Shows a message box in trainign when the player exits through the exit door
ScriptShowFinishMsgBoxvoid ScriptShowFinishMsgBox( )Shows a message box to let players know what to do next after finishing the training course.
ScriptTrainingGivePlayerAmmovoid ScriptTrainingGivePlayerAmmo( )Refills ammo to max for all weapons the player has (only works in training).

Co-op Strike

FunctionSignatureDescription
ScriptCoopCollectBonusCoinvoid ScriptCoopCollectBonusCoin( )Marks one of the bonus coins as collected.
ScriptCoopExtendRoundDurationTimevoid ScriptCoopExtendRoundDurationTime( float float_1 )Extends the round time after checkpoint during the mission.
ScriptCoopGiveC4sToCTsvoid ScriptCoopGiveC4sToCTs( int int_1 )Will give the number of specified C4s to all alive CT players.
ScriptCoopMissionGetMissionNumberint ScriptCoopMissionGetMissionNumber( )Gets the mission number for the current map - maps can have multiple missions on them.
ScriptCoopMissionRespawnDeadPlayersvoid ScriptCoopMissionRespawnDeadPlayers( )Respawns players only.
ScriptCoopMissionSetDeadPlayerRespawnEnabledvoid ScriptCoopMissionSetDeadPlayerRespawnEnabled( bool bool_1 )Controls whether player respawns can happen.
ScriptCoopMissionSetNextRespawnInvoid ScriptCoopMissionSetNextRespawnIn( float float_1, bool bool_2 )Set the next respawn wave to happen in this many seconds.
ScriptCoopMissionSpawnFirstEnemiesvoid ScriptCoopMissionSpawnFirstEnemies( int int_1 )Spawns the first wave of enemies in coop.
ScriptCoopMissionSpawnNextWavevoid ScriptCoopMissionSpawnNextWave( int int_1 )Tells the next wave of enemies to spawn in coop. Also respawns player.
ScriptCoopResetRoundStartTimevoid ScriptCoopResetRoundStartTime( )Resets the round time and starts the mission.
ScriptCoopSetBotQuotaAndRefreshSpawnsvoid ScriptCoopSetBotQuotaAndRefreshSpawns( int int_1 )Sets the bot quota considering the # of players connected and refreshes the spawns.
ScriptCoopToggleEntityOutlineHighlightsvoid ScriptCoopToggleEntityOutlineHighlights( bool bool_1 )Highlights all dropped weapons for players, or removes all highlights.

Premier Mode

FunctionSignatureDescription
ScriptLobbyMapVetoFinishedvoid ScriptLobbyMapVetoFinished( string string_1, bool bool_2, bool bool_3, string string_4 )Switch to the selected map after lobby map veto finished.

Sounds

FunctionSignatureDescription
EmitSoundOnvoid EmitSoundOn( string string_1, handle handle_2 )Play named sound on Entity
EmitSoundOnClientvoid EmitSoundOnClient( string string_1, handle handle_2 )Play named sound only on the client for the passed in player
StartSoundEventvoid StartSoundEvent( string string_1, handle handle_2 )Start a sound event
StartSoundEventFromPositionvoid StartSoundEventFromPosition( string string_1, Vector Vector_2 )Start a sound event from position
StartSoundEventFromPositionReliablevoid StartSoundEventFromPositionReliable( string string_1, Vector Vector_2 )Start a sound event from position with reliable delivery
StartSoundEventFromPositionUnreliablevoid StartSoundEventFromPositionUnreliable( string string_1, Vector Vector_2 )Start a sound event from position with optional delivery
StartSoundEventReliablevoid StartSoundEventReliable( string string_1, handle handle_2 )Start a sound event with reliable delivery
StartSoundEventUnreliablevoid StartSoundEventUnreliable( string string_1, handle handle_2 )Start a sound event with optional delivery
StopSoundEventvoid StopSoundEvent( string string_1, handle handle_2 )Stops a sound event with optional delivery
StopSoundOnvoid StopSoundOn( string string_1, handle handle_2 )Stop named sound on Entity

Other

FunctionSignatureDescription
AngleDifffloat AngleDiff( float float_1, float float_2 )Returns the number of degrees difference between two yaw angles
AnglesToVectorVector AnglesToVector( QAngle QAngle_1 )Generate a vector given a QAngles
AppendToLogFilevoid AppendToLogFile( string string_1, string string_2 )AppendToLogFile is deprecated. Print to the console for logging instead.
AxisAngleToQuaternionQuaternion AxisAngleToQuaternion( Vector Vector_1, float float_2 )Constructs a quaternion representing a rotation by angle around the specified vector axis
CalcClosestPointOnEntityOBBVector CalcClosestPointOnEntityOBB( handle handle_1, Vector Vector_2 )Compute the closest point on the OBB of an entity.
CalcDistanceBetweenEntityOBBfloat CalcDistanceBetweenEntityOBB( handle handle_1, handle handle_2 )Compute the distance between two entity OBB. A negative return value indicates an input error. A return value of zero indicates that the OBBs are overlapping.
CalcDistanceToLineSegment2Dfloat CalcDistanceToLineSegment2D( Vector Vector_1, Vector Vector_2, Vector Vector_3 )
CancelEntityIOEventsvoid CancelEntityIOEvents( ehandle ehandle_1 )Create all I/O events for a particular entity
CreateDamageInfohandle CreateDamageInfo( handle handle_1, handle handle_2, Vector Vector_3, Vector Vector_4, float float_5, int int_6 )(hInflictor, hAttacker, flDamage) - Allocate a damageinfo object, used as an argument to TakeDamage(). Call DestroyDamageInfo( hInfo ) to free the object.
CreateEffectbool CreateEffect( handle handle_1 )Pass table - Inputs: entity, effect
CreateSceneEntityhandle CreateSceneEntity( string string_1 )Create a scene entity to play the specified scene.
CreateTriggerhandle CreateTrigger( Vector origin, Vector vecMin, Vector vecMax )Creates and returns an AABB trigger
CreateTriggerRadiusApproximatehandle CreateTriggerRadiusApproximate( Vector vecOrigin, float flRadius )Creates and returns an AABB trigger thats bigger than the radius provided
CreateUniformRandomStreamhandle CreateUniformRandomStream( int iSeed )Creates a separate random number stream.
CrossVectorsVector CrossVectors( Vector Vector_1, Vector Vector_2 )Cross product between two vectors
DestroyDamageInfovoid DestroyDamageInfo( handle handle_1 )Free a damageinfo object that was created with CreateDamageInfo().
DoEntFirevoid DoEntFire( string string_1, string string_2, string string_3, float float_4, handle handle_5, handle handle_6 )#EntFire:Generate and entity i/o event
DoEntFireByInstanceHandlevoid DoEntFireByInstanceHandle( handle handle_1, string string_2, string string_3, float float_4, handle handle_5, handle handle_6 )#EntFireByHandle:Generate and entity i/o event
DoIncludeScriptbool DoIncludeScript( string string_1, handle handle_2 )Execute a script (internal)
DoUniqueStringstring DoUniqueString( string string_1 )#UniqueString:Generate a string guaranteed to be unique across the life of the script VM, with an optional root string. Useful for adding data to tables when not sure what keys are already in use in that table.
EntIndexToHScripthandle EntIndexToHScript( int int_1 )Turn an entity index integer to an HScript representing that entity's script instance.
ExponentialDecayfloat ExponentialDecay( float float_1, float float_2, float float_3 )Smooth curve decreasing slower as it approaches zero
FireEntityIOInputNameOnlyvoid FireEntityIOInputNameOnly( ehandle ehandle_1, string string_2 )Fire Entity's Action Input w/no data
FireEntityIOInputStringvoid FireEntityIOInputString( ehandle ehandle_1, string string_2, string string_3 )Fire Entity's Action Input with passed String - you own the memory
FireEntityIOInputVecvoid FireEntityIOInputVec( ehandle ehandle_1, string string_2, Vector Vector_3 )Fire Entity's Action Input with passed Vector - you own the memory
FireGameEventvoid FireGameEvent( string string_1, handle handle_2 )Fire a game event.
FireGameEventLocalvoid FireGameEventLocal( string string_1, handle handle_2 )Fire a game event without broadcasting to the client.
FrameTimefloat FrameTime( )Get the time spent on the server in the last frame
GetActiveSpawnGroupHandleint GetActiveSpawnGroupHandle( )Returns the currently active spawn group handle
GetFrameCountint GetFrameCount( )Returns the engines current frame count
GetListenServerHosthandle GetListenServerHost( )Get the local player on a listen server.
GetMapNamestring GetMapName( )Get the name of the map.
GetMaxOutputDelayfloat GetMaxOutputDelay( ehandle ehandle_1, string string_2 )Get the longest delay for all events attached to an output
GetPhysAngularVelocityVector GetPhysAngularVelocity( handle handle_1 )Get Angular Velocity for VPHYS or normal object. Returns a vector of the axis of rotation, multiplied by the degrees of rotation per second.
GetPhysVelocityVector GetPhysVelocity( handle handle_1 )Get Velocity for VPHYS or normal object
InitLogFilevoid InitLogFile( string string_1, string string_2 )InitLogFile is deprecated. Print to the console for logging instead.
IsClientbool IsClient( )Returns true if this is lua running from the client.dll.
IsDedicatedServerbool IsDedicatedServer( )Returns true if this server is a dedicated server.
IsInToolsModebool IsInToolsMode( )Returns true if this is lua running within tools mode.
IsMarkedForDeletionbool IsMarkedForDeletion( handle handle_1 )Returns true if the entity is valid and marked for deletion.
IsServerbool IsServer( )Returns true if this is lua running from the server.dll.
IsValidEntitybool IsValidEntity( handle handle_1 )Checks to see if the given hScript is a valid entity
LerpVectorsVector LerpVectors( Vector Vector_1, Vector Vector_2, float float_3 )lerp between two vectors by a float factor returning new vector
ListenToGameEventint ListenToGameEvent( string string_1, handle handle_2, handle handle_3 )Register as a listener for a game event from script.
LoadKeyValuestable LoadKeyValues( string string_1 )Creates a table from the specified keyvalues text file
LoadKeyValuesFromStringtable LoadKeyValuesFromString( string string_1 )Creates a table from the specified keyvalues string
LocalTimetable LocalTime( )Get the current local time
MakeStringTokenint MakeStringToken( string string_1 )Checks to see if the given hScript is a valid entity
ManuallyTriggerSpawnGroupCompletionvoid ManuallyTriggerSpawnGroupCompletion( int int_1 )Triggers the creation of entities in a manually-completed spawn group
Plat_FloatTimefloat Plat_FloatTime( )Get the current float time from the engine
PlayerInstanceFromIndexhandle PlayerInstanceFromIndex( int int_1 )Get a script instance of a player by index.
PrecacheEntityFromTablevoid PrecacheEntityFromTable( string string_1, handle handle_2, handle handle_3 )Precache an entity from KeyValues in table
PrecacheEntityListFromTablevoid PrecacheEntityListFromTable( handle handle_1, handle handle_2 )Precache a list of entity KeyValues tables
PrecacheResourcevoid PrecacheResource( string modelName, handle context )Manually precache a single model
QSlerpQAngle QSlerp( QAngle fromAngle, QAngle toAngle, float time )Spherical lerp of angle from->to based on time
RandomFloatfloat RandomFloat( float float_1, float float_2 )Get a random float within a range
RandomIntint RandomInt( int int_1, int int_2 )Get a random int within a range
RegisterSpawnGroupFilterProxyvoid RegisterSpawnGroupFilterProxy( string string_1 )Create a C proxy for a script-based spawn group filter
ReloadMOTDvoid ReloadMOTD( )Reloads the MotD file
RemoveSpawnGroupFilterProxyvoid RemoveSpawnGroupFilterProxy( string string_1 )Remove the C proxy for a script-based spawn group filter
RotateOrientationQAngle RotateOrientation( QAngle QAngle_1, QAngle QAngle_2 )Rotate a QAngle by another QAngle.
RotatePositionVector RotatePosition( Vector Vector_1, QAngle QAngle_2, Vector Vector_3 )Rotate a Vector around a point.
RotateQuaternionByAxisAngleQuaternion RotateQuaternionByAxisAngle( Quaternion Quaternion_1, Vector Vector_2, float float_3 )Rotates a quaternion by the specified angle around the specified vector axis
RotationDeltaQAngle RotationDelta( QAngle QAngle_1, QAngle QAngle_2 )Find the delta between two QAngles.
RotationDeltaAsAngularVelocityVector RotationDeltaAsAngularVelocity( QAngle QAngle_1, QAngle QAngle_2 )Converts delta QAngle to an angular velocity Vector
ScreenShakevoid ScreenShake( Vector vecCenter, float flAmplitude, float flFrequency, float flDuration, float flRadius, int eCommand, bool bAirShake )Start a screenshake. eCommand values: SHAKE_START = 0, SHAKE_STOP = 1
ScriptGetGameModeint ScriptGetGameMode( )Gets the current game mode.
ScriptGetGameTypeint ScriptGetGameType( )Gets the current game type.
ScriptGetRoundsPlayedint ScriptGetRoundsPlayed( )Get the number of rounds played so far.
ScriptIsLocalPlayerUsingControllerbool ScriptIsLocalPlayerUsingController( )Returns whether the player is playing with a controller or not.
ScriptIsWarmupPeriodbool ScriptIsWarmupPeriod( )Is it warmup or not.
SendToConsolevoid SendToConsole( string string_1 )Send a string to the console as a client command
SendToServerConsolevoid SendToServerConsole( string string_1 )Send a string to the console as a server command
SetOpvarFloatAllvoid SetOpvarFloatAll( string string_1, string string_2, string string_3, float float_4 )Sets an opvar value for all players
SetOpvarFloatPlayervoid SetOpvarFloatPlayer( string string_1, string string_2, string string_3, float float_4, handle handle_5 )Sets an opvar value for a single player
SetPhysAngularVelocityvoid SetPhysAngularVelocity( handle handle_1, Vector Vector_2 )Set Angular Velocity for VPHYS or normal object, from a vector of the axis of rotation, multiplied by the degrees of rotation per second.
SetQuestNamevoid SetQuestName( string string_1 )Set the current quest name.
SetQuestPhasevoid SetQuestPhase( int int_1 )Set the current quest phase.
SetRenderingEnabledvoid SetRenderingEnabled( ehandle ehandle_1, bool bool_2 )Set rendering on/off for an ehandle
SpawnEntityFromTableAsynchronousvoid SpawnEntityFromTableAsynchronous( string string_1, handle handle_2, handle handle_3, handle handle_4 )Asynchronously spawns a single entity from a table
SpawnEntityFromTableSynchronoushandle SpawnEntityFromTableSynchronous( string string_1, handle handle_2 )Synchronously spawns a single entity from a table
SpawnEntityGroupFromTablebool SpawnEntityGroupFromTable( handle handle_1, bool bool_2, handle handle_3 )Hierarchically spawn an entity group from a set of spawn tables.
SpawnEntityListFromTableAsynchronousint SpawnEntityListFromTableAsynchronous( handle handle_1, handle handle_2 )Asynchronously spawn an entity group from a list of spawn tables. A callback will be triggered when the spawning is complete
SpawnEntityListFromTableSynchronoushandle SpawnEntityListFromTableSynchronous( handle handle_1 )Synchronously spawn an entity group from a list of spawn tables.
SplineQuaternionsQuaternion SplineQuaternions( Quaternion Quaternion_1, Quaternion Quaternion_2, float float_3 )Very basic interpolation of v0 to v1 over t on [0,1]
SplineVectorsVector SplineVectors( Vector Vector_1, Vector Vector_2, float float_3 )Very basic interpolation of v0 to v1 over t on [0,1]
StopEffectvoid StopEffect( handle handle_1, string string_2 )Pass entity and effect name
StopListeningToAllGameEventsvoid StopListeningToAllGameEvents( handle handle_1 )Stop listening to all game events within a specific context.
StopListeningToGameEventbool StopListeningToGameEvent( int int_1 )Stop listening to a particular game event.
Timefloat Time( )Get the current server time
TraceCollideablebool TraceCollideable( handle handle_1 )Pass table - Inputs: start, end, ent, (optional mins, maxs) -- outputs: pos, fraction, hit, startsolid, normal
TraceHullbool TraceHull( handle handle_1 )Pass table - Inputs: start, end, min, max, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
TraceLinebool TraceLine( handle handle_1 )Pass table - Inputs: startpos, endpos, mask, ignore -- outputs: pos, fraction, hit, enthit, startsolid
UTIL_Removevoid UTIL_Remove( handle handle_1 )Removes the specified entity
UTIL_RemoveImmediatevoid UTIL_RemoveImmediate( handle handle_1 )Immediately removes the specified entity
UnloadSpawnGroupvoid UnloadSpawnGroup( string string_1 )Unload a spawn group by name
UnloadSpawnGroupByHandlevoid UnloadSpawnGroupByHandle( int int_1 )Unload a spawn group by handle
UserIDToControllerHScripthandle UserIDToControllerHScript( int userid )Turn a userid integer (typically, fields named 'userid' in game events) to an HScript representing the associated player controller's script instance.
VectorToAnglesQAngle VectorToAngles( Vector Vector_1 )Get Qangles (with no roll) for a Vector.
cvar_getffloat cvar_getf( string string_1 )Gets the value of the given cvar, as a float.
cvar_setfbool cvar_setf( string string_1, float float_2 )Sets the value of the given cvar, as a float.