mirror of
https://github.com/rehlds/metamod-r.git
synced 2025-01-01 01:25:53 +03:00
32 lines
988 B
C++
32 lines
988 B
C++
#pragma once
|
|
|
|
// Info on an individual player
|
|
class MPlayer
|
|
{
|
|
public:
|
|
MPlayer();
|
|
|
|
void set_cvar_query(const char* cvar); // mark this player as querying a client cvar
|
|
void clear_cvar_query(const char* cvar = nullptr); // unmark this player as querying a client cvar
|
|
const char* is_querying_cvar() const; // check if a player is querying a cvar. returns
|
|
|
|
private:
|
|
bool m_isQueried; // is this player currently queried for a cvar value
|
|
char g_cvarName[64]; // name of the cvar if getting queried
|
|
};
|
|
|
|
// A list of players. The number of max players is fixed and small enough
|
|
// to use an array.
|
|
class MPlayerList
|
|
{
|
|
public:
|
|
void set_player_cvar_query(const edict_t* pEntity, const char* cvar);
|
|
void clear_player_cvar_query(const edict_t* pEntity, const char* cvar = nullptr);
|
|
void clear_all_cvar_queries();
|
|
const char* is_querying_cvar(const edict_t* pEntity) const;
|
|
|
|
private:
|
|
int m_maxplayers = 32;
|
|
MPlayer m_players[MAX_CLIENTS + 1]; // array of players
|
|
};
|