Try this. Also get sscanf from the link inside of the code.
What this code basically does is checks if the player is connected, if the player is in range of the other player, etc.
pawn Код:
#include <a_samp>
//Included In Main Server Includes
#include <sscanf>
//https://sampforum.blast.hk/showthread.php?tid=120356 - sscanf
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/me", cmdtext, true, 3) == 0)
{
new chat[256],str1[128],Float:X,Float:Y,Float:Z,playername[MAX_PLAYER_NAME];
if(sscanf(cmdtext, "s[128]", chat)) return SendClientMessage(playerid, -1, "USAGE: /me [text]");
else
{
GetPlayerPos(playerid,X,Y,Z);
GetPlayerName(playerid,playername,sizeof(playername));
format(str1,sizeof(str1),"%s (%d): %s",playername,playerid,chat);
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,15,X,Y,Z))
{
SendClientMessage(i,-1,str1);
}
}
}
}
return 1;
}
return 0;
}