/l 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: /l command. (
/showthread.php?tid=275859)
/l command. -
Rabbayazza - 11.08.2011
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;
}
Re: /l command. -
ScottCFR - 11.08.2011
Create a loop that checks to see how far other players are form the person who sent the message.
Re: /l command. -
Sascha - 11.08.2011
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);
}
}
}
Re: /l command. -
Rabbayazza - 11.08.2011
Thanks