Displaying more than one map icon on the minimap
#1

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...
Reply
#2

Each MapIcon has an individual ID, you have given them both the ID of 12.
Reply
#3

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;
}
Reply
#4

Thank-yoooou
Reply
#5

Its alright!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)