Files
fulpstation/code/modules/admin/verbs/maprotation.dm
2017-03-22 10:48:25 -04:00

44 lines
1.5 KiB
Plaintext

/client/proc/forcerandomrotate()
set category = "Server"
set name = "Trigger Random Map Rotation"
var/rotate = alert("Force a random map rotation to trigger?", "Rotate map?", "Yes", "Cancel")
if (rotate != "Yes")
return
message_admins("[key_name_admin(usr)] is forcing a random map rotation.")
log_admin("[key_name(usr)] is forcing a random map rotation.")
SSticker.maprotatechecked = 1
SSmapping.maprotate()
/client/proc/adminchangemap()
set category = "Server"
set name = "Change Map"
var/list/maprotatechoices = list()
for (var/map in config.maplist)
var/datum/map_config/VM = config.maplist[map]
var/mapname = VM.map_name
if (VM == config.defaultmap)
mapname += " (Default)"
if (VM.config_min_users > 0 || VM.config_max_users > 0)
mapname += " \["
if (VM.config_min_users > 0)
mapname += "[VM.config_min_users]"
else
mapname += "0"
mapname += "-"
if (VM.config_max_users > 0)
mapname += "[VM.config_max_users]"
else
mapname += "inf"
mapname += "\]"
maprotatechoices[mapname] = VM
var/chosenmap = input("Choose a map to change to", "Change Map") as null|anything in maprotatechoices
if (!chosenmap)
return
SSticker.maprotatechecked = 1
var/datum/map_config/VM = maprotatechoices[chosenmap]
message_admins("[key_name_admin(usr)] is changing the map to [VM.map_name]")
log_admin("[key_name(usr)] is changing the map to [VM.map_name]")
if (SSmapping.changemap(VM) == 0)
message_admins("[key_name_admin(usr)] has changed the map to [VM.map_name]")