SetPlayerMapIcon

From SA-MP Wiki

Jump to: navigation, search


This function allows you to place your own icons on the map, enabling you to emphasise the locations of banks, airports or whatever else you want. A total of 63 icons are available in GTA: San Andreas, all of which can be used using this function. You can also specify the color of the icon, which allows you to change the white square icon (ID: 0)


Parameters:
(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style)
playeridThe ID of the player to set the map icon for.
iconidThe player's icon ID, ranging from 0 to 99, to be used in RemovePlayerMapIcon.
Float:xThe X coordinate of the place where you want the icon to be.
Float:yThe Y coordinate of the place where you want the icon to be.
Float:zThe Z coordinate of the place where you want the icon to be.
markertypeThe icon to set.
colorThe color of the icon, this should only be used with the square icon (ID: 0).
styleThe style of icon.


ReturnsThis function returns 1 if it was successful, and 0 otherwise (e.g. the player isn't connected).


Image:32px-Ambox_warning_orange.png Note: If you use an invalid icon ID, it will create ID 1 (White Square)


Image:32px-Circle-style-warning.png Important Note: You can only have 100 mapicons!


public OnPlayerConnect( playerid )
{
    // This example demonstrates how to create a dollar-icon on top of a 24/7 located
    // in Las Venturas. This way new players know where to go with their money!
    SetPlayerMapIcon( playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0, MAPICON_LOCAL );
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Personal tools
In other languages