[HELP] Map Blips
#1

Hey guys i have problem with map blips.I want TEAM RUS_ cant see TEAM_USA on map, and that works.But i also want to TEAM_RUS see TEAM_RUS on map (see teammates) but i cant get it to work.Also i tried making NameTag Not visible for enemies but SetPlayerNameTagForPlayer dont work. Any suggestions?

pawn Code:
for(new i = 0;i < MAX_PLAYERS;i++)
    {
        if(gTeam[playerid] == TEAM_RUS && gTeam[i] == TEAM_USA)
        {
            SetPlayerColor(playerid, 0xFF000000);
            SetPlayerColor(i, 0x0000FF00);
            ShowPlayerNameTagForPlayer(playerid,i,0);
        }
        if(gTeam[playerid] == TEAM_USA && gTeam[i] == TEAM_RUS)
        {
            SetPlayerColor(playerid, 0x0000FF00);
            SetPlayerColor(i, 0xFF000000);
            ShowPlayerNameTagForPlayer(playerid,i,0);
        }
        if(gTeam[playerid] == TEAM_USA && gTeam[i] == TEAM_USA)
        {
            //SetPlayerColor(playerid, 0x0000FF00);
            //SetPlayerColor(i, 0x0000FF00);
            SetPlayerMarkerForPlayer(playerid,i,0x0000FFFF);
        }
        if(gTeam[playerid] == TEAM_RUS && gTeam[i] == TEAM_RUS)
        {
            //SetPlayerColor(playerid, 0xFF000000);
            //SetPlayerColor(i, 0xFF000000);
            SetPlayerMarkerForPlayer(playerid,i,0xFF0000FF);
        }
    }
Reply
#2

pawn Code:
new color = GetPlayerColor(playerid);

for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
    SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF : color & ~0xFF);
}
Reply
#3

I tried it and it dont work can you explain more i dont know what
pawn Code:
? color | 0xFF : color & ~0xFF)
this mean? Should i set color there or?
Reply
#4

Bump
Reply
#5

Code:
SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF : color & ~0xFF);
"color" should be the color you want the map blips to be for team mates
Reply
#6

For example i want red so i need to do:
pawn Code:
SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF0000FF : color & ~0xFF0000FF);
Or?
Also how that code make difference is player team_usa (blue color) or team_rus (red color)?
Reply
#7

Quote:
Originally Posted by NeamPojma
View Post
For example i want red so i need to do:
pawn Code:
SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF0000FF : color & ~0xFF0000FF);
Or?
Also how that code make difference is player team_usa (blue color) or team_rus (red color)?
no

Code:
/* 
    set the players color somewhere earlier in the code 
    (for example when they choose their team), 
    this should return either red or blue (RUS and USA): 
*/
new color = GetPlayerColor(playerid); 

//this code should be run when any player changes team:
for(new i; i <= GetPlayerPoolSize(); i++) //loop through all players
{
    /*
        set blip color for everyone else on playerid's minimap, 
        if team is the same it'll set it to player's color otherwise it'll be invisible:
    */
    SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF : color & ~0xFF);
}
Reply
#8

Thanks REP +,but i have one more question
pawn Code:
SetPlayerMarkerForPlayer(i, playerid, (gTeam[i] == gTeam[playerid]) ? color | 0xFF : color & ~0xFF);// Do i need to change this 0xFF to my color or just leave it like this?
Reply
#9

Leave it as it is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)