KickPlayer: Difference between revisions
Jump to navigation
Jump to search
Update Lua API reference |
Complete Lua function catalog |
||
| Line 30: | Line 30: | ||
* Use resource permissions to restrict administrative commands that call this function. | * Use resource permissions to restrict administrative commands that call this function. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
Revision as of 09:54, 15 August 2026
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.