/l command.
#1

I want to make a /l command that has a limit of 20 chat radius, how do I do this from this code;
Код:
	if(!strcmp(cmdtext, "/l", true, 2))
 	{
        if(!cmdtext[2])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /l [text]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "((%s: %s))", str, cmdtext[3]);
        SendClientMessageToAll(COLOR_WHITE, str);
            return 1;
 	}
Reply
#2

Create a loop that checks to see how far other players are form the person who sent the message.
Reply
#3

add this:
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i<GetMaxPlayers(); i++)
{
  if(IsPlayerConnected(i))
  {
    if(IsPlayerInRangeOfPoint(i, 20.00, x, y, z))
    {
      SendClientMessage(i, COLOR_WHITE, str);
    }
  }
}
Reply
#4

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)