var/global/BSACooldown = 0
var/global/enabled_spooking = 0
////////////////////////////////
/proc/message_admins(var/msg)
msg = "ADMIN LOG: [msg]"
for(var/s in GLOB.staff)
var/client/C = s
if((R_ADMIN|R_MOD) & C.holder.rights)
to_chat(C, msg)
/proc/message_cciaa(var/msg)
msg = "CCIA LOG: [msg]"
for(var/s in GLOB.staff)
var/client/C = s
if(R_CCIAA & C.holder.rights)
to_chat(C, msg)
/proc/msg_admin_attack(var/text,var/ckey="",var/ckey_target="") //Toggleable Attack Messages
log_attack(text)
var/rendered = "ATTACK: [text]"
for(var/s in GLOB.staff)
var/client/C = s
if((R_ADMIN|R_MOD) & C.holder.rights)
if(C.prefs.toggles & CHAT_ATTACKLOGS)
var/msg = rendered
to_chat(C, msg)
/proc/admin_notice(var/message, var/rights)
for(var/mob/M in GLOB.mob_list)
if(check_rights(rights, 0, M))
to_chat(M, message)
///////////////////////////////////////////////////////////////////////////////////////////////Panels
/datum/admins/proc/show_player_panel(var/mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Show Player Panel"
set desc="Edit player (respawn, ban, heal, etc)"
if(!M)
to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.")
return
if (!istype(src,/datum/admins))
src = usr.client.holder
if (!istype(src,/datum/admins))
to_chat(usr, "Error: you are not an admin!")
return
var/ui_scale = owner.prefs?.ui_scale
var/body = "
Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!"))
log_admin("[key_name(usr)] initiated a reboot.")
feedback_set_details("end_error","admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
sleep(50)
world.Reboot()
/datum/admins/proc/announce()
set category = "Special Verbs"
set name = "Announce"
set desc="Announce your desires to the world"
if (!check_rights(R_ADMIN))
return
var/message = tgui_input_text(usr, "Enter a global message to send.", "Admin Announce", multiline = TRUE)
if(message)
if(!check_rights(R_SERVER, 0))
message = sanitize(message, 500, extra = 0)
message = replacetext(message, "\n", "
") // required since we're putting it in a tag
to_world("[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:[message]
")
log_admin("Announce: [key_name(usr)] : [message]")
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggleooc()
set category = "Server"
set desc="Globally Toggles OOC"
set name="Toggle OOC"
if(!check_rights(R_ADMIN))
return
GLOB.config.ooc_allowed = !(GLOB.config.ooc_allowed)
if (GLOB.config.ooc_allowed)
to_world("The OOC channel has been globally enabled!")
else
to_world("The OOC channel has been globally disabled!")
log_and_message_admins("toggled OOC.")
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/togglelooc()
set category = "Server"
set desc="Globally Toggles LOOC"
set name="Toggle LOOC"
if(!check_rights(R_ADMIN))
return
GLOB.config.looc_allowed = !(GLOB.config.looc_allowed)
if (GLOB.config.looc_allowed)
to_world("The LOOC channel has been globally enabled!")
else
to_world("The LOOC channel has been globally disabled!")
log_and_message_admins("toggled LOOC.")
feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggledsay()
set category = "Server"
set desc="Globally Toggles DSAY"
set name="Toggle DSAY"
if(!check_rights(R_ADMIN))
return
GLOB.config.dsay_allowed = !(GLOB.config.dsay_allowed)
if (GLOB.config.dsay_allowed)
to_world("Deadchat has been globally enabled!")
else
to_world("Deadchat has been globally disabled!")
log_admin("[key_name(usr)] toggled deadchat.")
message_admins("[key_name_admin(usr)] toggled deadchat.", 1)
feedback_add_details("admin_verb","TDSAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc
/datum/admins/proc/toggleoocdead()
set category = "Server"
set desc="Toggle Dead OOC."
set name="Toggle Dead OOC"
if(!check_rights(R_ADMIN))
return
GLOB.config.dooc_allowed = !( GLOB.config.dooc_allowed )
log_and_message_admins("toggled dead (global) OOC. (New state: [GLOB.config.dooc_allowed])")
feedback_add_details("admin_verb","TDOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggle_dead_looc()
set category = "Server"
set desc = "Toggle Dead LOOC."
set name = "Toggle Dead LOOC"
if (!check_rights(R_ADMIN))
return
GLOB.config.dead_looc_allowed = !GLOB.config.dead_looc_allowed
log_and_message_admins("toggled dead LOOC. (New state: [GLOB.config.dead_looc_allowed])")
/datum/admins/proc/togglehubvisibility()
set category = "Server"
set desc="Globally Toggles Hub Visibility"
set name="Toggle Hub Visibility"
if(!check_rights(R_SERVER))
return
world.visibility = !(world.visibility)
var/long_message = " toggled hub visibility. The server is now [world.visibility ? "visible" : "invisible"] ([world.visibility])."
SSdiscord.post_webhook_event(WEBHOOK_ADMIN, list("title"="Hub visibility has been toggled", "message"="**[key_name(src)]**" + long_message))
SSdiscord.send_to_admins("[key_name(src)]" + long_message)
message_admins("[key_name_admin(usr)]" + long_message, 1)
log_admin("[key_name(usr)] toggled hub visibility.")
feedback_add_details("admin_verb","THUB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc
/datum/admins/proc/toggletraitorscaling()
set category = "Server"
set desc="Toggle traitor scaling"
set name="Toggle Traitor Scaling"
GLOB.config.traitor_scaling = !GLOB.config.traitor_scaling
log_admin("[key_name(usr)] toggled Traitor Scaling to [GLOB.config.traitor_scaling].")
message_admins("[key_name_admin(usr)] toggled Traitor Scaling [GLOB.config.traitor_scaling ? "on" : "off"].", 1)
feedback_add_details("admin_verb","TTS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/startnow()
set category = "Server"
set desc="Start the round RIGHT NOW"
set name="Start Now"
if(!MC_RUNNING())
to_chat(usr, SPAN_NOTICE("The round will be started automatically as soon as ready."))
UNTIL(SSticker?.current_state == GAME_STATE_PREGAME)
if(SSticker.current_state == GAME_STATE_PREGAME)
SSticker.current_state = GAME_STATE_SETTING_UP
log_admin("[usr.key] has started the game.")
message_admins(SPAN_NOTICE("[usr.key] has started the game."))
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return 1
else
to_chat(usr, SPAN_WARNING("Error: Start Now: Game has already started."))
return 0
/datum/admins/proc/toggleenter()
set category = "Server"
set desc="People can't enter"
set name="Toggle Entering"
GLOB.config.enter_allowed = !(GLOB.config.enter_allowed)
if (!(GLOB.config.enter_allowed))
to_world("New players may no longer enter the game.")
else
to_world("New players may now enter the game.")
log_admin("[key_name(usr)] toggled new player game entering.")
message_admins(SPAN_NOTICE("[key_name_admin(usr)] toggled new player game entering."), 1)
world.update_status()
feedback_add_details("admin_verb","TE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggleAI()
set category = "Server"
set desc="People can't be AI"
set name="Toggle AI"
GLOB.config.allow_ai = !( GLOB.config.allow_ai )
if (!( GLOB.config.allow_ai ))
to_world("The AI job is no longer chooseable.")
else
to_world("The AI job is chooseable now.")
log_admin("[key_name(usr)] toggled AI allowed.")
world.update_status()
feedback_add_details("admin_verb","TAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggleaban()
set category = "Server"
set desc="Respawn basically"
set name="Toggle Respawn"
GLOB.config.abandon_allowed = !(GLOB.config.abandon_allowed)
if(GLOB.config.abandon_allowed)
to_world("You may now respawn.")
else
to_world("You may no longer respawn :(")
message_admins(SPAN_NOTICE("[key_name_admin(usr)] toggled respawn to [GLOB.config.abandon_allowed ? "On" : "Off"]."), 1)
log_admin("[key_name(usr)] toggled respawn to [GLOB.config.abandon_allowed ? "On" : "Off"].")
world.update_status()
feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggle_space_ninja()
set category = "Server"
set desc="Toggle space ninjas spawning."
set name="Toggle Space Ninjas"
GLOB.config.ninjas_allowed = !GLOB.config.ninjas_allowed
log_admin("[key_name(usr)] toggled Space Ninjas to [GLOB.config.ninjas_allowed].")
message_admins("[key_name_admin(usr)] toggled Space Ninjas [GLOB.config.ninjas_allowed ? "on" : "off"].", 1)
feedback_add_details("admin_verb","TSN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/delay()
set category = "Server"
set desc="Delay the game start/end"
set name="Delay"
if(!check_rights(R_SERVER)) return
if (ROUND_IS_STARTED)
SSticker.delay_end = !SSticker.delay_end
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
message_admins(SPAN_NOTICE("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"]."), 1)
return //alert("Round end delayed", null, null, null, null, null)
GLOB.round_progressing = !GLOB.round_progressing
if (!GLOB.round_progressing)
to_world("The game start has been delayed.")
log_admin("[key_name(usr)] delayed the game.")
else
to_world("The game will start soon.")
log_admin("[key_name(usr)] removed the delay.")
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/adjump()
set category = "Server"
set desc="Toggle admin jumping"
set name="Toggle Jump"
GLOB.config.allow_admin_jump = !(GLOB.config.allow_admin_jump)
message_admins(SPAN_NOTICE("Toggled admin jumping to [GLOB.config.allow_admin_jump]."))
feedback_add_details("admin_verb","TJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/adspawn()
set category = "Server"
set desc="Toggle admin spawning"
set name="Toggle Spawn"
GLOB.config.allow_admin_spawning = !(GLOB.config.allow_admin_spawning)
message_admins(SPAN_NOTICE("Toggled admin item spawning to [GLOB.config.allow_admin_spawning]."))
feedback_add_details("admin_verb","TAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/adrev()
set category = "Server"
set desc="Toggle admin revives"
set name="Toggle Revive"
GLOB.config.allow_admin_rev = !(GLOB.config.allow_admin_rev)
message_admins(SPAN_NOTICE("Toggled reviving to [GLOB.config.allow_admin_rev]."))
feedback_add_details("admin_verb","TAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/immreboot()
set category = "Server"
set desc="Reboots the server post haste"
set name="Immediate Reboot"
if(!usr.client.holder) return
if( alert("Reboot server?",,"Yes","No") == "No")
return
to_world(SPAN_DANGER("Rebooting world!