SetPlayerMapIcon

From SA-MP Wiki

Jump to: navigation, search


Description:

Place an icon/marker on a player's map. Can be used to mark locations such as banks and hospitals to players.


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. This means there is a maximum of 100 map icons. ID can be used in RemovePlayerMapIcon.
Float:xThe X coordinate to place the map icon at.
Float:yThe Y coordinate to place the map icon at.
Float:zThe Z coordinate to place the map icon at.
markertypeThe icon to set.
colorThe color of the icon, as an integer or hex in RGBA color format. This should only be used with the square icon (ID: 0).
styleThe style of icon.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. Player is not connected.


Image:32px-Ambox_warning_orange.png

Notes

  • If you use an invalid marker type, it will create ID 1 (White Square).
  • If you use an icon ID that is already in use, it will replace the current map icon using that ID.


Image:32px-Circle-style-warning.png

Important
Notes

  • You can only have 100 map icons!
  • Marker type 1 (Image:Icon_1.gif), 2 (Image:Icon_2.gif), 4 (Image:Icon_4.gif), and 56 (Image:Icon_56.gif) will cause your game to crash if you have map legends enabled while viewing the map.


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.

In other languages