How to send a message to near players
#4

I created a simple function for you
pawn Код:
stock SendNearMessage(playerid, color, string[], Float:radius)
{
    new Float:Position[3];
    GetPlayerPos(playerid,Position[0],Position[1],Position[2]);

    for(new i; i <= MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(playerid)) continue;

        if(IsPlayerInRangeOfPoint(i,radius, Position[0],Position[1],Position[2]))
            return SendClientMessage(i, color, string);
    }
    return 1;
}
Replace
pawn Код:
SendClientMessageToAll(COLOR_PURPLE, RandomMSG[randMSG]);
To
pawn Код:
SendNearMessage(playerid, COLOR_PURPLE, RandomMSG[randMSG], 15.0);
Reply


Messages In This Thread
How to send a message to near players - by bustern - 16.11.2013, 15:32
Re: How to send a message to near players - by Voxel - 16.11.2013, 15:36
Re: How to send a message to near players - by bustern - 16.11.2013, 15:43
Re: How to send a message to near players - by Patrick - 16.11.2013, 15:47
Re: How to send a message to near players - by bustern - 16.11.2013, 15:51
Re: How to send a message to near players - by Voxel - 16.11.2013, 15:57
Re: How to send a message to near players - by bustern - 16.11.2013, 16:14
Re: How to send a message to near players - by Voxel - 16.11.2013, 16:19
Re: How to send a message to near players - by Patrick - 16.11.2013, 16:20
Re: How to send a message to near players - by bustern - 16.11.2013, 16:23

Forum Jump:


Users browsing this thread: 1 Guest(s)