11#include <tier1/convar.h>
18static_assert(
sizeof(Controller) <= 104,
"Controller is a frame-local value; keep the field list tight.");
22 _pawn =
entities.Get(PlayerPawn()).Raw();
71 if (
command.empty() ||
command.find_first_of(
";\r\n") != std::string_view::npos)
94 Log::Warn(
"Controller: refused client command '{}'; it must be one non-empty command.",
command);
128 return std::unexpected(
Error::Unsupported(
"gamedata has no 'CCSPlayerController::Respawn' vtable index"));
void SetMoney(int amount) const
VoltMod::Pawn InputPawn() const
void ChangeTeam(VoltMod::Team team) const
void Kick(std::string_view reason) const
VoltMod::Pawn Pawn() const
void ExecuteCommand(std::string_view command) const
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
const VoltMod::Bindings & Bindings() const noexcept
Entity Get(EntityRef ref)
const VoltMod::Interfaces & Interfaces() const noexcept
A live entity, valid for this frame only.
CEntityInstance * Raw() const noexcept
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
void Warn(std::format_string< Args... > fmt, Args &&... args)
constexpr bool IsPlaying(Team team)
static std::string ReadFile(const std::filesystem::path &path)
static bool TokenizeOneCommand(std::string_view command, CCommand &args)
constexpr bool IsValidSlot(int slot)
std::expected< void, Error > Status
VirtualFn< void(CEntityInstance *, int)> ChangeTeam
VirtualFn< void(CEntityInstance *)> Respawn
static Error Unsupported(std::string detail)
static Error NotReady(std::string detail)
ISource2GameClients * ServerGameClients