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

API.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

In C#
Server-Side Function

[Command("banplayer", GreedyArg = true)]
   public void Ban(Client player, Client target, string reason)
   {
      API.BanPlayer(target, reason);
      API.SendChatMessageToAll(target.name + " has been banned by "+ player.name + " for " + reason);
   }

Changelog

Version Description
1.0 Release.

References