VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Player.cpp
Go to the documentation of this file.
3
4namespace VoltMod
5{
6
8{
9 return _entities ? _entities->Controller(_slot) : VoltMod::Controller{};
10}
11
13{
14 return _entities ? _entities->Pawn(_slot) : VoltMod::Pawn{};
15}
16
17std::string Player::Name() const
18{
19 if (_entities)
20 {
21 // The controller carries the live scoreboard name. It is empty before the player has a
22 // controller, and the engine also reports an empty name for a moment around connect.
23 if (const VoltMod::Controller controller = _entities->Controller(_slot))
24 {
25 std::string live(controller.PlayerName());
26 if (!live.empty())
27 {
28 return live;
29 }
30 }
31 }
32 return _connectName;
33}
34
35} // namespace VoltMod
A player's identity behind a slot: name, money, team, scoreboard row. It survives death and respawn; ...
VoltMod::Controller Controller(int slot)
VoltMod::Pawn Pawn(int slot)
A player's body: health, armor, movement, aim, weapons. The engine replaces it on every spawn; the Co...
Definition Pawn.hpp:19
VoltMod::Pawn Pawn() const
Definition Player.cpp:12
std::string Name() const
Definition Player.cpp:17
VoltMod::Controller Controller() const
Definition Player.cpp:7
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56