Send a message to everyone near except for the person self - 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)
+--- Thread: Send a message to everyone near except for the person self (
/showthread.php?tid=608531)
Send a message to everyone near except for the person self -
justjamie - 02.06.2016
Hello.
Title.
I currently have this, but it sends to myself.
PHP код:
format(iStr, sizeof(iStr), "(RADIO) %s: %s", MaskedName(playerid), iText);
ProxDetectorEx(20.0, playerid, iStr);
return 1;
I wanna send it to everyone, except for the person that does the command.
How do i do that?
Re: Send a message to everyone near except for the person self -
Konstantinos - 02.06.2016
Have a loop through the players and if the iterator variable is equal to the playerid, skip it.
pawn Код:
for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++) // foreach(new i : Player)
{
if (i == playerid) continue;
SendClientMessage(i, ...);
}
Re: Send a message to everyone near except for the person self -
Luicy. - 02.06.2016
PHP код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
New Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
If(IsPlayerConnected(i) && IsPlayerInRangeOf(i, X, Y, Z) && i != playerid)
// send msg
}
Sorry IF any misstypes, wrote in My phone.