From GT-MP
Jump to: navigation, search
Shared Function
Utilities-terminal.png Server-Side System-users.png Client-Side
Csharp.png C# Javascript.png JavaScript

You can change the type of the marker with this function.


API.setMarkerType(NetHandle marker, int type);

Required Arguments

  • marker: parameter input should be in NetHandle type.
  • type: parameter input should be in int type. See Marker.

Usage example(s)

// A simple command to change the type of the given marker (server-side, C#)
public void changeMarkerType(Client player, int markerID, int newMarkerType)
	bool isMarkerFound = false;

    if(newMarkerType > 31 || newMarkerType < 0)
		API.sendChatMessageToPlayer(player, "Error", "There is no such marker type.");

    List<NetHandle> markerList = API.getAllMarkers();
    foreach(NetHandle currentMarker in markerList)
        if(markerID == API.getEntityData(currentMarker, "markerID"))
            // we found the wanted marker
            API.setMarkerType(currentMarker, newMarkerType);
            isMarkerFound = true;

    if(isMarkerFound == false)
        // so we did not find the marker
        API.sendChatMessageToPlayer(player, "Error", "There is no marker with the given ID.");