05.06.2011, 14:52
pawn Код:
stock MessageToClientsInRadius(playerid, iColor, szString[], Float: fRadius = 5.0) {
if(!IsPlayerConnected(playerid))
return 1;
new
l_iLocation[2],
Float: l_fPosition[3];
GetPlayerPos(playerid, l_fPosition[0], l_fPosition[1], l_fPosition[2]);
l_iLocation[0] = GetPlayerInterior(playerid);
l_iLocation[1] = GetPlayerVirtualWorld(playerid);
foreach(Player, i) {
if(IsPlayerInRangeOfPoint(i, fRadius, l_fPosition[0], l_fPosition[1], l_fPosition[2])) {
if(GetPlayerVirtualWorld(i) == l_iLocation[1] && GetPlayerInterior(i) == l_iLocation[0]) {
SendClientMessage(i, iColor, szString);
}
}
}
return 1;
}
CMD:shout(playerid, params[]) {
if(isnull(params))
return SendClientMessage(playerid, 0, "Syntax: /shout [message]");
MessageToClientsInRadius(playerid, 0, params, 25);
return 1;
}
Try this, I haven't tested it though.
You'll need foreach & zcmd.