Chatting with ClientMessages.
#2

Your code wouldn't work because if there was 3 people:
ID 0
ID 1
ID 2
Lets say ID 1 quit then the player variable would change to 2 but it would only reach ID 0 because ID 2 is out of the loop. You could either use foreach or the following:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[24], message[128];
    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);
    for (new id; id<MAX_PLAYERS; id++)
        {
        if (!IsPlayerConnected(id)) continue;
            if(IsPlayerInRangeOfPoint(id, 20.0, x, y, z))  SendClientMessage(id, -1, message);
    }
   
    return 0;
}
Your code also didn't work because you don't get the players position .
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: 5 Guest(s)