DizzasTeR-

Mama1

Apr 4th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.71 KB | None | 0 0
  1. function onPlayerChat( player, message ) {
  2.   msg = message.tolower();
  3.   local wrapEvent = { Trigger = false, Data = null };
  4.   if(msg=="lol"|| msg=="kek") {
  5.         wrapEvent.Data = ">>[#12F50A] "+player.Name + " is laughing out loud!";
  6.         wrapEvent.Trigger = true;
  7.     }
  8. if(msg=="lmao") {
  9.     wrapEvent.Data = "+player.Name + " is laughing his ass off!";
  10.     wrapEvent.Trigger = true;
  11. }
  12. if ( message.slice(0,1) == "\\" ) {
  13.  local text = message.slice(1);
  14.  for( local i = 0; i < GetMaxPlayers(); i++ ) {
  15.   local plr = FindPlayer( i );
  16.   if ( plr && plr.Team == player.Team ) {
  17.     local pCol = player.Colour;
  18.     local tCol = format("[#%X%X%X]",pCol.r,pCol.g,pCol.b);
  19.     MessagePlayer("[#FF0505](Team-Chat) " + tCol + player.Name + "[#377330]:[#FFFFFF] " + text, plr);
  20.    }
  21.   }
  22.   return 0;
  23.  }
  24. local MUTE_DIVIDE = 1000;
  25. if( time() - antiSpamTime[ player.ID ] > 1 ){
  26.   IsMuted[ player.ID ] = false;
  27. }
  28.        if ( ( time() - antiSpamTime[ player.ID ] ) <= LIMT_REP_TIME ) {
  29.  antiSpamWarnings[ player.ID ]++;
  30.  if ( antiSpamWarnings[ player.ID ] >= LIMIT_REP_SPAM ) {
  31.   if( !IsMuted[ player.ID ] ){
  32.     IsMuted[ player.ID ] = true;
  33.     antiSpamTime[ player.ID ] = time() + (MUTE_TIME/MUTE_DIVIDE);
  34.     Message(format(">> [#FFEE03]Auto-Muted: %s Reason: Spamming the Chat. Duration[ %d seconds ]",player.Name,MUTE_TIME/MUTE_DIVIDE) );
  35.   }
  36.  }
  37. } else {
  38.  antiSpamWarnings[ player.ID ] = 0;
  39.  antiSpamTime[ player.ID ] = time();
  40. }
  41.  
  42. if( IsMuted[ player.ID] ){
  43. MessagePlayer(">> [#FFEE03]You are muted. Please wait more " + ( antiSpamTime[ player.ID ] - time() )  + " seconds" ,player);
  44. return 0;
  45. }
  46. else{
  47.     if( wrapEvent.Trigger ) {
  48.         Message( player.Name + ": " + wrapEvent.Data );
  49.         return 0;
  50.     }
  51.     else {
  52.         return 1;
  53.     }
  54. }
  55. }
Add Comment
Please, Sign In to add comment