help, Global Chat/near chat
#7

Just loop through all players, and check if they're near the player that wrote, and then send the message.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new Float:x, Float:y, Float:z; // Declares 3 floats
    GetPlayerPos(playerid, x, y, z); // Store the position of the player that wrote in the floats we created
    foreach(new i : Player) // Loop through all players, and define them as "i"
    {
        if(IsPlayerInRangeOfPoint(i, range, x, y, z)) SendPlayerMessageToPlayer(playerid, i, text);
            // If "i" is in range of the xyz (which is the position of the player that wrote) send him the message, change the range to the distance you want
    }
    return 1;
}
In /g, just use Send Player/Client MessageToAll.
Reply


Messages In This Thread
help, Global Chat/near chat - by StarPeens - 10.03.2015, 23:45
Re: help, Global Chat/near chat - by chsulaj - 11.03.2015, 00:09
Re: help, Global Chat/near chat - by StarPeens - 11.03.2015, 00:15
Re: help, Global Chat/near chat - by chsulaj - 11.03.2015, 00:38
Re: help, Global Chat/near chat - by chsulaj - 11.03.2015, 00:42
Re: help, Global Chat/near chat - by StarPeens - 11.03.2015, 00:55
Re: help, Global Chat/near chat - by CalvinC - 11.03.2015, 06:13

Forum Jump:


Users browsing this thread: 1 Guest(s)