OnMapChange

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

This type of event is mainly used for handling code when the server changes map for a gamemode.

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.onMapChange += OnMapChangeHandler;
   }

Usage example(s)

   private void OnMapChangeHandler(string mapName, XmlGroup map)
   {
      API.sendChatMessageToAll("SERVER MAP CHANGED!");
   }

References