-
Notifications
You must be signed in to change notification settings - Fork 4
CPlayerFuncs
KernCore edited this page Dec 15, 2020
·
11 revisions
The CPlayerFuncs class contains global player related functionality.
A single Global Instance exists with the following declaration:
const CPlayerFuncs g_PlayerFuncs;This class only contains methods.
| Methods | Description |
|---|---|
| AdminLevel_t AdminLevel(CBasePlayer@ pPlayer) const | Returns the admin level for a given player. Parameters: Player Handle. |
| AdminLevel_t StringToAdminLevel(const string& in szString) const | Converts a string containing one of AdminLevelToString's return values to an admin level. Returns ADMIN_NO if the string cannot be converted to a suitable constant. Parameters: String. |
| string AdminLevelToString(const AdminLevel_t adminLevel) const | Converts the admin level to a string. If the level is an invalid value, an empty string is returned. Parameters: Admin Level (See Admin Level enum). |
| Methods | Description |
|---|---|
| void SayText(CBasePlayer@ pTargetPlayer, const string& in szText) | Says text to a specific player. Parameters: Player Handle, Text String. |
| void SayTextAll(CBasePlayer@ pOriginatingPlayer, const string& in szText) | Says text to all players. Parameters: Originating Player Handle, Text String. |
| Methods | Description |
|---|
| Methods | Description |
|---|---|
| bool CheatsAllowed(CBasePlayer@ pPlayer, const string& in szCheatName, bool fMustBeAlive = true) const | |
| bool GetNextBestWeapon(CBasePlayer@ pPlayer, CBasePlayerItem@ pCurrentWeapon) | |
| bool IsSpawnPointOccupied(CBaseEntity@ pSpawnEnt) | |
| bool IsSpawnPointValid(CBaseEntity@ pSpawnEnt, CBaseEntity@ pPlayer) | |
| bool SpawnPointFilterPasses(CBaseEntity@ pSpawnEnt, CBaseEntity@ pPlayer) | |
| CBasePlayer@ CreateBot(const string& in szName) | |
| CBasePlayer@ FindPlayerByIndex(int index) | Finds a player by index. Parameters: Index Integer |
| CBasePlayer@ FindPlayerByName(const string& in szName, bool bCaseSensitive = true) | |
| float SharedRandomFloat(uint iRandomSeed, float iLow, float iHigh) | |
| int GetAmmoIndex(const string& in szAmmoName) | |
| int GetNumPlayers() const | |
| int SharedRandomLong(uint iRandomSeed, int iLow, int iHigh) | |
| void ApplyMapCfgToPlayer(CBasePlayer@ pPlayer, bool fReEquip = false) | |
| void BotDisconnect(CBasePlayer@ pBot) | |
| void CenterPrintAll(const string& in szMessage, const string& in szLine2 = "", const string& in szLine3 = "", const string& in szLine4 = "", const string& in szLine5 = "") | |
| void ClientPrint(CBasePlayer@ pTargetPlayer, HUD iMsgDest, const string& in szMessage, const string& in szLine2 = "", const string& in szLine3 = "", const string& in szLine4 = "", const string& in szLine5 = "") | Prints one or more messages on the HUD of the given player. Parameters: Target Player Handle, Message Destination (See HUD enum), Message String (1st Line), Message String (2nd Line), Message String (3rd Line), Message String (4th Line), Message String (5th Line). |
| void ClientPrintAll(HUD iMsgDest, const string& in szMessage, const string& in szLine2 = "", const string& in szLine3 = "", const string& in szLine4 = "", const string& in szLine5 = "") | |
| void ConcussionEffect(CBaseEntity@ pEntity, float amplitude, float frequency, float fadeTime) | |
| void HudCustomSprite(CBasePlayer@ pTargetPlayer, const HUDSpriteParams& in params) | |
| void HudMessage(CBasePlayer@ pTargetPlayer, const HUDTextParams& in textParams, const string& in szMessage) | |
| void HudMessageAll(const HUDTextParams& in textParams, const string& in szMessage) | |
| void HudNumDisplay(CBasePlayer@ pTargetPlayer, const HUDNumDisplayParams& in params) | |
| void HudTimeDisplay(CBasePlayer@ pTargetPlayer, const HUDNumDisplayParams& in params) | |
| void HudToggleElement(CBasePlayer@ pTargetPlayer, uint8 iChannel, bool fVisible) | |
| void HudUpdateNum(CBasePlayer@ pTargetPlayer, uint8 iChannel, float flValue) | |
| void HudUpdateTime(CBasePlayer@ pTargetPlayer, uint8 iChannel, float flTime) | |
| void PrintKeyBindingString(CBasePlayer@ pPlayer, const string& in szString) | |
| void PrintKeyBindingStringAll(const string& in szString) | |
| void RespawnAllPlayers(bool fMoveLivingPlayers = true, bool fRespawnDeadPlayers = false) | |
| void RespawnPlayer(CBasePlayer@ pPlayer, bool fMoveLivingPlayers = true, bool fRespawnDeadPlayers = false) |
| void ScreenFade(CBaseEntity@ pEntity, const Vector& in color, float fadeTime, float fadeHold, int alpha, int flags) | | | void ScreenFadeAll(const Vector& in color, float fadeTime, float fadeHold, int alpha, int flags) | | | void ScreenShake(const Vector& in center, float amplitude, float frequency, float duration, float radius) | | | void ScreenShakeAll(const Vector& in center, float amplitude, float frequency, float duration) | | | void ShowMessage(CBasePlayer@ pTargetPlayer, const string& in szString) | | | void ShowMessageAll(const string& in szString) | |
