SA-MP Forums Archive
[HELP] Map Blips - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Map Blips (/showthread.php?tid=579841)



[HELP] Map Blips - NeamPojma - 30.06.2015

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);
        }
    }



Re: [HELP] Map Blips - Vince - 30.06.2015

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);
}



Re: [HELP] Map Blips - NeamPojma - 02.07.2015

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?


Re: [HELP] Map Blips - NeamPojma - 03.07.2015

Bump


Re: [HELP] Map Blips - SloProKiller - 03.07.2015

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


Re: [HELP] Map Blips - NeamPojma - 03.07.2015

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)?


Re: [HELP] Map Blips - SloProKiller - 03.07.2015

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);
}



Re: [HELP] Map Blips - NeamPojma - 03.07.2015

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?



Re: [HELP] Map Blips - SloProKiller - 03.07.2015

Leave it as it is.