SA-MP Forums Archive
Team 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: Team Blips (/showthread.php?tid=590181)



Team Blips - UNLIMIT3D - 26.09.2015

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! =]


Re: Team Blips - CalvinC - 26.09.2015

Use SetPlayerMarkerForPlayer.


Re: Team Blips - UNLIMIT3D - 28.09.2015

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 =]


Re: Team Blips - rappy93 - 28.09.2015

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



Re: Team Blips - CalvinC - 28.09.2015

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.


Re: Team Blips - NeamPojma - 28.09.2015

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



Re: Team Blips - UNLIMIT3D - 28.09.2015

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



Re: Team Blips - UNLIMIT3D - 29.09.2015

Bump


Re: Team Blips - UNLIMIT3D - 30.09.2015

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


Re: Team Blips - CalvinC - 30.09.2015

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