[R2]RobBinG SvR* By Action**
Applications => Commands & Functions => Topic started by: $TyLiXx AbBa$ii on January 01, 2015, 07:49:43 am
-
function onPlayerChat( player, text )
{
// Echoes the message
local color;
if(player.IsMuted==true) PrivMessage("You are muted so no one can read your messages!!",player);
if(binfo[player.ID].Ptext==null)binfo[player.ID].Ptext=text;
else if(binfo[player.ID].Ptext==text) binfo[player.ID].Ptextcount=binfo[player.ID].Ptextcount+1;
else binfo[player.ID].Ptextcount=0;
binfo[player.ID].Ptext=text;
if(binfo[player.ID].Stimer==0) binfo[player.ID].Stimer=GetTime().tointeger();
else if((GetTime().tointeger()-binfo[player.ID].Stimer)<2) binfo[player.ID].SCounter=binfo[player.ID].SCounter+1;
else
{
binfo[player.ID].SCounter=0;
binfo[player.ID].Stimer=GetTime().tointeger();
}
if((binfo[player.ID].SCounter>2 || binfo[player.ID].Ptextcount>3) && player.IsMuted == false && (GetLevel(player)==1))
{
player.IsMuted = true;
binfo[player.ID].SCounter=0;
binfo[player.ID].Ptextcount=0;
ClientMessage ( "You have been Auto-muted for one minute for spamming!", player 159,204,280);
NewTimer("unmute",60000,1,player.ID);
}
else if((binfo[player.ID].SCounter>=2 || binfo[player.ID].Ptextcount>3) && player.IsMuted == false) Kick( player, "auto", "spamming while Muted" );
switch ( player.Skin )
{
case 1:
color = ICOL_LBLUE;
break;
case 2:
color = ICOL_BLUE;
break;
case 3:
color = ICOL_CYAN;
break;
case 4:
color = ICOL_GREEN;
break;
case 5:
color = ICOL_LGREEN;
break;
default:
color = ICOL_BROWN;
}
messagez.push( {
name = player.Name,
team = player.Team,
msg = text,
type = 4
});
if(messagez.len() > 20) messagez.remove(0);
EchoMessage( ICOL_GREEN + "[" + player.ID + "] " + ICOL + color + "" + player.Name + "> " + ICOL + text );
-
nice work abbasi :) :) :) :P