26.09.2014, 18:00
pawn Код:
#include <a_samp>
#include <foreach>
public OnPlayerText(playerid, text[])
{
new string[144], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s says: %s", name, text);
SendNearbyMsg(playerid, string, 5.0, -1);
return false;
}
SendNearbyMsg(playerid, text[], Float: radius, color)
{
new Float: pX, Float: pY, Float: pZ;
GetPlayerPos(playerid, pX, pY, pZ);
foreach(new i: Player)
{
if(IsPlayerInRangeOfPoint(i, radius, pX, pY, pZ))
{
SendClientMessage(i, color, text);
}
}
return true;
}