CityRP Documentation Repository

CONSOLE

Console Pseudoplayer Library.

Functions

ServerCONSOLE:Announce(msg)Source ☍

Announce an automated server message in every player's chat, attributed to the console. Rendered through the Discord relay's stand-in player table, so the line carries the console rank's icon and colour rather than the bare "Console: " the engine's say produces. The relay owns that table on both realms, so without it there is nothing clientside to receive the announcement and this falls back to say.

Parameters

  • msgstringThe message to announce.
ServerCONSOLE:ChatPrint(msg)Source ☍

Print a chat message to the console.

Parameters

  • msgstringThe message to print.
ServerCONSOLE:EntIndex() → numberSource ☍

Get the console pseudoplayer's entity index.

Returns

  1. numberAlways returns the WorldIndex
ServerCONSOLE:EventMgr() → booleanSource ☍

Check if the console pseudoplayer is an event manager.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:GetSVRank() → stringSource ☍

Get the console pseudoplayer's server rank.

Returns

  1. stringAlways returns "console".
ServerCONSOLE:HasAccess(tag) → booleanSource ☍

Check if the console pseudoplayer has specific access.

Parameters

  • tagstringThe access tag to check (ignored for console).

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsAdmin() → booleanSource ☍

Check if the console pseudoplayer has admin privileges.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsModerator() → booleanSource ☍

Check if the console pseudoplayer has Moderator permissions.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsModerator2() → booleanSource ☍

Check if the console pseudoplayer has Moderator 2 permissions.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsPlayer() → booleanSource ☍

Check if the console pseudoplayer is a player.

Returns

  1. booleanAlways returns true for compatibility with player checks.
ServerCONSOLE:IsSuperAdmin() → booleanSource ☍

Check if the console pseudoplayer has superadmin privileges.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsTrialMod() → booleanSource ☍

Check if the console pseudoplayer has Trial Moderator permissions.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:IsValid() → booleanSource ☍

Check if the console pseudoplayer is valid.

Returns

  1. booleanAlways returns true.
ServerCONSOLE:Name() → stringSource ☍

Get the console pseudoplayer's name.

Returns

  1. stringAlways returns "Console".
ServerCONSOLE:Notify(msg, class, priority)Source ☍

Send a notification to the console.

Parameters

  • msgstringThe notification message to display.
  • classnumberThe notification class/type.
  • prioritybooleanThe notification priority.
ServerCONSOLE:printMessage(msg)Source ☍

Print a message to the console.

Parameters

  • msgstringThe message to print.
ServerCONSOLE:PrintMessage(msgType, msg)Source ☍

Print a message to the console with a message type.

Parameters

  • msgTypenumberThe message type (unused, for compatibility).
  • msgstringThe message to print.
ServerCONSOLE:SteamID() → stringSource ☍

Get the console pseudoplayer's SteamID.

Returns

  1. stringAlways returns "CONSOLE".

Tables

ServerCONSOLESource ☍

A pseudoplayer table that can be used in place of a regular player for automated server actions. This table implements a subset of the Player metatable methods to allow it to be used where a player object is expected, such as for bans, kicks, or admin commands initiated by the server.

Note: while this table can be used in place of a regular player, it will fail for most regular player operations that require an actual entity (e.g., GetPos(), Spawn(), etc.).

Example usage:

CONSOLE:Name() -- Returns "Console"
cityrp.bans.DoBan(CONSOLE, steamid, nick, 0, reason)
cityrp.acommands.adminDo(CONSOLE, "Server action performed", icon, flags)

Classes

ServerCONSOLESource ☍

A pseudoplayer table that can be used in place of a regular player for automated server actions. This table implements a subset of the Player metatable methods to allow it to be used where a player object is expected, such as for bans, kicks, or admin commands initiated by the server.

Note: while this table can be used in place of a regular player, it will fail for most regular player operations that require an actual entity (e.g., GetPos(), Spawn(), etc.).

Example usage:

CONSOLE:Name() -- Returns "Console"
cityrp.bans.DoBan(CONSOLE, steamid, nick, 0, reason)
cityrp.acommands.adminDo(CONSOLE, "Server action performed", icon, flags)

Fields

ServerCONSOLE.loggerSource ☍

Logger instance for console messages.

ServerCONSOLE.loggerSource ☍

Logger instance for console messages.