SA-MP Forums Archive
Teams on radar - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teams on radar (/showthread.php?tid=273832)



Teams on radar - cruising - 03.08.2011

Hello!

im trying to disable radar blips for teams your not member in on OnPlayerSpawn, but i cant fix it.

It is like this that you only will be able to see your own team players.
And the rest of the other teams are invisible on the radar.

I use (SetPlayerTeam)
i have two choices to use for this
pawn Код:
if(Member[playerid] == 0)
if(GetPlayerTeam(playerid) == 0)
How to fix this?


Re: Teams on radar - Virtual1ty - 03.08.2011

You can use SetPlayerColor and just change the alpha-transparency of the hex color. So from there you just implement those team checks and voila ! It should work, It's something I wanted to do for a while now, but never got to realizing it..

Edit: I think this might not just work the way I thought it might, try using it under OnPlayerStreamIn


Re: Teams on radar - Patrik356b - 03.08.2011

I think this could be usefull as well: https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer


Re: Teams on radar - cruising - 03.08.2011

Quote:
Originally Posted by Patrik356b
Посмотреть сообщение
I think this could be usefull as well: https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer
Ofc i need to use that, but i didnt get it to work


Re: Teams on radar - cruising - 05.08.2011

Anyone who can help with this?


Re: Teams on radar - =WoR=Varth - 06.08.2011

pawn Код:
for(new i;i<MAX_PLAYERS;i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
        {
            SetPlayerMarkerForPlayer(i,playerid,0xFF0000FF);
        }
    }
}



Re: Teams on radar - cruising - 08.08.2011

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
for(new i;i<MAX_PLAYERS;i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
        {
            SetPlayerMarkerForPlayer(i,playerid,0xFF0000FF);
        }
    }
}
Can i put this on OnPlayerSpawn or?
and will the team collors still be what i have set them to be?


Re: Teams on radar - Grim_ - 08.08.2011

pawn Код:
public OnPlayerSpawn( playerid )
{
   for( new i = 0; i < MAX_PLAYERS; i++ )
   {
      if( !IsPlayerConnected( i ) || i == playerid ) continue;
      if( GetPlayerTeam( playerid ) != GetPlayerTeam( i ) )
      {
         ShowPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
         ShowPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );
         // Hide the player's marker from someone on the other team, and vice-versa
      }
   }
   return 1;
}
Note that this will also make the color of the player's name in the chat white. If you want to have a consistent color inside the chat, you'll have to make sure you previous used SetPlayerColor, and use this code:
pawn Код:
SetPlayerMarkerForPlayer( playerid, i, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
Also make sure ShowPlayerMarkers is set to 1 inside OnGameModeInit.


Re: Teams on radar - cruising - 08.08.2011

Quote:
Originally Posted by Grim_
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn( playerid )
{
   for( new i = 0; i < MAX_PLAYERS; i++ )
   {
      if( !IsPlayerConnected( i ) || i == playerid ) continue;
      if( GetPlayerTeam( playerid ) != GetPlayerTeam( i ) )
      {
         ShowPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
         ShowPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );
         // Hide the player's marker from someone on the other team, and vice-versa
      }
   }
   return 1;
}
Note that this will also make the color of the player's name in the chat white. If you want to have a consistent color inside the chat, you'll have to make sure you previous used SetPlayerColor, and use this code:
pawn Код:
SetPlayerMarkerForPlayer( playerid, i, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( 1 ) & 0xFFFFFF00 ) );
Also make sure ShowPlayerMarkers is set to 1 inside OnGameModeInit.
When i put this in my scrip ill get
pawn Код:
error 017: undefined symbol "ShowPlayerMarkerForPlayer
error 017: undefined symbol "
ShowPlayerMarkerForPlayerr
and when i define the first one ill get 2 of these warnings instead on ShowPlayerMarkerForPlayer line
pawn Код:
expression has no effect



Re: Teams on radar - Grim_ - 08.08.2011

I meant SetPlayerMarkerForPlayer. Replace ShowPlayerMarkerForPlayer with it.


Re: Teams on radar - cruising - 08.08.2011

Quote:
Originally Posted by Grim_
Посмотреть сообщение
I meant SetPlayerMarkerForPlayer. Replace ShowPlayerMarkerForPlayer with it.
This doest work, ill see the radar blips for the other teams.


Re: Teams on radar - Grim_ - 08.08.2011

If you're using the second code I posted (keeping the chat color of the player the same), then make sure you have previously used SetPlayerColor.


Re: Teams on radar - cruising - 08.08.2011

Quote:
Originally Posted by Grim_
Посмотреть сообщение
If you're using the second code I posted (keeping the chat color of the player the same), then make sure you have previously used SetPlayerColor.
Ill use this
pawn Код:
public OnPlayerSpawn( playerid )
{
   for( new i = 0; i < MAX_PLAYERS; i++ )
   {
      if( !IsPlayerConnected( i ) || i == playerid ) continue;
      if( GetPlayerTeam( playerid ) != GetPlayerTeam( i ) )
      {
         ShowPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 );
         ShowPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 );
         // Hide the player's marker from someone on the other team, and vice-versa
      }
   }
   return 1;
}
and i sett the team colors like this
pawn Код:
if(Member[playerid] == 0)
    {
        SetPlayerPos(playerid, 414.6559,2531.7651,19.1601);
        SetPlayerTeam(playerid, 0);
        SetPlayerColor(playerid, COLOR_RED);
it seams the blips are invisible untill youi get near the player, then it shown up on radar