Need a /nearplayers command
#1

Hey.
I need a command to an RP server.
I watched some RP mods but i can't see any "/nearplayers" to admins.
I would like to:
/nearplayers
NEARBY PLAYERS:
******_******
******_*****


You know...
Please help me out Thanks.
Reply
#2

pawn Код:
SendClientMessage( playerid, COLOR_GRAD1, "Near players:" );
    new
      Float:ax, Float:ay, Float:az, name[ MAX_PLAYER_NAME ];
    GetPlayerPos( playerid, ax, ay, az );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if( IsPlayerInRangeOfPoint( i, 10.0, ax, ay, az ) )
      {
        GetPlayerName( i, name, MAX_PLAYER_NAME );
            SendClientMessage( i, COLOR_GRAD2, name );
        }
    }
untested, should work anyway.
Reply
#3

Quote:
Originally Posted by kLx
pawn Код:
SendClientMessage( playerid, COLOR_GRAD1, "Near players:" );
    new
      Float:ax, Float:ay, Float:az, name[ MAX_PLAYER_NAME ];
    GetPlayerPos( playerid, ax, ay, az );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if( IsPlayerInRangeOfPoint( i, 10.0, ax, ay, az ) )
      {
        GetPlayerName( i, name, MAX_PLAYER_NAME );
            SendClientMessage( i, COLOR_GRAD2, name );
        }
    }
untested, should work anyway.
should send it to the player not the one near him

pawn Код:
SendClientMessage( playerid, COLOR_GRAD1, "Near players:" );
    new
      Float:ax, Float:ay, Float:az, name[ MAX_PLAYER_NAME ];
    GetPlayerPos( playerid, ax, ay, az );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if( IsPlayerInRangeOfPoint( i, 10.0, ax, ay, az ) )
      {
        GetPlayerName( i, name, MAX_PLAYER_NAME );
            SendClientMessage( playerid, COLOR_GRAD2, name );
        }
    }
Reply
#4

Quote:
Originally Posted by Pandabeer1337
Quote:
Originally Posted by kLx
pawn Код:
SendClientMessage( playerid, COLOR_GRAD1, "Near players:" );
    new
      Float:ax, Float:ay, Float:az, name[ MAX_PLAYER_NAME ];
    GetPlayerPos( playerid, ax, ay, az );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if( IsPlayerInRangeOfPoint( i, 10.0, ax, ay, az ) )
      {
        GetPlayerName( i, name, MAX_PLAYER_NAME );
            SendClientMessage( i, COLOR_GRAD2, name );
        }
    }
untested, should work anyway.
should send it to the player not the one near him

pawn Код:
SendClientMessage( playerid, COLOR_GRAD1, "Near players:" );
    new
      Float:ax, Float:ay, Float:az, name[ MAX_PLAYER_NAME ];
    GetPlayerPos( playerid, ax, ay, az );
    for(new i=0; i<MAX_PLAYERS; i++)
    {
      if( IsPlayerInRangeOfPoint( i, 10.0, ax, ay, az ) )
      {
        GetPlayerName( i, name, MAX_PLAYER_NAME );
            SendClientMessage( playerid, COLOR_GRAD2, name );
        }
    }
True, miss typed that
Reply
#5

Thank you guys, at all
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)