02.05.2012, 10:47
(
Последний раз редактировалось Ritz; 02.05.2012 в 13:59.
)
Hello, so I got this code:
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?
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;
}
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?