mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-22 19:46:36 +01:00
Added Adminverbs for turning off and on the various items needed.
Also added the proc get_ghosts() with 2 versions of output, it defaults to returning a mob list but can be set to return a list for use with an input window.
This commit is contained in:
@@ -70,6 +70,8 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/man_up,
|
||||
/client/proc/global_man_up,
|
||||
/client/proc/response_team, // Response Teams admin verb
|
||||
/client/proc/toggle_antagHUD_use,
|
||||
/client/proc/toggle_antagHUD_restrictions,
|
||||
/client/proc/allow_character_respawn /* Allows a ghost to respawn */
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
|
||||
@@ -226,26 +226,38 @@ Allow admins to set players to be able to respawn/bypass 30 min wait, without th
|
||||
Ccomp's first proc.
|
||||
*/
|
||||
|
||||
/client/proc/get_ghosts(var/notify = 0,var/what = 2)
|
||||
// what = 1, return ghosts ass list.
|
||||
// what = 2, return mob list
|
||||
|
||||
var/list/mobs = list()
|
||||
var/list/ghosts = list()
|
||||
var/list/sortmob = sortAtom(mob_list) // get the mob list.
|
||||
/var/any=0
|
||||
for(var/mob/dead/observer/M in sortmob)
|
||||
mobs.Add(M) //filter it where it's only ghosts
|
||||
any = 1 //if no ghosts show up, any will just be 0
|
||||
if(!any)
|
||||
if(notify)
|
||||
src << "There doesn't appear to be any ghosts for you to select."
|
||||
return
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
var/name = M.name
|
||||
ghosts[name] = M //get the name of the mob for the popup list
|
||||
if(what==1)
|
||||
return ghosts
|
||||
else
|
||||
return mobs
|
||||
|
||||
|
||||
/client/proc/allow_character_respawn()
|
||||
set category = "Special Verbs"
|
||||
set name = "Allow player to respawn"
|
||||
set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse."
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
var/any = 0
|
||||
var/list/mobs = list()
|
||||
var/list/ghosts = list()
|
||||
var/list/sortmob = sortAtom(mob_list) // get the mob list.
|
||||
for(var/mob/dead/observer/M in sortmob)
|
||||
mobs.Add(M) //filter it where it's only ghosts
|
||||
any = 1 //if no ghosts show up, any will just be 0
|
||||
if(!any)
|
||||
src << "There doesn't appear to be any ghosts for you to select."
|
||||
return
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
var/name = M.name
|
||||
ghosts[name] = M //get the name of the mob for the popup list
|
||||
var/list/ghosts= get_ghosts(1)
|
||||
|
||||
var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts
|
||||
if(!target)
|
||||
@@ -268,6 +280,62 @@ Ccomp's first proc.
|
||||
message_admins("Admin [key_name_admin(usr)] allowed [key_name_admin(G)] to bypass the 30 minute respawn limit", 1)
|
||||
|
||||
|
||||
/client/proc/toggle_antagHUD_use()
|
||||
set category = "Server"
|
||||
set name = "Toggle antagHUD usage"
|
||||
set desc = "Toggles antagHUD usage for observers"
|
||||
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
var/action=""
|
||||
if(config.antag_hud_allowed)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
if(g.antagHUD)
|
||||
g.antagHUD = 0 // Disable it on those that have it enabled
|
||||
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
|
||||
g << "\red <B>TheAdministrator has disabled AntagHUD </B>"
|
||||
config.antag_hud_allowed = 0
|
||||
src << "\red <B>AntagHUD usage has been disabled</B>"
|
||||
action = "disabled"
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
g << "\blue <B>The Administrator has enabled AntagHUD </B>" // Notify all observers they can now use AntagHUD
|
||||
config.antag_hud_allowed = 1
|
||||
action = "enabled"
|
||||
src << "\blue <B>AntagHUD usage has been enabled</B>"
|
||||
|
||||
|
||||
log_admin("[key_name(usr)] has [action] antagHUD usage for observers")
|
||||
message_admins("Admin [key_name_admin(usr)] has [action] antagHUD usage for observers", 1)
|
||||
|
||||
|
||||
|
||||
/client/proc/toggle_antagHUD_restrictions()
|
||||
set category = "Server"
|
||||
set name = "Toggle antagHUD Restrictions"
|
||||
set desc = "Restricts players that have used antagHUD from being able to join this round."
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
var/action=""
|
||||
if(config.antag_hud_restricted)
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
g << "\blue <B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B>"
|
||||
action = "lifted restrictions"
|
||||
config.antag_hud_restricted = 0
|
||||
src << "\blue <B>AntagHUD restrictions have been lifted</B>"
|
||||
else
|
||||
for(var/mob/dead/observer/g in get_ghosts())
|
||||
g << "\red <B>The administrator has placed restrictions on joining the round if you use AntagHUD</B>"
|
||||
g << "\red <B>Your AntagHUD has been disabled, you may choose to re-enabled it but will be under restrictions </B>"
|
||||
g.antagHUD = 0
|
||||
g.has_enabled_antagHUD = 0
|
||||
action = "placed restrictions"
|
||||
config.antag_hud_restricted = 1
|
||||
src << "\red <B>AntagHUD restrictions have been enabled</B>"
|
||||
|
||||
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
|
||||
message_admins("Admin [key_name_admin(usr)] has [action] on joining the round if they use AntagHUD", 1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user