How to make Nearby OnPlayerText
#2

Created this simple function for you, this will send a message to the players who's in range, that you have set.

Code
pawn Код:
stock SendNearByMessage(playerid, color, Float:radius, const message[])
{
    new
        Float:Position[ 3 ], i = 0
    ;

    GetPlayerPos( playerid, Position[ 0 ], Position[ 1 ], Position[ 2 ]);
    while(i < MAX_PLAYERS)
    {
        if(!IsPlayerConnected(playerid)) continue;

        if(IsPlayerInRangeOfPoint(i, radius, Position[ 0 ], Position[ 1 ], Position[ 2 ]))
        {
            SendClientMessage(i, color, message); return true;
        }
        i++;
    }
    return false;
}
Example of Usage
pawn Код:
public OnPlayerConnect(playerid)
{
    return SendNearByMessage(playerid, -1, 20.0, "Message Here");
}
Reply


Messages In This Thread
How to make Nearby OnPlayerText - by dakata994 - 24.12.2013, 12:31
Re: How to make Nearby OnPlayerText - by Patrick - 24.12.2013, 12:38
Re: How to make Nearby OnPlayerText - by dakata994 - 24.12.2013, 12:42
Re: How to make Nearby OnPlayerText - by Patrick - 24.12.2013, 12:45
Re: How to make Nearby OnPlayerText - by Konstantinos - 24.12.2013, 12:47
Re: How to make Nearby OnPlayerText - by dakata994 - 24.12.2013, 12:54

Forum Jump:


Users browsing this thread: 2 Guest(s)