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;}}
Why are you releasing any thing untested?
Anyways, keep it up.
bruhh, gj anyway
(https://i.imgur.com/9GRtMdu.png)
It works fine...
Beautiful, i tested it.
How to add in script just download blank server script idk so much about just start learning few days ago :)
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.
it worked thank you so much
Code has been updated