SetPlayerMarkerForPlayer
#1

This may seem like a stupid question but is there any reason I can't use this function like this:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(gTeam[i] == BLUE_TEAM)
    {
        SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
    }
}
Reply
#2

No. It looks just fine
Reply
#3

hmm it's only ment to show for the blue team although red team see it also.
Reply
#4

FIX

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(gTeam[i] == BLUE_TEAM && gTeam[playerid] == BLUE_TEAM)
    {
        SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
    }
}
Cuz you only checked if "i" is in the blue team , u forget to checek if "playerid" is in the blue team too
Reply
#5

I do actually run a check to see if the player is on the blue team just above this code. :S
Reply
#6

Can you post the whole code of this parte ?
Reply
#7

Quote:
Originally Posted by Elka_Blazer
Посмотреть сообщение
Can you post the whole code of this parte ?
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == BLUE_TEAM)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(gTeam[i] == BLUE_TEAM)
            {
                SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
            }
        }
    }
    return 1;
}
I can see the problem, it's calling for all players.. i just can't think of a way to only call one team.. it's been a long day lol.
Reply
#8

LOL where did u set the player in "BLUE_TEAM" ?
Reply
#9

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = RED_TEAM;
    }

    else if(classid == 1)
    {
        gTeam[playerid] = BLUE_TEAM;
    }
}
Reply
#10

And where did u use this function ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)