http://forum.sa-mp.com/index.php?topic=116240.0
I am using that command system and sscanf, which can be found here:
https://sampwiki.blast.hk/wiki/Sscanf
pawn Код:
COMMAND:s(playerid, params[])
{
new
msg[ 128 ];
if (sscanf(params, "s", msg)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /s [message]");
else
{
new
pName[ MAX_PLAYER_NAME ],
string[ 155 ],
Float: X,
Float: Y,
Float: Z;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, pName, sizeof( pName ) );
format(string, sizeof(string), "%s: %s", pName, msg );
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if(IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z )
{
SendClientMessage(i, 0xFFFF00AA, string );
}
}
}
return 1;
}
Change the 10.0 here: if(IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z ) to whatever you want to be the distance a player can be away from the player who is typing the command.