2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-03 18:45:36 +03:00
metamod-r/metamod/src/mplayer.h

32 lines
988 B
C
Raw Normal View History

2016-07-26 19:31:47 +03:00
#pragma once
2016-07-26 03:22:47 +03:00
// Info on an individual player
class MPlayer
2016-07-26 03:22:47 +03:00
{
public:
MPlayer();
2017-05-09 19:31:09 +03:00
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
2016-07-26 19:31:47 +03:00
private:
2017-05-09 19:31:09 +03:00
bool m_isQueried; // is this player currently queried for a cvar value
char g_cvarName[64]; // name of the cvar if getting queried
2016-07-26 03:22:47 +03:00
};
// A list of players. The number of max players is fixed and small enough
// to use an array.
class MPlayerList
2016-07-26 19:31:47 +03:00
{
2016-07-26 03:22:47 +03:00
public:
2017-05-09 19:31:09 +03:00
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);
2016-07-26 19:31:47 +03:00
void clear_all_cvar_queries();
2017-05-09 19:31:09 +03:00
const char* is_querying_cvar(const edict_t* pEntity) const;
private:
2017-01-13 03:00:23 +03:00
int m_maxplayers = 32;
2017-05-09 19:31:09 +03:00
MPlayer m_players[MAX_CLIENTS + 1]; // array of players
2016-07-26 03:22:47 +03:00
};