05.12.2009, 09:08
pawn Код:
stock SendPlayerLocalChat(playerid, color, string[], radius)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i,radius,X,Y,Z)
{
SendClientMessage(i,color,string);
}
}
}
return 1;
}
now when you use this you need to format the string, say like this:
pawn Код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),%s(%d) says: %s",name, playerid, message);
SendPlayerLocalChat(playerid,0xFFFFFFF,string,10);