Blips Off
#1

Mkay, I was wondering if it's possible to do an admin command which disables the blips for all players in the minimap?
And if that's not possible then is it possible to script a command for yourself what makes other people's blips disappear.
Reply
#2

Yes, you would use the ShowPlayerMarkerForPlayerfunction inside of a loop, to set all players marker. You would probably also need a variable to set so if new players join the server, it will automatically set their markers hidden.
pawn Code:
//global variable
new set_markers;

public OnPlayerConnect( playerid )
{
   if( set_markers == 1 )
   {
      for( new i = 0; i < MAX_PLAYERS; i++ )
      {
         if( !IsPlayerConnected( i ) ) continue;
         ShowPlayerMarkerForPlayer( i, playerid, 0xFFFFFF00 ); // Have 'i' radar hide playerid marker
         ShowPlayerMarkerForPlayer( playerid, i, 0xFFFFFF00 ); // Have 'playerid' radar hide i marker
      }
   }
   return 1;
}

ZCMD:markers( playerid, params[ ] )
{
   if( !IsPlayerAdmin( playerid ) ) return 1;
   for( new i = 0; i < MAX_PLAYERS; i++ )
   {
      if( !IsPlayerConnected( i ) ) continue;
      for( new z = 0; z < MAX_PLAYERS; z++ )
      {
         if( !IsPlayerConnected( z ) ) continue;
         if( i == z ) continue;
         ShowPlayerMarkerForPlayer( i, z, 0xFFFFFF00 );
         ShowPlayerMarkerForPlayer( z, i, 0xFFFFFF00 );
      }
   }
   set_markers = 1;
   return 1;
}
Please note that this will also change the players color in the chat box. For more imformation on how to avoid that and details on the function itself, check the wiki page: https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer

There also may be a much simpler way of doing this. However, I've never used or tested this method so cannot be sure - Using LimitPlayerMarkerRadius
pawn Code:
COMMAND:markers( playerid, params[ ] )
{
   if( !IsPlayerAdmin( playerid ) ) return 1;
   LimitPlayerMarkerRadius( 0.1 );
   return 1;
}
However, I'm unaware of whether that function can only be used inside OnGameModeInit or not.
Reply
#3

Quote:
Originally Posted by NiZ
View Post
Mkay, I was wondering if it's possible to do an admin command which disables the blips for all players in the minimap?
And if that's not possible then is it possible to script a command for yourself what makes other people's blips disappear.
PHP Code:
// OnPlayerCommandText
if(!strcmp(cmdtext"/blipsoff"true))
{
    if(
GetPVarInt(playerid"Admin"))
    {
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                for(new 
0MAX_PLAYERSj++)
                {
                    if(
IsPlayerConnected(j) && != i)
                    {
                        
SetPlayerMarkerForPlayer(ij0x00000000);
                    }
                }
            }
        }
     }
    else return 
SendClientMessage(playerid, -1"[ERROR]: You are not an admin !");

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)