OnPlayerWaypointChange

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

This event is triggered when a player sets/removes a waypoint.

Dialog-warning.png Note: This feature is currently not in the API, or is currently not accurate on the wiki due to upcoming API changes. New API functions and changes will be released with the next update.

Syntax

In C#
Server-Side Function

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.onPlayerWaypointChange += OnPlayerWaypointChangeHandler;
}

public void OnPlayerWaypointChangeHandler(Client player, bool placed, Vector3 position)
{
    // code
}

Usage example(s)

In C#
Server-Side Function

public void OnPlayerWaypointChangeHandler(Client player, bool placed, Vector3 position)
{
    if (placed)
    {
        API.sendChatMessageToPlayer(player, "You placed a waypoint!");
    }
    else
    {
        API.sendChatMessageToPlayer(player, "You removed your waypoint!");
    }
}

References