CPlayerFuncs::AdminLevel returns the admin level of the given player. Unfortunately, it takes a CBasePlayer@ (like the underlying AdminLevel function it forwards to) so you can't use it in the ClientConnected and CanPlayerUseReservedSlothooks.
Users may want to verify the player's admin level in those hooks to check if they should be allowed to join, which is impossible because it requires a CBasePlayer.
Add an overload that takes an edict_t@ so this can be done. (I'm aware that CBasePlayer's members are accessed when checking for an admin level, just refactor the function into 2 parts so the edict only part at the end can be called at any time)
CPlayerFuncs::AdminLevel
returns the admin level of the given player. Unfortunately, it takes aCBasePlayer@
(like the underlyingAdminLevel
function it forwards to) so you can't use it in theClientConnected
andCanPlayerUseReservedSlot
hooks.Users may want to verify the player's admin level in those hooks to check if they should be allowed to join, which is impossible because it requires a
CBasePlayer
.Add an overload that takes an
edict_t@
so this can be done. (I'm aware thatCBasePlayer
's members are accessed when checking for an admin level, just refactor the function into 2 parts so theedict
only part at the end can be called at any time)