PDA

View Full Version : Disable playermarkers for oposite team


Wesley221
28/08/2011, 02:40 PM
Im trying to disable the playermarkers from the oposite team, but i cant get it working.


for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( gTeam[playerid] != gTeam[i] )
{
SetPlayerMarkerForPlayer(playerid, i, 0xFFFFFFFF );
return 1;
}
}

I have this under OnPlayerSpawn, and when you spawn, the oposite team is still visible.
Anyone know what im doing wrong?

iMonk3y
28/08/2011, 03:04 PM
The last two chars are for the alphavalue. "If you use FF there it will be displayed without transparency and if you put it to 00 it will be invisible."

Pinguinn
28/08/2011, 03:05 PM
0xFFFFFF00

Wesley221
28/08/2011, 04:06 PM
I know that, but the colour didnt change neither, so that wasnt the problem. Also i made this on my laptop, because the script is on my pc. (Yes their both the same)

AndreT
28/08/2011, 04:10 PM
That must be caused by the return in your loop! In your case anything isn't necessary there. Although you could do it like this:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || gTeam[i] == gTeam[playerid]) continue;
SetPlayerMarkerForPlayer(playerid, i, 0xFFFFFF00);
}