SA-MP Forums Archive
Players Colors - 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: Players Colors (/showthread.php?tid=461481)



Players Colors - yancarlos4500 - 02.09.2013

how can i make that only a team for example cops can see a player with a diferent color but

without showing it in the map

please help


Re: Players Colors - Skribblez - 02.09.2013

Use SetPlayerColor - if you don't want the player to have a marker on the mini-map, just set the alpha values to zero.

Example:
pawn Код:
SetPlayerColor(playerid, 0x0000FF00);
The code above would make the player's name color blue without a marker on the map. Change the last 2 numbers to 00 to make it transparent.


Re: Players Colors - yancarlos4500 - 02.09.2013

oh thanks hope it works

but how can i do that only the cops see the player with that color


Re: Players Colors - Konstantinos - 02.09.2013

That should work.
pawn Код:
public OnPlayerStreamIn( playerid, forplayerid )
{
    if( gTeam[ playerid == gTeam[ forplayerid ] ) // CHANGE THEM TO YOURS
    {
        SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
    }
}

public OnPlayerStreamOut( playerid, forplayerid )
{
    if( gTeam[ playerid == gTeam[ forplayerid ] ) // CHANGE THEM TO YOURS
    {
        SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
    }
}
NOTE: You must set the color before using GetPlayerColor function.


Re: Players Colors - yancarlos4500 - 02.09.2013

umm can you explain how to add it i a begginer in scripting


Re: Players Colors - yancarlos4500 - 03.09.2013

Bump Please Some Help


Re: Players Colors - Konstantinos - 03.09.2013

Add them anywhere, but outside of any callback/custom function and under includes/defines.

For example:
pawn Код:
#include <a_samp>
// more #include ...

// #define ...

public OnPlayerConnect(playerid)
{
    // some code
    return 1;
}

// other callbacks

public OnPlayerStreamIn( playerid, forplayerid )
{
    if( gTeam[ playerid == gTeam[ forplayerid ] ) // CHANGE THEM TO YOURS
    {
        SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
    }
}

public OnPlayerStreamOut( playerid, forplayerid )
{
    if( gTeam[ playerid == gTeam[ forplayerid ] ) // CHANGE THEM TO YOURS
    {
        SetPlayerMarkerForPlayer( forplayerid, playerid, GetPlayerColor( playerid ) );
    }
}
Make sure that you set the color before, when they choose their team. And change gTeam to the one you use for storing the player's team (unless it's same).