[Help] - SetPlayerMarkerForPlayer
#1

Hello, so I got this code:

pawn Код:
public OnPlayerSpawn(playerid)
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if(team[playerid] == team[i])
            {
                SetPlayerMarkerForPlayer( playerid, i, GetPlayerColor(i) );
                SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor(playerid) );
            }
            else
            {
                SetPlayerMarkerForPlayer( playerid, i, ( GetPlayerColor( i ) & 0xFFFFFF00 ) );
                SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
            }
        }
    }
    return 1;
}
And it should work like this:
When a player spawns, it loops through all connected players and checks if they are on the same team or in different teams.
If they are on the same team, it sets the player markers to show normally for each other. If they are on different teams, it sets the markers invisible for each other (got that code from here).

However this is working weirdly, when a player spawns he usually can see everyone (even from the opposite team), then when a player dies and respawns he can't see the enemy team any more but everyone on the enemy team can see him, then if he kills someone he can only see that person.

Can anyone help me and tell me what am I doing wrong here?
Reply


Messages In This Thread
[Solved] - SetPlayerMarkerForPlayer - by Ritz - 02.05.2012, 10:47
Re: [Help] - SetPlayerMarkerForPlayer - by Face9000 - 02.05.2012, 11:21
Re: [Help] - SetPlayerMarkerForPlayer - by MadeMan - 02.05.2012, 12:49
Re: [Help] - SetPlayerMarkerForPlayer - by Ritz - 02.05.2012, 13:59

Forum Jump:


Users browsing this thread: 1 Guest(s)