KickPlayer

From GTA Network Wiki
Jump to: navigation, search

KickPlayer
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Kicks a player out of the server.

Syntax

void NAPI.Player.KickPlayer(Client player, string reason = "");

Required arguments

  • player: parameter input should be in Client type.

Optional arguments

  • reason: parameter input should be in string type.

Usage example(s)

[Command("kick", GreedyArg = true)]
public void KickCommand(Client player, Client target, string reason)
{
    NAPI.Player.KickPlayer(target, reason);
    NAPI.Chat.SendChatMessageToAll($"{target.Name} was kicked, reason: {reason}");
}

References