KickPlayer

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 11:36, 27 August 2026 by QCherry (talk | contribs) (Document 0.1a Lua API, identities, moderation and synchronized spells)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

kickPlayer

Disconnects a player from the server with an optional reason.

Syntax

bool kickPlayer(int playerId [, string reason = "Kicked by the server"])

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
reason string no Optional user-facing disconnect reason.

Returns

Returns true when the kick request is accepted; otherwise returns false.

Examples

Kick a player after a server-side validation failure:

kickPlayer(playerId, "Invalid character state")

Notes

  • Available only in server-side resource scripts.
  • Use resource permissions to restrict administrative commands that call this function.
  • An accepted kick immediately revokes the player's voice session, ends the gameplay connection and closes the game client. The launcher then displays the kick reason.
  • A kick is not persistent. The player may start the game and join again unless a resource or administrator uses banPlayer instead.