Send a message to everyone near except for the person self
#1

Hello.
Title.
I currently have this, but it sends to myself.
PHP код:
    format(iStrsizeof(iStr), "(RADIO) %s: %s"MaskedName(playerid), iText);
    
ProxDetectorEx(20.0playeridiStr);
    return 
1
I wanna send it to everyone, except for the person that does the command.
How do i do that?
Reply
#2

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, ...);
}
Reply
#3

PHP код:
for(new 0MAX_PLAYERSi++)
{
     New 
Float:XFloat:YFloat:Z;
     
GetPlayerPos(playeridXYZ);
     If(
IsPlayerConnected(i) && IsPlayerInRangeOf(iXYZ) && != playerid)
           
// send msg

Sorry IF any misstypes, wrote in My phone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)