OnPlayerConnected

From GT-MP
Jump to: navigation, search
OnPlayerConnected
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

This type of event is used for handling code after the onPlayerBeginConnect event has completed, this event happens while downloading maps, scripts, etc.

Requirements

First of all, it should be defined in your Main constructor for it to be called, otherwise it wouldn't be initiated at all!

   public Main()
   {
      API.onPlayerConnected += OnPlayerConnectedHandler;
   }

Usage example(s)

   private void OnPlayerConnectedHandler(Client player)
   {
      API.sendChatMessageToPlayer(player, "Welcome to the server, ~g~" + player.name);
   }

References