SetPlayerMarkerForPlayer
#1

This function doesn't work in short time after when players respawns.

Code:
Код:
public OnPlayerSpawn(playerid)
{
     foreach(new x : Player)
     {
           if(x == playerid) continue;

           SetPlayerMarkerForPlayer(playerid, x, 0x00FF0000); // This works good
           SetPlayerMarkerForPlayer(x, playerid, 0x00FF0000); // This doesn't work - why?
     }

     return 1;
}
It never works properly.

This code also not working:
Код:
Function()
{
     foreach(new x : Player)
     {
          TogglePlayerSpectating(x, 0); // Force player to respawn
     }

     return 1;
}

public OnPlayerSpawn(playerid)
{
     foreach(new x : Player)
     {
          if(playerid == x) continue;

          SetPlayerMarkerForPlayer(playerid, x, 0x00FF0000); // Won't work for respawned players
          SetPlayerMarkerForPlayer(x, playerid, 0x00FF0000); // Won't work for respawned players
     }
}
Reply
#2

If you're going to disable markers, why not use the function that is made for disabling markers? That function isn't made for disabling completely as it seems you are trying to do (he is transparent for everybody and everybody transparent for him).
Reply
#3

It's only example.

I want to use this function for hiding players for other team.
But, when player spectate other players - and in next round gonna respawn - this not working, second team see him.
Reply
#4

Try this, if you do it this way the player will keep their color at the chat while having their map blip invisible.

pawn Код:
foreach(new i : Player)
{
    if(GetPlayerTeam(i) != GetPlayerTeam(playerid) continue;
    SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
    SetPlayerMarkerForPlayer( playerid, i, ( GetPlayerColor( i ) & 0xFFFFFF00 ) );
}
Reply
#5

0x00FF0000 is a transparent color, you should't be seeing the market at all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)