Vice City: Multiplayer

Server Development => Scripting and Server Management => Script Showroom => Topic started by: Sonmez on Jul 30, 2020, 04:56 PM

Title: Auto Mute System (Update v2.0)
Post by: Sonmez on Jul 30, 2020, 04:56 PM
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;}}
Title: Re: Auto Mute System
Post by: SHy^ on Jul 30, 2020, 07:35 PM
Why are you releasing any thing untested?
Anyways, keep it up.
Title: Re: Auto Mute System
Post by: KrOoB_ on Jul 30, 2020, 10:17 PM
bruhh, gj anyway
(https://i.imgur.com/9GRtMdu.png)
Title: Re: Auto Mute System
Post by: Sonmez on Nov 15, 2020, 09:48 AM
It works fine...
Title: Re: Auto Mute System
Post by: Altay on Nov 16, 2020, 07:08 AM
Beautiful, i tested it.
Title: Re: Auto Mute System
Post by: Rupinder on Nov 17, 2020, 07:26 AM
How to add in script just download blank server script idk so much about just start learning few days ago :)
Title: Re: Auto Mute System
Post by: Inferno on Nov 17, 2020, 08:44 AM
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.
Title: Re: Auto Mute System
Post by: Mr.Dip 2020 on Dec 11, 2020, 04:50 PM
it worked thank you so much
Title: Re: Auto Mute System (Update v1.0)
Post by: Sonmez on Jul 17, 2021, 01:47 AM
Code has been updated