Auto Mute System (Update v2.0)

Started by Sonmez, Jul 30, 2020, 04:56 PM

Previous topic - Next topic

Sonmez

class ChatClass{rep = 0;muted = false;}
function onScriptLoad( ){
  chat <- array(GetMaxPlayers(),null);
}

function onPlayerJoin(player){
  chat[player.ID] = ChatClass()
}

function onPlayerChat(player,text){if (chat[player.ID].muted == true) return false;
  if (chat[player.ID].rep == 3){
    chat[player.ID].muted = true;
    Message(player.Name+" muted for 15 seconds. Reason: Spam");
    NewTimer("UnMuteTimer", 15000, 1, player.ID);
    return false;
  }chat[player.ID].rep +=1;
  if (chat[player.ID].rep == 1){NewTimer("RepTimer", 3000, 1, player.ID);}
  return true;
}

function RepTimer(p){p=FindPlayer(p);if(p){chat[p.ID].rep = 0;}}

function UnMuteTimer(p){p=FindPlayer(p);if(p){Message(p.Name+" unmuted. Please don't spam chat.");chat[p.ID].rep = 0;chat[p.ID].muted = false;}}
if (!perfect) createAgain();

SHy^

Why are you releasing any thing untested?
Anyways, keep it up.

KrOoB_


Sonmez

if (!perfect) createAgain();

Altay

Beautiful, i tested it.
Mustafa Kemal ATATURK, the man who changed the course of history. https://en.wikipedia.org/wiki/Mustafa_Kemal_Atat%C3%BCrk

Rupinder

How to add in script just download blank server script idk so much about just start learning few days ago :)
Vice City Servers
https://bit.ly/2Uw2usM

Inferno

Quote from: Rupinder on Nov 17, 2020, 07:26 AMHow to add in script just download blank server script idk so much about just start learning few days ago :)

He has added them alongwitj event names.


Place class on top of script in main.nut

And rest see the events in your script like OnPlayerChat copy the codes from those events into your script.
Viva la VU
VFS Developer
VCCNR Administrator

Mr.Dip 2020

it worked thank you so much

Sonmez

if (!perfect) createAgain();