Talking to people if they are near.
#5

pawn Код:
stock nearByMessage(playerid, color, string[], Float: Distance = 12.0) {
    new
        Float: nbCoords[3];

    GetPlayerPos(playerid, nbCoords[0], nbCoords[1], nbCoords[2]);

    foreach(Player, i) {
        if(IsPlayerInRangeOfPoint(i, Distance, nbCoords[0], nbCoords[1], nbCoords[2]) && (GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))) {
            SendClientMessage(i, color, string);
        }
    }

    return 1;
}
Then use nearByMessage instead of SendClientMessage when you want to send it to near by players.
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: 1 Guest(s)