diff --git a/reapi/extra/amxmodx/scripting/include/reapi.inc b/reapi/extra/amxmodx/scripting/include/reapi.inc index a85df6d..56b7760 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi.inc @@ -33,7 +33,8 @@ enum members_tables_e mt_playermove, mt_movevars, mt_usercmd, - mt_pmtrace + mt_pmtrace, + mt_csplayer }; #define MAX_REGION_RANGE 1024 diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index a4421a9..d51d01d 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -1184,7 +1184,31 @@ enum CSGameRules_Members * Get params: get_member_game(member); * Set params: set_member_game(member, value); */ - m_bSkipSpawn + m_bSkipSpawn, + + /* + * Description: - + * Member type: bool + * Get params: get_member_game(member); + * Set params: set_member_game(member, value); + */ + m_bSkipShowMenu, + + /* + * Description: - + * Member type: bool + * Get params: get_member_game(member); + * Set params: set_member_game(member, value); + */ + m_bNeededPlayers, + + /* + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flEscapeRatio }; // CBaseEntity @@ -3835,3 +3859,23 @@ enum PMTrace */ pmt_hitgroup }; + +// CCSPlayer +enum CCSPlayer_Members +{ + /* + * Description: - + * Member type: char [32] + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); + */ + m_szModel = BEGIN_MEMBER_REGION(csplayer), + + /* + * Description: - + * Member type: bool + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + m_bForceShowMenu, +}; diff --git a/reapi/include/cssdk/dlls/gamerules.h b/reapi/include/cssdk/dlls/gamerules.h index 9e868d1..16e01d5 100644 --- a/reapi/include/cssdk/dlls/gamerules.h +++ b/reapi/include/cssdk/dlls/gamerules.h @@ -426,8 +426,12 @@ public: virtual bool IsBombPlanted() = 0; public: + bool ShouldSkipShowMenu() const { return m_bSkipShowMenu; } + void MarkShowMenuSkipped() { m_bSkipShowMenu = false; } + bool ShouldSkipSpawn() const { return m_bSkipSpawn; } void MarkSpawnSkipped() { m_bSkipSpawn = false; } + float TimeRemaining() { return m_iRoundTimeSecs - gpGlobals->time + m_fRoundCount; } bool IsMatchStarted() { return (m_fTeamCount != 0.0f || m_fCareerRoundMenuTime != 0.0f || m_fCareerMatchMenuTime != 0.0f); } @@ -522,6 +526,7 @@ public: bool m_bSkipSpawn; // custom + bool m_bSkipShowMenu; bool m_bNeededPlayers; float m_flEscapeRatio; }; diff --git a/reapi/include/cssdk/dlls/regamedll_interfaces.h b/reapi/include/cssdk/dlls/regamedll_interfaces.h index 63124ca..fc86371 100644 --- a/reapi/include/cssdk/dlls/regamedll_interfaces.h +++ b/reapi/include/cssdk/dlls/regamedll_interfaces.h @@ -51,7 +51,7 @@ class CCSArmoury: public CCSEntity {}; class CCSPlayer: public CCSMonster { public: - CCSPlayer() + CCSPlayer() : m_bForceShowMenu(false) { m_szModel[0] = '\0'; } @@ -90,6 +90,7 @@ public: CBasePlayer *BasePlayer() const; public: char m_szModel[32]; + bool m_bForceShowMenu; }; class CAPI_Bot: public CCSPlayer {}; diff --git a/reapi/src/member_list.cpp b/reapi/src/member_list.cpp index a7ddb18..1b2edd6 100644 --- a/reapi/src/member_list.cpp +++ b/reapi/src/member_list.cpp @@ -13,6 +13,7 @@ #define MOVEVAR_MEMBERS(mx) CLASS_MEMBERS(movevars_t, mx, mv_) #define UCMD_MEMBERS(mx) CLASS_MEMBERS(usercmd_s, mx, ucmd_) #define PMTRACE_MEMBERS(mx) CLASS_MEMBERS(pmtrace_s, mx, pmt_) +#define CSPL_MEMBERS(mx) CLASS_MEMBERS(CCSPlayer, mx,) inline MType getMemberType(float*) { return MEMBER_FLOAT; } inline MType getMemberType(float) { return MEMBER_FLOAT; } @@ -166,6 +167,9 @@ member_t memberlist_gamerules[] = { GM_MEMBERS(m_iRoundWinDifference), GM_MEMBERS(m_fCareerMatchMenuTime), GM_MEMBERS(m_bSkipSpawn), + GM_MEMBERS(m_bSkipShowMenu), + GM_MEMBERS(m_bNeededPlayers), + GM_MEMBERS(m_flEscapeRatio), }; member_t memberlist_base[] = { @@ -659,6 +663,10 @@ member_t memberlist_pmtrace[] = { PMTRACE_MEMBERS(hitgroup) }; +member_t memberlist_csplayer[] = { + CSPL_MEMBERS(m_szModel), + CSPL_MEMBERS(m_bForceShowMenu), +}; memberlist_t memberlist; @@ -680,6 +688,7 @@ member_t *memberlist_t::operator[](size_t members) const CASE(movevars) CASE(usercmd) CASE(pmtrace) + CASE(csplayer) } return nullptr; diff --git a/reapi/src/member_list.h b/reapi/src/member_list.h index b1324f9..78d6eab 100644 --- a/reapi/src/member_list.h +++ b/reapi/src/member_list.h @@ -49,7 +49,8 @@ struct memberlist_t mt_playermove, mt_movevars, mt_usercmd, - mt_pmtrace + mt_pmtrace, + mt_csplayer }; }; @@ -142,7 +143,10 @@ enum CSGameRules_Members m_iCareerMatchWins, m_iRoundWinDifference, m_fCareerMatchMenuTime, - m_bSkipSpawn + m_bSkipSpawn, + m_bSkipShowMenu, + m_bNeededPlayers, + m_flEscapeRatio, }; // CBaseEntity @@ -658,3 +662,10 @@ enum PMTrace pmt_deltavelocity, pmt_hitgroup }; + +// CCSPlayer +enum CSPlayer_Members +{ + m_szModel = BEGIN_MEMBER_REGION(csplayer), + m_bForceShowMenu, +}; diff --git a/reapi/src/natives/natives_members.cpp b/reapi/src/natives/natives_members.cpp index bee1154..c75e20b 100644 --- a/reapi/src/natives/natives_members.cpp +++ b/reapi/src/natives/natives_members.cpp @@ -20,6 +20,16 @@ cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params) cell* value = getAmxAddr(amx, params[arg_value]); size_t element = (PARAMS_COUNT == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0; + const auto table = memberlist_t::members_tables_e(params[arg_member] / MAX_REGION_RANGE); + if (table == memberlist_t::mt_csplayer) { + CBasePlayer *pPlayer = g_ReGameFuncs->UTIL_PlayerByIndex(indexOfEdict(pEdict)); + if (!pPlayer || !pPlayer->CSPlayer()) { + return FALSE; + } + + return set_member(pPlayer->CSPlayer(), member, element, value); + } + return set_member(pEdict->pvPrivateData, member, element, value); } @@ -64,6 +74,16 @@ cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params) element = 0; } + const auto table = memberlist_t::members_tables_e(params[arg_member] / MAX_REGION_RANGE); + if (table == memberlist_t::mt_csplayer) { + CBasePlayer *pPlayer = g_ReGameFuncs->UTIL_PlayerByIndex(indexOfEdict(pEdict)); + if (!pPlayer || !pPlayer->CSPlayer()) { + return FALSE; + } + + return get_member(pPlayer->CSPlayer(), member, element, dest); + } + return get_member(pEdict->pvPrivateData, member, element, dest); }