function remoteSay(%clientId, %team, %message)
{
%msg = %clientId @ " \"" @ escapeString(%message) @ "\"";
echo("Message From: " @ %clientId @ " : " @ %message);
if($Server::FloodProtectionEnabled)
{
%time = getIntegerTime(true) >> 5;
if(%clientId.floodMute)
{
%delta = %clientId.muteDoneTime - %time;
if(%delta > 0)
{
Client::sendMessage(%clientId, $MSGTypeGame, "FLOOD! You cannot talk for " @ %delta @ " seconds.");
return;
}
%clientId.floodMute = "";
%clientId.muteDoneTime = "";
}
%clientId.floodMessageCount++;
schedule(%clientId @ ".floodMessageCount--;", 5, %clientId);
if(%clientId.floodMessageCount > 4)
{
%clientId.floodMute = true;
%clientId.muteDoneTime = %time + 10;
Client::sendMessage(%clientId, $MSGTypeGame, "FLOOD! You cannot talk for 10 seconds.");
return;
}
}
if(%team)
{
if($dedicated)
echo("SAYTEAM: " @ %msg);
%team = Client::getTeam(%clientId);
for(%cl = Client::getFirst(); %cl != -1; %cl = Client::getNext(%cl))
if(Client::getTeam(%cl) == %team && !%cl.muted[%clientId])
Client::sendMessage(%cl, $MsgTypeTeamChat, %message, %clientId);
}
else
{
if($dedicated)
echo("SAY: " @ %msg);
for(%cl = Client::getFirst(); %cl != -1; %cl = Client::getNext(%cl))
if(!%cl.muted[%clientId])
Client::sendMessage(%cl, $MsgTypeChat, %message, %clientId);
}
}