Team Blips
#1

Hello!

I'm trying to make team blips for my TDM server however I got no luck with this, I am using SetPlayerColor and I tried to look around in the forums and yet I havn't found anything that can help me.

Can anyone please help me making a team blips (2 teams)?
Thanks! =]
Reply
#2

Use SetPlayerMarkerForPlayer.
Reply
#3

Can you send me an example of the SetPlayerMarkerForPlayer, I tried to use it a few times but no luck, it's just 2 teams, I assume it's pretty simple to make.

Thank you =]
Reply
#4

Examples taken from the Wiki. It is pretty clear how to use it.

PHP код:
// Make player 42 see player 1 as a red marker
SetPlayerMarkerForPlayer4210xFF0000FF );
 
// Make the players marker an invisible white (chat will be white but marker will be gone).
SetPlayerMarkerForPlayer4210xFFFFFF00 );
 
// Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
SetPlayerMarkerForPlayer421, ( GetPlayerColor) & 0xFFFFFF00 ) );
 
// Make the players marker fully opaque (solid) to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used:
SetPlayerMarkerForPlayer421, ( GetPlayerColor) | 0x000000FF ) ); 
Reply
#5

Do it like this when a player chooses his team:

Код:
foreach(Player, i)
{
    if(team[i] == team[playerid]) // Checks if they're on the same team
        // "playerid" being the player that joined the team, and "i" being his teammates that should see him on the radar
    {
        SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFFFF); // Marks him on the radar
            // 0xFFFFFFFF is a white colour, replace it with the color of the team he chose
    }
}
Replace team[x] with your team variable.
Reply
#6

I dont use foreach,can i do it with loop like:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
Reply
#7

So that's how I defined teams and team blips, but it doesn't work =[

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
        SPAWNED[playerid] = false;
        SetPlayerInterior(playerid,1);
        SetPlayerPos(playerid,292.9160,-30.6521,1001.5156);
        SetPlayerCameraPos(playerid,293.1492,-37.2610,1001.5156);
        SetPlayerCameraLookAt(playerid,292.9160,-30.6521,1001.5156);
        SetPlayerFacingAngle(playerid,177.3484);
        if(classid == 0)
        {
        gTeam[playerid] = TEAM_RUS;
        SetPlayerTeam(playerid,0);
        GameTextForPlayer(playerid,"~r~Russia",3000,4);
        //SetPlayerColor(playerid,0xFF000000);
        SetPlayerColor(playerid,0xFF0000FF);
       
        }
        else if(classid == 1)
        {
        gTeam[playerid] = TEAM_USA;
        SetPlayerTeam(playerid,1);
        GameTextForPlayer(playerid,"~b~United States",3000,4);
        //SetPlayerColor(playerid,0x0000FF00);
        SetPlayerColor(playerid,0x0000FFFF);
        }
       
        for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(gTeam[i] == gTeam[playerid])
        {
                    SetPlayerMarkerForPlayer(i, playerid, 0xFFFF00FF);
        }
            else if(gTeam[i] != gTeam[playerid])
        {
                    SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00);
        }
    }
}
Reply
#8

Bump
Reply
#9

Bump, can anyone help me finding a solution for this please? =[
Reply
#10

Make sure you don't have
Код:
ShowPlayerMarkers(PLAYER_MARKERS_MODE_OFF);
In your script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)