BanPlayer

From GTA Network Wiki
Jump to: navigation, search

BanPlayer
Server-Side Function

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

Bans a player from the server.

Syntax

void NAPI.Player.BanPlayer(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

[Command("banplayer")]
public void BanCommand(Client player, Client target, [RemainingText] string reason)
{
    NAPI.Player.BanPlayer(target, reason);
    NAPI.Chat.SendChatMessageToAll($"{target.name} has been banned by {player.name} for {reason}");
}

Changelog

Version Description
1.0 Release.

References