Auto Mute System
[ GameMode ] ADM Script v1.0 »

Sonmez

  • Jr. Member
  • Yo! It's time to play the fair game!
  • Posts: 55
Auto Mute System
«  »Last edited
Code: [Select]
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)
{
    local player = FindPlayer(p)
    if (!player) return false;
    chat[player.ID].rep = 0;
}
function UnMuteTimer(p)
{
    local player = FindPlayer(p)
    if (!player) return false;
    Message(player.Name+" unmuted. Please don't spam chat.");
    chat[player.ID].rep = 0;
    chat[player.ID].muted = false;
}

If you find any bug reply it!
if (!perfect) createAgain();

SHy^

  • Jr. Member
  • Don't dare to mess
  • Posts: 96
Re: Auto Mute System
« Reply #1,  »
Why are you releasing any thing untested?
Anyways, keep it up.

KrOoB_

  • Full Member
  • Keeper
  • Posts: 175

|-> VC:MP Player Since 2014
|-> VC-TR Founder
|-> VC-TR Scripter and Hoster


Sonmez

  • Jr. Member
  • Yo! It's time to play the fair game!
  • Posts: 55
if (!perfect) createAgain();

Altay

  • Newbie
  • Server Owner
  • Posts: 23
Mustafa Kemal ATATURK, the man who changed the course of history. https://en.wikipedia.org/wiki/Mustafa_Kemal_Atat%C3%BCrk

Rupinder

  • Newbie
  • Posts: 22
Re: Auto Mute System
« Reply #5,  »
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

  • Jr. Member
  • Posts: 81
Re: Auto Mute System
« Reply #6,  »
Quote from Rupinder on November 17th, 2020, 07:26 AM
How 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

  • Newbie
  • Posts: 6
Re: Auto Mute System
« Reply #7,  »
it worked thank you so much

[ GameMode ] ADM Script v1.0 »