Need a /nearplayers command - 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: Need a /nearplayers command (
/showthread.php?tid=147299)
Need a /nearplayers command -
Fay-Tony - 11.05.2010
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.
Re: Need a /nearplayers command -
kLx - 11.05.2010
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.
Re: Need a /nearplayers command -
Think - 11.05.2010
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 );
}
}
Re: Need a /nearplayers command -
kLx - 11.05.2010
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
Re: Need a /nearplayers command -
Fay-Tony - 12.05.2010
Thank you guys, at all