Chatting with ClientMessages.
#4

I've decided to use the "foreach" loop. I thank you for your constructive criticism, attitude, and help.

The script below is what the finished product (of this thread) is.


pawn Код:
#include <a_samp>
#include <foreach>

public OnPlayerText(playerid, text[]) {
    new name[256], message[256];
    new Float:x, Float:y, Float:z;

    GetPlayerName(playerid, name, sizeof(name));
    format(message, sizeof(message), "%s says, \"%s\"",  name, text);
   
    GetPlayerPos(playerid, x, y, z);
   
    foreach (new player : Player) {
        if (IsPlayerInRangeOfPoint(player, 20.0, x, y, z)) {
            SendClientMessage(player, -1, message);
        }
    }
   
    return 0;
}
Reply


Messages In This Thread
Chatting with ClientMessages. - by SHRP - 01.01.2013, 09:08
Re: Chatting with ClientMessages. - by [HiC]TheKiller - 01.01.2013, 09:32
Re: Chatting with ClientMessages. - by SHRP - 01.01.2013, 09:47
Re: Chatting with ClientMessages. - by SHRP - 01.01.2013, 11:27

Forum Jump:


Users browsing this thread: 3 Guest(s)