class CMyEntity : public CBaseEntity { public: void Spawn() override { BaseClass::Spawn(); // Custom spawn logic } void Think() override { BaseClass::Think(); // Custom think logic } };
CBaseEntity* pEntity; // Assume this is set to an existing entity in the game // Get the entity's position Vector position = pEntity->GetAbsOrigin(); // Set the entity's color pEntity->SetRenderColor(255, 0, 0);This example shows how to get the position of an entity using the `GetAbsOrigin` function, and how to set the render color using the `SetRenderColor` function. Package Library: Source SDK