SetMapIcon
#1

Simple question i hope How can I set a Map Icon for everybody?

pawn Код:
SetPlayerMapIcon(playerid, 1,326.3,-35.2,3.3, 30, 0 );
Reply
#2

Use looping.
Код:
for(new i = 0; i <= GetMaxPlayers(); i++) SetPlayerMapIcon(i,1,326.3,-35.2,3.3,30,0);
Reply
#3

Quote:
Originally Posted by E1edge
Use looping.
Код:
for(new i = 0; i <= GetMaxPlayers(); i++) SetPlayerMapIcon(i,1,326.3,-35.2,3.3,30,0);
that's one iteration too much.. use
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
  SetPlayerMapIcon(i,1,326.3,-35.2,3.3,30,0);
}
Reply
#4

There is no need to add brackets.
Reply
#5

thanks for the replies but it still doesn't work maybe i didn't see the mistake so i've presented the code:

pawn Код:
public Conquersystem(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if((CONQUERED_BASE_PD==0)||(CONQUERED_BASE_PD==2))
{
    CONQUERED_BASE_PD = 1;
    SendClientMessageToAll(COLOR_RED,"TEAM BLUE has conquered the PD!");
    SetPlayerMapIcon(i, 1,326.3,-35.2,3.3, 30, 0 );
    RemovePlayerMapIcon(i, 2);
    PercentConquered[playerid] = 0;
}
}
}
hope someone find the problem
Reply
#6

pawn Код:
public Conquersystem(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if((CONQUERED_BASE_PD==0)||(CONQUERED_BASE_PD==2))
        {
            CONQUERED_BASE_PD = 1;
            SendClientMessageToAll(COLOR_RED,"TEAM BLUE has conquered the PD!");
            for(new i; i < MAX_PLAYERS; i++)
            {
                SetPlayerMapIcon(i, 1,326.3,-35.2,3.3, 30, 0);
                RemovePlayerMapIcon(i, 2);
            }
            PercentConquered[playerid] = 0;
        }
    }
}
Reply
#7

lol thanks but if i add these lines to my script a warning appears:
pawn Код:
warning 219: local variable "i" shadows a variable at a preceding level
and when i play the game the synchronization breaks down but why?
and how can i fix this warning?
Reply
#8

pawn Код:
public Conquersystem(playerid)
{
    if((CONQUERED_BASE_PD==0)||(CONQUERED_BASE_PD==2))
    {
        CONQUERED_BASE_PD = 1;
        SendClientMessageToAll(COLOR_RED,"TEAM BLUE has conquered the PD!");
        for(new i; i < MAX_PLAYERS; i++)
        {
            SetPlayerMapIcon(i, 1,326.3,-35.2,3.3, 30, 0);
            RemovePlayerMapIcon(i, 2);
        }
        PercentConquered[playerid] = 0;
    }
}
there
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)