Players Colors
#1

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
Reply
#2

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.
Reply
#3

oh thanks hope it works

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

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.
Reply
#5

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

Bump Please Some Help
Reply
#7

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)