PDA

View Full Version : Question


MayaEU
11/07/2016, 02:27 PM
Hello, i was wondering if its possible to set the marker color, to players team color
Example If someone is in a "red" family, and another one is in a "green" family, but they join the same gangchat
they can see each other on the map. So my question if its possible to make that the markers are the same color
as their TeamColor? (SetPlayerToTeamColor(playerid);)


stock ShowGang(playah,gang)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pGang] == gang && !PlayerInfo[i][pBanished])
{
SetPlayerMarkerForPlayer(i, playah, 0xFFFFFFAA);
SetPlayerMarkerForPlayer(playah, i, 0xFFFFFFAA);
}
}
return 1;
}

MayaEU
11/07/2016, 02:53 PM
Maybe with GetPlayerColor? i dont know how to make it

WhiteGhost
11/07/2016, 02:56 PM
Huh? when u SetPlayerColor();
The Marker automatically change to that color.
So isnt that it?

MayaEU
11/07/2016, 02:59 PM
Also, in my server there are diffrent teams
and they can join a chat, and then they can see each other on the map
but the markers are white, but i want it like that, they will be marked on the map
as the same color as their team color

ArminKH
11/07/2016, 03:02 PM
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pGang] == gang) {
SetPlayerColor(playerid, gangcolor);
}
return 1;
}

WhiteGhost
11/07/2016, 03:04 PM
I believe your code is the error.
Because when u create the teams and there colors it the markers should be the color depends on how u code it u should use
SetPlayerToTeamColor(playerid)

MayaEU
11/07/2016, 03:12 PM
I think you guys dont understand me.
I have factions/families and they have name colors, but then they can join a seperate ganchat /joingang [number]
and when they are in that chat they can see each other on the minimap, but right now the markers are white.
i would like if i could make that the marker is the same color as their name colors

Mencent
11/07/2016, 03:19 PM
Hello!

Sorry when I have to ask although you explain it much times.
Each gang has his own color, that's right? You want to give the people in the gang with the green color the color green in the map, don't you?

MayaEU
11/07/2016, 03:24 PM
Yes exactly, sorry for my bad English ^^

WhiteGhost
11/07/2016, 03:27 PM
Yes exactly, sorry for my bad English ^^
Then u use. https://wiki.sa-mp.com/wiki/SetPlayerMarkerForPlayer

MayaEU
11/07/2016, 03:30 PM
So this one would be the right one?


stock ShowGang(playah,gang)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pGang] == gang && !PlayerInfo[i][pBanished])
{
SetPlayerMarkerForPlayer(i, playah, ( GetPlayerColor( i ) | 0x000000FF ) );
SetPlayerMarkerForPlayer(playah, i, ( GetPlayerColor( i ) | 0x000000FF ) );
}
}
return 1;
}

WhiteGhost
11/07/2016, 03:36 PM
Not Sure,Try it.

MayaEU
11/07/2016, 03:53 PM
It does not work quite right

WhiteGhost
11/07/2016, 04:16 PM
Whats the problem now?

Mencent
11/07/2016, 04:40 PM
Try this:
stock ShowGang(playah,gang)
{
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pGang] == PlayerInfo[playah][pGang] && !PlayerInfo[i][pBanished])
{
SetPlayerMarkerForPlayer(i,playah,GetPlayerColor(i ));
SetPlayerMarkerForPlayer(playah,i,GetPlayerColor(i ));
}
}
return 1;
}