CityRP Documentation Repository

core.plugins.admin.sv_init

Serverside Administration Module

Functions

Servercityrp.acommands.adminChat(ply, text)Source ☍

Send a message to admin chat. Also adds the message to cross-server chat.

Parameters

  • plyanyPlayer / Pseudoplayer sending the message.
  • textanyThe message to be sent.
Servercityrp.acommands.adminDo(admin, text, icon, cmdType)Source ☍

Send an admin echo.

Parameters

  • adminanyThe running the echo.
  • textanyThe text of the echo.
  • iconanyThe icon for the echo.
  • cmdTypeanyThe ADMINCMD_ enumeration for the type of the command.
Servercityrp.acommands.adminHelp(ply, text)Source ☍

Send a message to moderator chat. Also adds the message to cross-server chat.

Parameters

  • plyanyPlayer / Pseudoplayer sending the message.
  • textanyThe message to be sent.
Servercityrp.acommands.adminOOCChat(ply, text)Source ☍

Sends a message to OOC, using the player's registered name if undercover.

Parameters

  • plyanyPlayer / Pseudoplayer sending the message.
  • textanyThe message to be sent.
Servercityrp.acommands.chatcheck()Source ☍

Recall latest cross-server messages. Automatically called.

Servercityrp.acommands.EchoNoclip(ply, target, enabled)Source ☍

Post the !noclip echo, shared with the noclip key so the two read the same.

Parameters

  • plyPlayerThe player who toggled noclip.
  • targetPlayerThe player whose noclip changed.
  • enabledbooleanIf noclip was turned on.
Servercityrp.acommands.FindPosition(ply) → boolean|unknownSource ☍

Find a position around an entity to be teleported to.

Parameters

  • plyanyThe entity to be teleported to.

Returns

  1. boolean|unknown|| False] The position to be placed at, or false if not found.
Servercityrp.acommands.getAdmins() → tableSource ☍

Get a table of administrators.

Returns

  1. tableList of player entities.
Servercityrp.acommands.getModerators() → tableSource ☍

Get a table of moderators.

Returns

  1. tableList of player entities.
Servercityrp.acommands.GetPlayerByName(name) → boolean|Player|table<number, Player>Source ☍

Get a player by their Steam Name or UserID.

Parameters

  • nameanyName/UserID.

Returns

  1. boolean|Player|table<number, Player>|| entity || nil] Table of entities if multiple found, entity object if single found, nil if none found.
Servercityrp.acommands.GetPlayerBySteamID(steamid) → table|unknownSource ☍

Get a player by their SteamID

Parameters

  • steamidany(Partial) SteamID.

Returns

  1. table|unknown|| entity] Table of entities if multiple found, entity object if single found, empty table.
Servercityrp.acommands.GetPlayerObject(ply, searchTerm) → boolean|Player|table<number, Player>|nilSource ☍

Get a player by the given search-term. Automatically notifies the calling player on failure.

Parameters

  • plyany
  • searchTermany

Returns

  1. boolean|Player|table<number, Player>|nil
Servercityrp.acommands.GetPlayerObjectSilent(ply, searchTerm) → boolean|Player|table<number, Player>, boolean|Player|table<number, Player>|nilSource ☍

Get a player by the given search-term. Doesn't notify the player on failure.

Parameters

  • plyanyPlayer requesting the player.
  • searchTermanyUserID, Name or SteamID to search for.

Returns

  1. 1boolean|Player|table<number, Player>|| entity] nil on failure, entity on succcess.
  2. 2boolean|Player|table<number, Player>|nil
Servercityrp.acommands.getRankSteamID(steamid) → unknownSource ☍

Non-functional.

Parameters

  • steamidany

Returns

  1. unknown
Servercityrp.acommands.GetTPPos(ply, from, to) → unknownSource ☍

Function to get the "landing" position when TPing from point to point.

Parameters

  • plyanyThe player attempting the TP (who gets error messages).
  • fromanyThe entity that is being moved.
  • toanyThe entity being moved to.

Returns

  1. unknown|| nil] Vector when a position is found, nil on failure.
Servercityrp.acommands.helpreply(ply, targ, msg, _)Source ☍

Send a help response to a player.

Parameters

  • plyanyThe player sending the message.
  • targanyThe search param for the player to send a message to.
  • msganyThe first part of the message to send.
  • unknown
Servercityrp.acommands.icIssue(ply, targ, msg, _)Source ☍

Send an "IC Issue" response to a player.

Parameters

  • plyanyThe player sending the message.
  • targanyThe search param for the player to send a message to.
  • msganyThe first part of the message to send.
  • unknown
Servercityrp.acommands.isadmin(sid) → stringSource ☍

Get an administrator's registered name from their Steam ID.

Parameters

  • sidanySteamID to check.

Returns

  1. string|| nil] Registered name, or nil if not registered.
Servercityrp.acommands.ismoderator(sid) → unknownSource ☍

Get a moderator's registered name from their Steam ID.

Parameters

  • sidanySteamID to check.

Returns

  1. unknown|| nil] Registered name, or nil if not registered.
Servercityrp.acommands.phase(ply)Source ☍

Phase a player.

Parameters

  • plyanyThe player to phase.
Servercityrp.acommands.popup(ply, text, tArg)Source ☍

Popup a message on a player's screen.

Parameters

  • plyany
  • textany
  • tArgany
Servercityrp.acommands.precacheadmins()Source ☍

Prefill the admin / moderator cache, for fakename / hidden operations. Automatically called during bootstrap, no need to call again.

Servercityrp.acommands.ProcessTPRestrictions(ply, ent) → boolean|nilSource ☍

Function to process teleport restrictions.

Parameters

  • plyanyThe player attempting to teleport.
  • entanyThe entity being teleported to.

Returns

  1. boolean|nilTruthy or Falsy value, depending if the TP is allowed or barred.
Servercityrp.acommands.queueRemotePM(ply, destServer, targ, msg, cb)Source ☍

Queue a remote PM (or a reply to one) into the shared cross-server chat table. Shared by the !pm command and by /r (and !r, an alias of /r) when replying to a received remote PM.

Parameters

  • plyanyThe player sending the message.
  • destServeranyThe destination server ID to route the message to (the goto column).
  • targanyThe destination player search string (or SteamID, when replying).
  • msganyThe message text.
  • cbanyfunction? Optional callback, called once the row has been written.
Servercityrp.acommands.remotepm(name, steamid, targ, msg, source)Source ☍

Deliver a queued remote (cross-server) private message to a local player. Called automatically by cityrp.acommands.chatcheck() when it finds a queued 'rpm' row in the shared chat table addressed to this server.

Parameters

  • nameanyThe display name of the sender.
  • steamidanyThe SteamID of the sender.
  • targanyThe search string for the local target player.
  • msganyThe message body.
  • sourceanyThe origin server ID, so a reply can be routed back.
Servercityrp.acommands.respond(ply, targ, msg, _)Source ☍

Send an administrative response to a player.

Parameters

  • plyanyThe player sending the message.
  • targanyThe search param for the player to send a message to.
  • msganyThe first part of the message to send.
  • unknown
Servercityrp.acommands.SetRank(ply, rank)Source ☍

Set a player's rank, checking if the rank is a real rank.

Parameters

  • plyanyThe player to set a rank for.
  • rankanyThe rank to set.
Servercityrp.acommands.TPUser(ply, pos)Source ☍

Teleport a user

Parameters

  • plyanyThe player to be teleported.
  • posanyThe position to teleport them to.
Servercityrp.acommands.unphase(ply)Source ☍

Unphase a player.

Parameters

  • plyanyThe player to unphase.

Tables

Serveraccess_setrank_assistantSource ☍
Serveraccess_setrank_fullSource ☍
Serveraccess_setrank_saSource ☍
Servercityrp.acommands.adminsSource ☍
Servercityrp.acommands.modsSource ☍
Servercityrp.acommands.PositionsSource ☍

Fields

ServerADMINCMD_ALWAYSHIDESource ☍

Always Hide

ServerADMINCMD_ALWAYSSHOWSource ☍

Always Show

ServerADMINCMD_FOLLOWHCSource ☍

Follow /hc and !stealth setting.

ServerADMINCMD_FOLLOWPLYSource ☍

Folllow /hc, !stealth and !phase

Servercityrp.acommands.chatlastidSource ☍
Servercityrp.acommands.onRemotePMCooldownSource ☍
Servercityrp.chatBox.oocdisableSource ☍
ServerconsoleSource ☍

Legacy console variable for backwards compatibility.

Deprecated

This function is deprecated and may be removed in a future version.

Use CONSOLE instead. This is maintained for backwards compatibility with any external plugins.