Well, I can provide the simple concept of range. If you want someone to see the command/text you displace, you can use this stock.
pawn Код:
stock PlayerToPlayer(playerid,targetid,Float:distance)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
if(IsPlayerInRangeOfPoint(targetid,distance,x,y,z))
{
return true;
}
return false;
}
The parameters are self explanatory (hopefully you understand them). And example could be as followed:
pawn Код:
public OnPlayerText(playerid, text[])
{
new pname[24], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerToPlayer(playerid,i,7))
{
strreplace(pname, '_', ' ');
format(string, sizeof(string), "%s says: %s", pname, text);
SendClientMessage(i, COLOR_WHITE, string);
}
}
return 0;
}
Above states that when a player sends text (just text, no command) it will loop through every player to check if they are near him. If they are, they continue on, if not, no text will be sent you them. Hope I explained it well enough.