Displaying more than one map icon on the minimap - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Displaying more than one map icon on the minimap (
/showthread.php?tid=285791)
Displaying more than one map icon on the minimap -
BigAl - 25.09.2011
When my player spawns.. he can only see the Police Map Icon, where I want it to show the clothes shop and the police... both icons
pawn Код:
public OnPlayerSpawn(playerid)
{
if(classselection[playerid] == 1)
{
GivePlayerMoney(playerid, -1000);
}
classselection[playerid] = 0;
spawn[playerid] = 0;
//map icons
SetPlayerMapIcon(playerid, 12, -1439.1910,2591.3840,55.8359, 45, 0, MAPICON_GLOBAL);
SetPlayerMapIcon(playerid, 12, -1390.1752,2638.2993,55.9844, 30, 0, MAPICON_GLOBAL);
return 1;
}
Please help, thanks in advance...
Re: Displaying more than one map icon on the minimap -
Redgie - 25.09.2011
Each MapIcon has an individual ID, you have given them both the ID of 12.
Re: Displaying more than one map icon on the minimap -
Luis- - 25.09.2011
Your ID's are the same meaning only one of the icons will show.
pawn Код:
public OnPlayerSpawn(playerid)
{
if(classselection[playerid] == 1)
{
GivePlayerMoney(playerid, -1000);
}
classselection[playerid] = 0;
spawn[playerid] = 0;
//map icons
SetPlayerMapIcon(playerid, 1, -1439.1910,2591.3840,55.8359, 45, 0, MAPICON_GLOBAL);
SetPlayerMapIcon(playerid, 2, -1390.1752,2638.2993,55.9844, 30, 0, MAPICON_GLOBAL);
return 1;
}
That should work.
Also, I think you are meant to use
OnPlayerConnect for it to work.
pawn Код:
public OnPlayerConnect(playerid)
{
SetPlayerMapIcon(playerid, 1, -1439.1910,2591.3840,55.8359, 45, 0, MAPICON_GLOBAL);
SetPlayerMapIcon(playerid, 2, -1390.1752,2638.2993,55.9844, 30, 0, MAPICON_GLOBAL);
return 1;
}
Re: Displaying more than one map icon on the minimap -
BigAl - 25.09.2011
Thank-yoooou
Re: Displaying more than one map icon on the minimap -
Luis- - 25.09.2011
Its alright!