Talking to people if they are near.
#10

I have a stock function for you, which sends message to range players of specific position.

pawn Код:
SendMessageToRangePlayer(color, message[], x, y, z, range = 30.0)
pawn Код:
stock SendMessageToRangePlayer(color, message[], x, y, z, range = 30.0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, range, x, y, z))
        {
            SendClientMessage(i, color, message);
        }
    }
    return 1;
}
You can use as example below OnPlayerText.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new string[128], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "%s:  %s", pName[playerid], text);

    SendMessageToRangePlayer(-1, string, x, y, z);
    return 1;
}
Reply


Messages In This Thread
Talking to people if they are near. - by Mey6155 - 16.11.2013, 12:10
Re: Talking to people if they are near. - by Konstantinos - 16.11.2013, 12:14
Re: Talking to people if they are near. - by whando - 16.11.2013, 12:17
Re: Talking to people if they are near. - by PrivatioBoni - 16.11.2013, 12:20
Re: Talking to people if they are near. - by Smally - 16.11.2013, 12:25
Re: Talking to people if they are near. - by whando - 16.11.2013, 12:29
Re: Talking to people if they are near. - by Mey6155 - 16.11.2013, 13:09
Re: Talking to people if they are near. - by Konstantinos - 16.11.2013, 13:32
Re: Talking to people if they are near. - by Pottus - 16.11.2013, 13:53
AW: Talking to people if they are near. - by Skimmer - 16.11.2013, 14:04

Forum Jump:


Users browsing this thread: 4 Guest(s)