SetPlayerMapIcon

From SA-MP Wiki

Jump to: navigation, search

SetPlayerMapIcon


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, of which 62 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: 1)


Parameters:
(playerid, iconid, Float:x, Float:y, Float:z, markertype, color)
playeridThe playerid parameter indicates the player who gets to see the icon.
iconidThe player's icon ID, range from 0 to 31 (0 to 99 in 0.3), used in RemovePlayerMapIcon. Only one icon can be at one iconid at the same time, old one gets deleted.
Float:xThe X-coordinate of the place where you want the icon to show up.
Float:yThe Y-coordinate of the place where you want the icon to show up.
Float:zThe Z-coordinate of the place where you want the icon to show up.
markertypeThe icon you wish to place, scroll down for a list of available icons.
colorThe color of the icon, this should only be used incase of the square icon (ID: 1).


Note: If you use an invalid icon ID, it will create ID 1 (White Square)
Important note: You can only have 32 mapicons! (100 in SA-MP 0.3)


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


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 );
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.


Available Map Icons

As the intro also stated, there are 63 map icons available, one of which will crash your game if you use it.
 ID
 -
Name
Note

 1
Image:Icon_1.gif
White Square
Can be used in any colour.

 2
Image:Icon_2.gif
Player Position
Will be used on the minimap by default.

 3
Image:Icon_3.gif
Player (Menu Map)
Your position when on the large map.

 4
Image:Icon_4.gif
North
Placed on the map by GTA, will always be north.

 5
Image:Icon_5.gif
Air Yard

 6
Image:Icon_6.gif
Ammunation
On the map by default (done by SA-MP)

 7
Image:Icon_7.gif
Barber
On the map by default (done by SA-MP)

 8
Image:Icon_8.gif
Big Smoke

 9
Image:Icon_9.gif
Boat Yard

 10
Image:Icon_10.gif
Burger Shot

 11
Image:Icon_11.gif
Quarry

 12
Image:Icon_12.gif
Catalina

 13
Image:Icon_13.gif
Cesar

 14
Image:Icon_14.gif
Cluckin' Bell

 15
Image:Icon_15.gif
Carl Johnson

 16
Image:Icon_16.gif
C.R.A.S.H

 17
Image:Icon_17.gif
Diner

 18
Image:Icon_18.gif
Emmet

 19
Image:Icon_19.gif
Enemy Attack

 20
Image:Icon_20.gif
Fire

 21
Image:Icon_21.gif
Girlfriend

 22
Image:Icon_22.gif
Hospital

 23
Image:Icon_23.gif
Loco

 24
Image:Icon_24.gif
Madd Dogg

 25
Image:Icon_25.gif
Caligulas

 26
Image:Icon_26.gif
OG Loc

 27
Image:Icon_27.gif
Mod garage

 28
Image:Icon_28.gif
OG Loc

 29
Image:Icon_29.gif
Well Stacked Pizza Co

 30
Image:Icon_30.gif
Police

 31
Image:Icon_31.gif
Property
A property you're free to purchase.

 32
Image:Icon_32.gif
Property
A property that isn't available for purchase.

 33
Image:Icon_33.gif
Race

 34
Image:Icon_34.gif
Ryder

 35
Image:Icon_35.gif
Save Game
The blue save disk where you save games in singleplayer

 36
Image:Icon_36.gif
School

 37
Image:Icon_37.gif
Unknown

 38
Image:Icon_38.gif
Sweet

 39
Image:Icon_39.gif
Tattoo

 40
Image:Icon_40.gif
The Truth

 41
Image:Icon_41.gif
Waypoint
Shortcut on the map/radar modifyable by the player.

 42
Image:Icon_42.gif
Toreno

 43
Image:Icon_43.gif
Triads

 44
Image:Icon_44.gif
Triads Casino

 45
Image:Icon_45.gif
Clothes

 46
Image:Icon_46.gif
Woozie

 47
Image:Icon_47.gif
Zero

 48
Image:Icon_48.gif
Disco

 49
Image:Icon_49.gif
Bar

 50
Image:Icon_50.gif
Restaurant

 51
Image:Icon_51.gif
Truck

 52
Image:Icon_52.gif
Robbery
Frequently used for Banks.

 53
Image:Icon_53.gif
Race

 54
Image:Icon_54.gif
Gym

 55
Image:Icon_55.gif
Car

 56
Image:Icon_56.gif
Light

 57
Image:Icon_57.gif
Closest airport
Crashes the game when used (not in 0.3)

 58
Image:Icon_58.gif
Varrios Los Aztecas

 59
Image:Icon_59.gif
Ballas

 60
Image:Icon_60.gif
Los Santos Vagos

 61
Image:Icon_61.gif
San Fierro Rifa

 62
Image:Icon_62.gif
Grove street

 63
Image:Icon_63.gif
Pay 'n' Spray
On the map by default (done by SA-MP)

Personal tools