mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
Adds Automuting
Adds a system adapted from Aurora that will automatically mute someone if they say things too quickly in IC, OOC, Deadchat, Ahelp, or Pray.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// Based on Aurora's anti-spam system.
|
||||
/client/
|
||||
var/last_message_time = 0
|
||||
var/spam_alert = 0
|
||||
|
||||
/client/proc/handle_spam_prevention(var/mute_type = MUTE_ALL, var/spam_delay = 1 SECOND)
|
||||
if(world.time - last_message_time < spam_delay)
|
||||
spam_alert++
|
||||
if(spam_alert > 3)
|
||||
cmd_admin_mute(src.mob, mute_type, 1)
|
||||
else
|
||||
spam_alert = max(0, spam_alert--)
|
||||
last_message_time = world.time
|
||||
Reference in New Issue
Block a user