### Download and Install AMBuild Source: https://cs2.poggu.me/metamod/compilation/windows This snippet demonstrates how to clone the AMBuild repository from GitHub and install it using pip. It also includes an alternative method for installation if the primary method fails. ```bash git clone https://github.com/alliedmodders/ambuild pip install ./ambuild # In case of an error try # cd ambuild && python setup.py install && cd .. ``` -------------------------------- ### Download and Install AMBuild Source: https://cs2.poggu.me/metamod/compilation/linux Clones the AMBuild repository from GitHub and installs it using pip. Includes a fallback method to install directly from the source directory if the pip installation fails. ```bash git clone https://github.com/alliedmodders/ambuild pip install ./ambuild # In case of an error try # cd ambuild && python setup.py install && cd .. ``` -------------------------------- ### Download Game SDK and Metamod:Source Source: https://cs2.poggu.me/metamod/compilation/windows This section covers cloning the necessary SDK for CS2 and the Metamod:Source repository. It ensures that the correct branches are checked out and submodules are initialized. ```bash mkdir hl2sdk-root git clone https://github.com/alliedmodders/hl2sdk/ --branch cs2 hl2sdk-root/hl2sdk-cs2 git clone https://github.com/alliedmodders/metamod-source --recursive ``` -------------------------------- ### Modify gameinfo.gi Search Paths for Metamod Installation Source: https://cs2.poggu.me/metamod/installation This snippet shows how to edit the 'gameinfo.gi' file to add Metamod to the search paths. This is a crucial step for Metamod:Source to load properly on a Source 2 dedicated server. Ensure this line is added to the 'SearchPaths' section within the 'FileSystem' block. ```plaintext "GameInfo" {"t+ game "Counter-Strike 2" title "Counter-Strike 2" title_pw "E58F8DE68190E7B2BEE88BB1EFBC9AE585A8E79083E694BBE58ABF" LayeredOnMod csgo_imported // Inherits the gameinfo.gi data from csgo_imported (which itself inherits from csgo_core) FileSystem { SearchPaths { Game_LowViolence csgo_lv // Perfect World content override + Game csgo/addons/metamod Game csgo Game csgo_imported Game csgo_core Game core ... ``` -------------------------------- ### Configure and Build Metamod:Source for CS2 Source: https://cs2.poggu.me/metamod/compilation/windows This sequence of commands prepares the build environment by creating a 'build' directory, configuring the project for CS2 using a Python script, and then initiating the build process with AMBuild. ```bash mkdir build && cd build python ../configure.py -s cs2 ambuild ``` -------------------------------- ### Ubuntu 20.04 System Setup for Compilation Source: https://cs2.poggu.me/metamod/compilation/linux Installs necessary packages on Ubuntu 20.04 for compiling Metamod:Source, including python3-pip and clang. It also configures the PATH environment variable to include locally installed pip packages. ```bash sudo apt update sudo apt install python3-pip sudo apt-get install clang # make sure we can use pip installed packages anywhere echo "export PATH=\"$HOME/.local/bin:$PATH\"" >> ~/.bashrc . ~/.bashrc ``` -------------------------------- ### Configure and Build Metamod:Source Source: https://cs2.poggu.me/metamod/compilation/linux Creates a 'build' directory, configures the build process using Python 3 with clang as the C and C++ compiler, specifying 'cs2' as the game. Finally, it runs 'ambuild' to compile Metamod:Source. ```bash mkdir build && cd build CC=clang CXX=clang++ python3 ../configure.py -s cs2 ambuild ``` -------------------------------- ### Download Game SDK and Metamod:Source Source: https://cs2.poggu.me/metamod/compilation/linux Downloads the Counter-Strike 2 SDK and Metamod:Source repository. Sets environment variables for HL2SDKCS2 and MMSOURCE112, and then sources the .bashrc file to apply these changes. ```bash mkdir hl2sdk-root git clone https://github.com/alliedmodders/hl2sdk/ --branch cs2 hl2sdk-root/hl2sdk-cs2 git clone https://github.com/alliedmodders/metamod-source --recursive cd metamod-source echo "export HL2SDKCS2=/absolute/path/to/hl2sdk-root/hl2sdk-cs2" >> ~/.bashrc echo "export MMSOURCE112=/absolute/path/to/metamod-source" >> ~/.bashrc . ~/.bashrc ``` -------------------------------- ### Create and Navigate to Project Directory Source: https://cs2.poggu.me/metamod/compilation/windows This command creates a new directory named 'alliedmodders' and changes the current directory to it, serving as the root for the project files. ```bash mkdir alliedmodders cd alliedmodders ``` -------------------------------- ### Entity Information Retrieval Source: https://cs2.poggu.me/dumped-data/vscript-list Functions to get information about an entity, such as its team, up vector, velocity, and status. ```APIDOC ## Entity Information Retrieval ### GetTeam - **Description**: Get the team number of this entity. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **teamNumber** (int) - The team number of the entity. ### GetTeamNumber - **Description**: Get the team number of this entity. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **teamNumber** (int) - The team number of the entity. ### GetUpVector - **Description**: Get the up vector of the entity. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **upVector** (Vector) - The up vector of the entity. ### GetVelocity - **Description**: Get the world space velocity of the entity. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **velocity** (Vector) - The world space velocity of the entity. ### HasAttribute - **Description**: Check if an entity has a particular attribute. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - **_pName_** (string) - Required - The name of the attribute to check. - **Response**: - **Success Response (200)**: - **hasAttribute** (bool) - True if the entity has the attribute, false otherwise. ### IsAlive - **Description**: Check if this entity is alive. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **isAlive** (bool) - True if the entity is alive, false otherwise. ### IsNPC - **Description**: Check if this entity is an CAI_BaseNPC. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **isNPC** (bool) - True if the entity is an CAI_BaseNPC, false otherwise. ### IsPlayerController - **Description**: Check if this entity is a player controller. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **isPlayerController** (bool) - True if the entity is a player controller, false otherwise. ### IsPlayerPawn - **Description**: Check if this entity is a player pawn. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **isPlayerPawn** (bool) - True if the entity is a player pawn, false otherwise. ### NextMovePeer - **Description**: Return the next entity in the same movement hierarchy. - **Method**: GET - **Endpoint**: N/A (Method signature) - **Parameters**: - None - **Response**: - **Success Response (200)**: - **nextEntityHandle** (handle) - A handle to the next entity in the movement hierarchy. ``` -------------------------------- ### CEntityInstance API Source: https://cs2.poggu.me/dumped-data/vscript-list Functions for managing entity I/O connections, attributes, and scope. ```APIDOC ## CEntityInstance API ### Description Functions for managing entity I/O connections, attributes, and scope. ### ConnectOutput #### Signature `void ConnectOutput( string _output_ , string _functionName_ )` #### Description Adds an I/O connection that will call the named function on this entity when the specified output fires. ### Destroy #### Signature `void Destroy( )` #### Description Destroys the entity instance. ### DisconnectOutput #### Signature `void DisconnectOutput( string _output_ , string _functionName_ )` #### Description Removes a connected script function from an I/O event on this entity. ### DisconnectRedirectedOutput #### Signature `void DisconnectRedirectedOutput( string _output_ , string _functionName_ , handle _entity_ )` #### Description Removes a connected script function from an I/O event on the passed entity. ### FireOutput #### Signature `void FireOutput( string _outputName_ , handle _activator_ , handle _caller_ , table _parameters_ , float _delay_ )` #### Description Fire an entity output. ### GetClassname #### Signature `string GetClassname( )` #### Description Gets the classname of the entity. ### GetDebugName #### Signature `string GetDebugName( )` #### Description Get the entity name w/help if not defined (i.e. classname/etc). ### GetEntityHandle #### Signature `ehandle GetEntityHandle( )` #### Description Get the entity as an EHANDLE. ### GetEntityIndex #### Signature `int GetEntityIndex( )` #### Description Gets the entity's index. ### GetIntAttr #### Signature `int GetIntAttr( string _key_ )` #### Description Get Integer Attribute. ### GetName #### Signature `string GetName( )` #### Description Gets the name of the entity. ### GetOrCreatePrivateScriptScope #### Signature `handle GetOrCreatePrivateScriptScope( )` #### Description Retrieve, creating if necessary, the private per-instance script-side data associated with an entity. ### GetOrCreatePublicScriptScope #### Signature `handle GetOrCreatePublicScriptScope( )` #### Description Retrieve, creating if necessary, the public script-side data associated with an entity. ### GetPrivateScriptScope #### Signature `handle GetPrivateScriptScope( )` #### Description Retrieve the private per-instance script-side data associated with an entity. ### GetPublicScriptScope #### Signature `handle GetPublicScriptScope( )` #### Description Retrieve the public script-side data associated with an entity. ### RedirectOutput #### Signature `void RedirectOutput( string _output_ , string _functionName_ , handle _entity_ )` #### Description Adds an I/O connection that will call the named function on the passed entity when the specified output fires. ### RemoveSelf #### Signature `void RemoveSelf( )` #### Description Delete this entity. ### SetIntAttr #### Signature `void SetIntAttr( string _key_ , int _value_ )` #### Description Set Integer Attribute. ### entindex #### Signature `int entindex( )` #### Description Gets the entity index. ``` -------------------------------- ### CBasePlayerPawn API Source: https://cs2.poggu.me/dumped-data/vscript-list Provides functions for player pawns, including weapon information and movement mode. ```APIDOC ## CBasePlayerPawn Functions ### GetController Returns the controller associated with this pawn. - **Method**: N/A (Function within a class) - **Returns**: `handle` - The player controller handle. ### GetEquippedWeapons Returns an array of all currently equipped weapons. - **Method**: N/A (Function within a class) - **Returns**: `table` - An array of equipped weapons. ### GetWeaponCount Gets the number of weapons currently equipped. - **Method**: N/A (Function within a class) - **Returns**: `int` - The count of equipped weapons. ### IsNoclipping Returns true if the player is in noclip mode, false otherwise. - **Method**: N/A (Function within a class) - **Returns**: `bool` - True if in noclip mode, false otherwise. ``` -------------------------------- ### Convars API Source: https://cs2.poggu.me/dumped-data/vscript-list Functions for interacting with console variables (convars), including getting, setting, and registering them. ```APIDOC ## Convars ### Description Functions for managing and querying console variables (convars). ### Functions #### GetBool * **Signature**: `bool GetBool( string _name_ )` * **Description**: Returns the convar as a boolean flag. #### GetCommandClient * **Signature**: `handle GetCommandClient( )` * **Description**: Returns the player who issued this console command. #### GetFloat * **Signature**: `float GetFloat( string _name_ )` * **Description**: Returns the convar as a float. May return null if no such convar. #### GetInt * **Signature**: `int GetInt( string _name_ )` * **Description**: Returns the convar as an int. May return null if no such convar. #### GetStr * **Signature**: `string GetStr( string _name_ )` * **Description**: Returns the convar as a string. May return null if no such convar. #### RegisterCommand * **Signature**: `void RegisterCommand( string _name_, handle _function_, string _helpString_, int _flags_ )` * **Description**: Registers a console command. #### RegisterConvar * **Signature**: `void RegisterConvar( string _name_, string _defaultValue_, string _helpString_, int _flags_ )` * **Description**: Registers a new console variable. #### SetBool * **Signature**: `void SetBool( string _name_, bool _val_ )` * **Description**: Sets the value of the convar to the bool. #### SetFloat * **Signature**: `void SetFloat( string _name_, float _val_ )` * **Description**: Sets the value of the convar to the float. #### SetInt * **Signature**: `void SetInt( string _name_, int _val_ )` * **Description**: Sets the value of the convar to the int. #### SetStr * **Signature**: `void SetStr( string _name_, string _val_ )` * **Description**: Sets the value of the convar to the string. ``` -------------------------------- ### Create and Navigate to AlliedModders Directory Source: https://cs2.poggu.me/metamod/compilation/linux This command creates a new directory named 'alliedmodders' and then changes the current directory to it. This is the initial step for organizing the project files. ```bash mkdir alliedmodders cd alliedmodders ``` -------------------------------- ### CPointClientUIWorldPanel API Source: https://cs2.poggu.me/dumped-data/vscript-list Handles user interaction and appearance of world-space UI panels, including input handling and CSS class management. ```APIDOC ## CPointClientUIWorldPanel API ### Description Manages world-space UI panels, controlling user input, CSS styling, and grabbable properties. ### Methods - **AcceptUserInput** - Description: Tells the panel to accept user input. - Signature: `void AcceptUserInput()` - **AddCSSClasses** - Description: Adds CSS class(es) to the panel. - Signature: `void AddCSSClasses(string _pszClasses_)` - **IgnoreUserInput** - Description: Tells the panel to ignore user input. - Signature: `void IgnoreUserInput()` - **IsGrabbable** - Description: Returns whether this entity is grabbable. - Signature: `bool IsGrabbable()` - **RemoveCSSClasses** - Description: Remove CSS class(es) from the panel. - Signature: `void RemoveCSSClasses(string _pszClasses_)` ``` -------------------------------- ### QAngle API Source: https://cs2.poggu.me/dumped-data/vscript-list Documentation for the QAngle type, including its constructor, operators, and member functions. ```APIDOC ## QAngle API ### Description Represents an angle in 3D space (pitch, yaw, roll). ### Functions - **constructor** `QAngle( float _pitch_ , float _yaw_ , float _roll_ )` Creates a new QAngle. - **__add** `QAngle __add( QAngle _a_ , QAngle _b_ )` Adds two QAngles together. Overloaded with + operator. Use RotateOrientation() instead to properly rotate angles. - **__eq** `bool __eq( QAngle _a_ , QAngle _b_ )` Tests for equality. Overloaded with == operator. - **__tostring** `string __tostring( )` Converts the QAngle into a string. Overloaded with .. operator. - **Forward** `Vector Forward( )` Returns the forward Vector. - **Left** `Vector Left( )` Returns the left Vector. - **Up** `Vector Up( )` Returns the Up Vector. ### Members - **x** (float) - Pitch angle - **y** (float) - Yaw angle - **z** (float) - Roll angle ``` -------------------------------- ### CPointTemplate API Source: https://cs2.poggu.me/dumped-data/vscript-list Manages entity spawning and callbacks for point templates, allowing for dynamic entity creation and management. ```APIDOC ## CPointTemplate API ### Description Manages point templates for spawning entities. Allows for spawning entities, retrieving spawned entities, and setting spawn callbacks. ### Methods - **DeleteCreatedSpawnGroups** - Description: Deletes any spawn groups that this point_template has spawned. Note: The point_template will not be deleted by this. - Signature: `void DeleteCreatedSpawnGroups()` - **ForceSpawn** - Description: Spawns all of the entities the point_template is pointing at. - Signature: `void ForceSpawn()` - **GetSpawnedEntities** - Description: Get the list of the most recent spawned entities. - Signature: `handle GetSpawnedEntities()` - **SetSpawnCallback** - Description: Set a callback for when the template spawns entities. The spawned entities will be passed in as an array. - Signature: `void SetSpawnCallback(handle _hCallbackFunc_, handle _hCallbackScope_)` ``` -------------------------------- ### Set Environment Variables for Build Paths Source: https://cs2.poggu.me/metamod/compilation/windows These commands set persistent environment variables for the HL2SDKCS2 and MMSOURCE112 paths, which are crucial for the build process to locate the necessary game-specific files and the Metamod:Source directory. ```batch setx HL2SDKCS2 C:/absolute/path/to/hl2sdk-root/hl2sdk-cs2 setx MMSOURCE112 C:/absolute/path/to/metamod-source ``` -------------------------------- ### CBaseEntity Methods Source: https://cs2.poggu.me/dumped-data/vscript-list This section details the various methods available for CBaseEntity objects, covering entity properties, transformations, and interactions. ```APIDOC ## CBaseEntity Methods ### AddEffects Adds the render effect flag. ### Method `void` ### Endpoint `AddEffects( int _nFlags_ )` ### Parameters #### Path Parameters - **_nFlags_** (int) - Description: Render effect flag to add. ### Response #### Success Response (200) - **void** - No return value. --- ## ApplyAbsVelocityImpulse Apply a Velocity Impulse. ### Method `void` ### Endpoint `ApplyAbsVelocityImpulse( Vector _vecImpulse_ )` ### Parameters #### Path Parameters - **_vecImpulse_** (Vector) - Description: The impulse vector to apply. ### Response #### Success Response (200) - **void** - No return value. --- ## ApplyLocalAngularVelocityImpulse Apply an Ang Velocity Impulse. ### Method `void` ### Endpoint `ApplyLocalAngularVelocityImpulse( Vector _angImpulse_ )` ### Parameters #### Path Parameters - **_angImpulse_** (Vector) - Description: The angular impulse vector to apply. ### Response #### Success Response (200) - **void** - No return value. --- ## Attribute_GetFloatValue Get float value for an entity attribute. ### Method `float` ### Endpoint `Attribute_GetFloatValue( string _pName_ , float _flDefault_ )` ### Parameters #### Path Parameters - **_pName_** (string) - Description: The name of the attribute. - **_flDefault_** (float) - Description: The default value to return if the attribute is not found. ### Response #### Success Response (200) - **float** - The float value of the attribute. --- ## Attribute_GetIntValue Get int value for an entity attribute. ### Method `int` ### Endpoint `Attribute_GetIntValue( string _pName_ , int _nDefault_ )` ### Parameters #### Path Parameters - **_pName_** (string) - Description: The name of the attribute. - **_nDefault_** (int) - Description: The default value to return if the attribute is not found. ### Response #### Success Response (200) - **int** - The int value of the attribute. --- ## Attribute_SetFloatValue Set float value for an entity attribute. ### Method `void` ### Endpoint `Attribute_SetFloatValue( string _pName_ , float _flValue_ )` ### Parameters #### Path Parameters - **_pName_** (string) - Description: The name of the attribute. - **_flValue_** (float) - Description: The float value to set. ### Response #### Success Response (200) - **void** - No return value. --- ## Attribute_SetIntValue Set int value for an entity attribute. ### Method `void` ### Endpoint `Attribute_SetIntValue( string _pName_ , int _nValue_ )` ### Parameters #### Path Parameters - **_pName_** (string) - Description: The name of the attribute. - **_nValue_** (int) - Description: The int value to set. ### Response #### Success Response (200) - **void** - No return value. --- ## DeleteAttribute Delete an entity attribute. ### Method `void` ### Endpoint `DeleteAttribute( string _pName_ )` ### Parameters #### Path Parameters - **_pName_** (string) - Description: The name of the attribute to delete. ### Response #### Success Response (200) - **void** - No return value. --- ## EmitSound Plays a sound from this entity. ### Method `void` ### Endpoint `EmitSound( string _soundname_ )` ### Parameters #### Path Parameters - **_soundname_** (string) - Description: The name of the sound to play. ### Response #### Success Response (200) - **void** - No return value. --- ## EmitSoundParams Plays/modifies a sound from this entity. Changes sound if nPitch and/or flVol or flSoundTime is > 0. ### Method `void` ### Endpoint `EmitSoundParams( string _soundname_ , int _nPitch_ , float _flVolume_ , float _flDelay_ )` ### Parameters #### Path Parameters - **_soundname_** (string) - Description: The name of the sound to play. - **_nPitch_** (int) - Description: The pitch of the sound (0 to 255). - **_flVolume_** (float) - Description: The volume of the sound (0.0 to 1.0). - **_flDelay_** (float) - Description: The delay before playing the sound. ### Response #### Success Response (200) - **void** - No return value. --- ## EyeAngles Get the qangles that this entity is looking at. ### Method `QAngle` ### Endpoint `EyeAngles( )` ### Parameters None ### Response #### Success Response (200) - **QAngle** - The eye angles of the entity. --- ## EyePosition Get vector to eye position - absolute coords. ### Method `Vector` ### Endpoint `EyePosition( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The eye position of the entity. --- ## FirstMoveChild If in hierarchy, get the first move child. ### Method `handle` ### Endpoint `FirstMoveChild( )` ### Parameters None ### Response #### Success Response (200) - **handle** - The handle to the first move child, or null if none. --- ## FollowEntity Sets an entity to follow another entity. ### Method `void` ### Endpoint `FollowEntity( handle _hEnt_ , bool _bBoneMerge_ )` ### Parameters #### Path Parameters - **_hEnt_** (handle) - Description: The entity to follow. - **_bBoneMerge_** (bool) - Description: Whether to merge bones during following. ### Response #### Success Response (200) - **void** - No return value. --- ## FollowEntityMerge Sets an entity to follow another entity, specifying a bone or attachment name for merging. ### Method `void` ### Endpoint `FollowEntityMerge( handle _hEnt_ , string _pszBoneOrAttachName_ )` ### Parameters #### Path Parameters - **_hEnt_** (handle) - Description: The entity to follow. - **_pszBoneOrAttachName_** (string) - Description: The name of the bone or attachment to merge. ### Response #### Success Response (200) - **void** - No return value. --- ## GatherCriteria 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. ### Method `void` ### Endpoint `GatherCriteria( handle _hResult_ )` ### Parameters #### Path Parameters - **_hResult_** (handle) - Description: A handle to store the criteria results. ### Response #### Success Response (200) - **void** - No return value. --- ## GetAbsOrigin Returns the world space origin of the entity. ### Method `Vector` ### Endpoint `GetAbsOrigin( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The world space origin of the entity. --- ## GetAbsScale Get the absolute entity scale. ### Method `float` ### Endpoint `GetAbsScale( )` ### Parameters None ### Response #### Success Response (200) - **float** - The absolute scale of the entity. --- ## GetAngles Get the entity pitch, yaw, roll as QAngle. ### Method `QAngle` ### Endpoint `GetAngles( )` ### Parameters None ### Response #### Success Response (200) - **QAngle** - The angles of the entity. --- ## GetAnglesAsVector Get entity pitch, yaw, roll as a Vector. ### Method `Vector` ### Endpoint `GetAnglesAsVector( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The angles of the entity as a Vector. --- ## GetAngularVelocity Get the local angular velocity - returns a Vector of pitch,yaw,roll. ### Method `Vector` ### Endpoint `GetAngularVelocity( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The local angular velocity of the entity. --- ## GetBaseVelocity Get Base? velocity. ### Method `Vector` ### Endpoint `GetBaseVelocity( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The base velocity of the entity. --- ## GetBoundingMaxs Get a vector containing max bounds, centered on object. ### Method `Vector` ### Endpoint `GetBoundingMaxs( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The maximum bounds of the entity. --- ## GetBoundingMins Get a vector containing min bounds, centered on object. ### Method `Vector` ### Endpoint `GetBoundingMins( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The minimum bounds of the entity. --- ## GetBounds Get a table containing the 'Mins' & 'Maxs' vector bounds, centered on object. ### Method `table` ### Endpoint `GetBounds( )` ### Parameters None ### Response #### Success Response (200) - **table** - A table containing the min and max bounds of the entity. --- ## GetCenter Get vector to center of object - absolute coords. ### Method `Vector` ### Endpoint `GetCenter( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The center coordinates of the entity. --- ## GetChildren Get the entities parented to this entity. ### Method `handle` ### Endpoint `GetChildren( )` ### Parameters None ### Response #### Success Response (200) - **handle** - A handle to the first child entity, or null if none. --- ## GetContext Looks up a context and returns it if available. May return string, float, or null (if the context isn't found). ### Method `table` ### Endpoint `GetContext( string _name_ )` ### Parameters #### Path Parameters - **_name_** (string) - Description: The name of the context to retrieve. ### Response #### Success Response (200) - **table** - The context value, which can be a string, float, or null. --- ## GetForwardVector Get the forward vector of the entity. ### Method `Vector` ### Endpoint `GetForwardVector( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The forward vector of the entity. --- ## GetHealth Get the health of this entity. ### Method `int` ### Endpoint `GetHealth( )` ### Parameters None ### Response #### Success Response (200) - **int** - The current health of the entity. --- ## GetLeftVector Get the left vector of the entity. ### Method `Vector` ### Endpoint `GetLeftVector( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The left vector of the entity. --- ## GetLocalAngles Get entity local pitch, yaw, roll as a QAngle. ### Method `QAngle` ### Endpoint `GetLocalAngles( )` ### Parameters None ### Response #### Success Response (200) - **QAngle** - The local angles of the entity. --- ## GetLocalAngularVelocity Maybe local angvel. ### Method `QAngle` ### Endpoint `GetLocalAngularVelocity( )` ### Parameters None ### Response #### Success Response (200) - **QAngle** - The local angular velocity of the entity. --- ## GetLocalOrigin Get entity local origin as a Vector. ### Method `Vector` ### Endpoint `GetLocalOrigin( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The local origin of the entity. --- ## GetLocalScale Get the entity scale relative to that of its parent. ### Method `float` ### Endpoint `GetLocalScale( )` ### Parameters None ### Response #### Success Response (200) - **float** - The local scale of the entity. --- ## GetLocalVelocity Get Entity relative velocity. ### Method `Vector` ### Endpoint `GetLocalVelocity( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The local velocity of the entity. --- ## GetMass Get the mass of an entity. (returns 0 if it doesn't have a physics object). ### Method `float` ### Endpoint `GetMass( )` ### Parameters None ### Response #### Success Response (200) - **float** - The mass of the entity. --- ## GetMaxHealth Get the maximum health of this entity. ### Method `int` ### Endpoint `GetMaxHealth( )` ### Parameters None ### Response #### Success Response (200) - **int** - The maximum health of the entity. --- ## GetModelName Returns the name of the model. ### Method `string` ### Endpoint `GetModelName( )` ### Parameters None ### Response #### Success Response (200) - **string** - The name of the model. --- ## GetMoveParent If in hierarchy, retrieves the entity's parent. ### Method `handle` ### Endpoint `GetMoveParent( )` ### Parameters None ### Response #### Success Response (200) - **handle** - The handle to the parent entity, or null if none. --- ## GetOrigin Returns this entity's local origin. ### Method `Vector` ### Endpoint `GetOrigin( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The local origin of the entity. --- ## GetOwner Gets this entity's owner. ### Method `handle` ### Endpoint `GetOwner( )` ### Parameters None ### Response #### Success Response (200) - **handle** - The handle to the owner entity, or null if none. --- ## GetOwnerEntity Get the owner entity, if there is one. ### Method `handle` ### Endpoint `GetOwnerEntity( )` ### Parameters None ### Response #### Success Response (200) - **handle** - The handle to the owner entity, or null if none. --- ## 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). ### Method `Vector` ### Endpoint `GetRightVector( )` ### Parameters None ### Response #### Success Response (200) - **Vector** - The right vector of the entity. --- ## GetRootMoveParent If in hierarchy, walks up the hierarchy to find the root parent. ### Method `handle` ### Endpoint `GetRootMoveParent( )` ### Parameters None ### Response #### Success Response (200) - **handle** - The handle to the root parent entity, or null if none. --- ## GetSoundDuration Returns float duration of the sound. Takes soundname and optional actormodelname. ### Method `float` ### Endpoint `GetSoundDuration( string _soundname_ , string _actormodel_ )` ### Parameters #### Path Parameters - **_soundname_** (string) - Description: The name of the sound. - **_actormodel_** (string) - Optional. Description: The name of the actor model. ### Response #### Success Response (200) - **float** - The duration of the sound. --- ## GetSpawnGroupHandle Returns the spawn group handle of this entity. ### Method `int` ### Endpoint `GetSpawnGroupHandle( )` ### Parameters None ### Response #### Success Response (200) - **int** - The spawn group handle of the entity. ``` -------------------------------- ### Physics and Tracing Functions Source: https://cs2.poggu.me/dumped-data/vscript-list Functions related to physics simulation and raycasting/tracing in the game world. ```APIDOC ## SplineQuaternions /Quaternion SplineQuaternions( Quaternion _q0_ , Quaternion _q1_ , float _t_ ) ### Description Performs basic interpolation between two quaternions (q0 to q1) over a time factor 't' ranging from 0 to 1. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **_q0_** (Quaternion) - Required - The starting quaternion. - **_q1_** (Quaternion) - Required - The ending quaternion. - **_t_** (float) - Required - The interpolation factor, typically between 0.0 and 1.0. ### Request Example ``` local interpolatedQ = SplineQuaternions(startQ, endQ, 0.5) ``` ### Response #### Success Response (Quaternion) - **Quaternion** - The interpolated quaternion. #### Response Example ``` -- Returns an interpolated Quaternion object ``` ``` ```APIDOC ## SplineVectors /Vector SplineVectors( Vector _v0_ , Vector _v1_ , float _t_ ) ### Description Performs basic interpolation between two vectors (v0 to v1) over a time factor 't' ranging from 0 to 1. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **_v0_** (Vector) - Required - The starting vector. - **_v1_** (Vector) - Required - The ending vector. - **_t_** (float) - Required - The interpolation factor, typically between 0.0 and 1.0. ### Request Example ``` local interpolatedV = SplineVectors(startV, endV, 0.75) ``` ### Response #### Success Response (Vector) - **Vector** - The interpolated vector. #### Response Example ``` -- Returns an interpolated Vector object ``` ``` ```APIDOC ## TraceCollideable /bool TraceCollideable( table _parameters_ ) ### Description Performs a trace against a collideable object. Takes a table of parameters including start, end, entity, and optional mins/maxs. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **_parameters_** (table) - Required - A table containing trace parameters: - **start** (Vector) - Required - The start position of the trace. - **end** (Vector) - Required - The end position of the trace. - **ent** (handle) - Required - The entity to trace against. - **mins** (Vector) - Optional - Minimum bounds for the trace. - **maxs** (Vector) - Optional - Maximum bounds for the trace. Outputs available in the trace result table: pos, fraction, hit, startsolid, normal. ### Request Example ``` local traceParams = { start = Vector(0,0,0), end = Vector(100,0,0), ent = world, mins = Vector(-10,-10,-10), maxs = Vector(10,10,10) } local traceResult = TraceCollideable(traceParams) if traceResult.hit then print("Hit at: " .. tostring(traceResult.pos)) end ``` ### Response #### Success Response (bool) - **bool** - True if the trace hit something, false otherwise. #### Response Example ``` -- Returns true or false. -- If true, the 'traceResult' table will contain: -- pos (Vector): The impact position. -- fraction (float): The fraction of the trace distance traveled. -- hit (bool): True if a hit occurred. -- startsolid (bool): True if the start position was inside the collideable. -- normal (Vector): The surface normal at the impact point. ``` ``` ```APIDOC ## TraceHull /bool TraceHull( table _parameters_ ) ### Description Performs a hull trace in the game world. Takes a table of parameters including start, end, hull size, mask, and entities to ignore. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **_parameters_** (table) - Required - A table containing trace parameters: - **start** (Vector) - Required - The start position of the trace. - **end** (Vector) - Required - The end position of the trace. - **min** (Vector) - Required - The minimum bounds of the hull. - **max** (Vector) - Required - The maximum bounds of the hull. - **mask** (int) - Required - Collision mask to use for the trace. - **ignore** (handle or table) - Optional - Entity or list of entities to ignore during the trace. Outputs available in the trace result table: pos, fraction, hit, enthit, startsolid. ### Request Example ``` local traceParams = { start = Vector(0,0,0), end = Vector(500,0,0), min = Vector(-5,-5,-5), max = Vector(5,5,5), mask = MASK_SOLID } local traceResult = TraceHull(traceParams) if traceResult.hit then print("Hit entity: " .. tostring(traceResult.enthit)) end ``` ### Response #### Success Response (bool) - **bool** - True if the trace hit something, false otherwise. #### Response Example ``` -- Returns true or false. -- If true, the 'traceResult' table will contain: -- pos (Vector): The impact position. -- fraction (float): The fraction of the trace distance traveled. -- hit (bool): True if a hit occurred. -- enthit (handle): The handle of the entity hit. -- startsolid (bool): True if the start position was inside a solid. ``` ``` ```APIDOC ## TraceLine /bool TraceLine( table _parameters_ ) ### Description Performs a line trace (raycast) in the game world. Takes a table of parameters including start and end positions, mask, and optional entities to ignore. ### Method N/A (Function call) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **_ ``` -------------------------------- ### CNativeOutputs API Source: https://cs2.poggu.me/dumped-data/vscript-list Provides functionalities for managing native outputs, including creation, adding outputs with descriptions, and initialization. ```APIDOC ## CNativeOutputs API ### Description Manages native outputs for scripting. Allows adding outputs with descriptions and initializing the output system. ### Methods - **constructor** - Description: Creates a new CNativeOutputs object. - Signature: `CNativeOutputs()` - **AddOutput** - Description: Add an output with a specified name and description. - Signature: `void AddOutput(string _outputName_, string _description_)` - **Init** - Description: Initialize the output system with a specified number of outputs. - Signature: `void Init(int _numOutputs_)` ``` -------------------------------- ### CBasePlayerController API Source: https://cs2.poggu.me/dumped-data/vscript-list Provides functions related to player controllers. ```APIDOC ## CBasePlayerController Functions ### GetPawn Returns the pawn associated with this controller. - **Method**: N/A (Function within a class) - **Returns**: `handle` - The player pawn handle. ``` -------------------------------- ### Player Sound and Game State Source: https://cs2.poggu.me/dumped-data/game-events Endpoints related to player sounds, game phase changes, and HLTV replay status. ```APIDOC ## player_sound ### Description Records a player-initiated sound event. ### Method Not Applicable (Event Trigger) ### Endpoint `/events/player_sound` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **playercontroller** (object) - Reference to the player controller. - **userid** (string) - Unique identifier for the user. - **radius** (long) - Radius of the sound. - **duration** (float) - Duration of the sound. - **step** (bool) - Whether the sound is a step. - **userid_pawn** (strict_ehandle) - Handle to the player's pawn. ### Request Example ```json { "playercontroller": "", "userid": "user123", "radius": 100, "duration": 5.0, "step": true, "userid_pawn": "" } ``` ### Response #### Success Response (200) No response data, event is logged. ### Response Example ```json {} ``` ## game_phase_changed ### Description Records a change in the game phase. ### Method Not Applicable (Event Trigger) ### Endpoint `/events/game_phase_changed` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **new_phase** (short) - The new game phase. ### Request Example ```json { "new_phase": 3 } ``` ### Response #### Success Response (200) No response data, event is logged. ### Response Example ```json {} ``` ## hltv_replay_status ### Description Records the status of an HLTV replay. ### Method Not Applicable (Event Trigger) ### Endpoint `/events/hltv_replay_status` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **reason** (long) - The reason for the HLTV replay status change. ### Request Example ```json { "reason": 1 } ``` ### Response #### Success Response (200) No response data, event is logged. ### Response Example ```json {} ``` ```