Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onPlayerChat( player, message ) {
- msg = message.tolower();
- local wrapEvent = { Trigger = false, Data = null };
- if(msg=="lol"|| msg=="kek") {
- wrapEvent.Data = ">>[#12F50A] "+player.Name + " is laughing out loud!";
- wrapEvent.Trigger = true;
- }
- if(msg=="lmao") {
- wrapEvent.Data = "+player.Name + " is laughing his ass off!";
- wrapEvent.Trigger = true;
- }
- if ( message.slice(0,1) == "\\" ) {
- local text = message.slice(1);
- for( local i = 0; i < GetMaxPlayers(); i++ ) {
- local plr = FindPlayer( i );
- if ( plr && plr.Team == player.Team ) {
- local pCol = player.Colour;
- local tCol = format("[#%X%X%X]",pCol.r,pCol.g,pCol.b);
- MessagePlayer("[#FF0505](Team-Chat) " + tCol + player.Name + "[#377330]:[#FFFFFF] " + text, plr);
- }
- }
- return 0;
- }
- local MUTE_DIVIDE = 1000;
- if( time() - antiSpamTime[ player.ID ] > 1 ){
- IsMuted[ player.ID ] = false;
- }
- if ( ( time() - antiSpamTime[ player.ID ] ) <= LIMT_REP_TIME ) {
- antiSpamWarnings[ player.ID ]++;
- if ( antiSpamWarnings[ player.ID ] >= LIMIT_REP_SPAM ) {
- if( !IsMuted[ player.ID ] ){
- IsMuted[ player.ID ] = true;
- antiSpamTime[ player.ID ] = time() + (MUTE_TIME/MUTE_DIVIDE);
- Message(format(">> [#FFEE03]Auto-Muted: %s Reason: Spamming the Chat. Duration[ %d seconds ]",player.Name,MUTE_TIME/MUTE_DIVIDE) );
- }
- }
- } else {
- antiSpamWarnings[ player.ID ] = 0;
- antiSpamTime[ player.ID ] = time();
- }
- if( IsMuted[ player.ID] ){
- MessagePlayer(">> [#FFEE03]You are muted. Please wait more " + ( antiSpamTime[ player.ID ] - time() ) + " seconds" ,player);
- return 0;
- }
- else{
- if( wrapEvent.Trigger ) {
- Message( player.Name + ": " + wrapEvent.Data );
- return 0;
- }
- else {
- return 1;
- }
- }
- }
Add Comment
Please, Sign In to add comment