public OnGameModeInit()
{
for(new i; i < MAX_PLAYERS; i++)
{
gradar[i] = 0;
}
public OnPlayerConnect(playerid)
{
gradar[playerid] = 0;
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(Member[playerid] != Member[i] && IsPlayerConnected(i)) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(i) & 0xFFFFFF00));
}
public OnPlayerSpawn(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(Member[playerid] != Member[i] && IsPlayerConnected(i)) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(i) & 0xFFFFFF00));
}
public GangRadar(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(Member[playerid] != Member[i] && gradar[i] == 1) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(playerid) & 0xFFFFFF00));
if(Leader[playerid] != Leader[i] && gradar[i] == 1) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(playerid) & 0xFFFFFF00));
}
}
COMMAND:radar(playerid, params[])
{
if(gradar[playerid] == 0)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(Member[playerid] != Member[i] && IsPlayerConnected(i)) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(i) & 0xFFFFFF00));
if(Leader[playerid] != Leader[i] && IsPlayerConnected(i)) SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(i) & 0xFFFFFF00));
}
gradar[playerid] = 1;
gradartimer[playerid] = SetTimerEx("GangRadar", 1000, true, "i", playerid);
}
else
{
for(new i; i < MAX_PLAYERS; i++) SetPlayerMarkerForPlayer(playerid, i, GetPlayerColor(i));
gradar[playerid] = 0;
KillTimer(gradartimer[playerid]);
}
return 1;
}
if(Member[playerid] != Member[i] && gradar[i] == 0) SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
At this at top of script:
#define COLOR_INVISIBLE 0xFFFFFF00 OnPlayerspawn add: SetPlayerColor(playerid,COLOR_INVISIBLE); |
At this at top of script:
#define COLOR_INVISIBLE 0xFFFFFF00 OnPlayerspawn add: SetPlayerColor(playerid,COLOR_INVISIBLE); |
he wants to keep the chat the same.
(GetPlayerColor(i) & 0xFFFFFF00) yet I have never gotten it to work, I don't think the wiki is right.. I don't know how can this be fixed ;\ |
Important Note: GetPlayerColor will return nothing unless SetPlayerColor has been used! |
SetPlayerColor(playerid,PlayerColors[playerid]-FF);//"-FF" takes away the alpha (transparency) value of 255 (FF)
A quote from the wiki article on GetPlayerColor
If you want to use the default colours, click here, and add that code to your script. Then, when a player connects, do: pawn Код:
|
SetPlayerColor(playerid,COLOR_RED-FF);
I could not see that in the code you provided.
If you have used it, add -FF to the end of the colour to make map icons invisable (this will take away the alpha/transparency value, the last bit of 0xFF155DFF, to make map icons invisable). e.g. pawn Код:
|
public OnPlayerSpawn( playerid )
{
foreach (Player,i)
{
if ( Member[ playerid ] == Member[ i ] )
continue;
SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) ); // Invisible
}
gradar[ playerid ] = 1; // Radar turned off for other teams.
return 1;
}
CMD:radar( playerid, params[ ] )
{
if ( !gradar[ playerid ] )
{
gradar[ playerid ] = 1;
foreach (Player, i)
{
if ( Member[ playerid ] == Member[ i ] )
continue;
SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) ); // Invisible for other teams.
}
}
else
{
gradar[ playerid ] = 0;
foreach (Player, i)
{
SetPlayerMarkerForPlayer( i, playerid, GetPlayerColor( playerid ) ); // Visible for other teams.
}
}
return 1;
}