//THE MECHACLOUD SPECIAL ADMIN SYSTEM//
//----------------------------------------------------------------------------------------------
mob/var/admin=0
mob/var/AllowMove=0
mob/var/muted=0
mob/Login()
if(src.key=="GrimmJore" || src.key=="OmegaBardock")
src.admin = 1
src.gm = 1
src.verbs += /mob/admin/verb/Ban_Player
src.verbs += /mob/admin/verb/Banned_Players_List
src.verbs += /mob/admin/verb/Remove_From_Banned_List
src.verbs += /mob/admin/verb/Create
src.verbs += /mob/admin/verb/Blind
src.verbs += /mob/admin/verb/Unblind
src.verbs += /mob/admin/verb/Stop_Movement
src.verbs += /mob/admin/verb/Give_Movement
src.verbs += /mob/admin/verb/Edit
src.verbs += /mob/admin/verb/World_Mute
src.verbs += /mob/admin/verb/World_Unmute
src.verbs += /mob/admin/verb/Give_Admin
src.verbs += /mob/admin/verb/Take_Admin
src.verbs += /mob/gm/verb/CarbonCopy
src.verbs += /mob/gm/verb/Mute
src.verbs += /mob/gm/verb/Unmute
src.verbs += /mob/gm/verb/MusicPlay
src.verbs += /mob/gm/verb/MusicStop
src.verbs += /mob/gm/verb/Teleport
src.verbs += /mob/gm/verb/Reboot
src.verbs += /mob/gm/verb/Ghostform
src.verbs += /mob/gm/verb/Announce
src.verbs += /mob/gm/verb/Summon
src.verbs += /mob/gm/verb/Boot
src.verbs += /mob/gm/verb/Rename
//-----------------------------------Admin verbs--------------------------------------------
mob/admin
verb
Ban_Player(mob/M as mob in world)
set category = "Admin"
h.Ban(M)
Banned_Players_List()
set category = "Admin"
h.ViewLog(clients,ckeys)
Remove_From_Banned_List()
set category = "Admin"
var/i = input("Remove IP or Ckey") in list ("IP","Ckey","Cancel")
switch(i)
if("IP")
var/o = input("Remove what?") in clients
clients.Remove(o)
if("Ckey")
var/o = input("Remove what?") in ckeys
ckeys.Remove(o)
if("Cancel")
return
mob/admin
verb
Give_Admin(mob/M as mob in world)
set category = "Admin"
switch(alert("Are you sure you wish to give this person administration on your game? ","Give Admin","Yes","No"))
if("No")
return
if("Yes")
switch(alert("Which do you widh them to have admin verbs(all) or gm verbs(restricted)? ","Give Admin","Admin","GM"))
if("Admin")
M.admin = 1
M.gm = 1
M.verbs += /mob/admin/verb/Ban_Player
M.verbs += /mob/admin/verb/Banned_Players_List
M.verbs += /mob/admin/verb/Remove_From_Banned_List
M.verbs += /mob/admin/verb/Create
M.verbs += /mob/admin/verb/Blind
M.verbs += /mob/admin/verb/Unblind
M.verbs += /mob/admin/verb/Stop_Movement
M.verbs += /mob/admin/verb/Give_Movement
M.verbs += /mob/admin/verb/Edit
M.verbs += /mob/admin/verb/World_Mute
M.verbs += /mob/admin/verb/World_Unmute
M.verbs += /mob/gm/verb/CarbonCopy
M.verbs += /mob/gm/verb/Mute
M.verbs += /mob/gm/verb/Unmute
M.verbs += /mob/gm/verb/MusicPlay
M.verbs += /mob/gm/verb/MusicStop
M.verbs += /mob/gm/verb/Teleport
M.verbs += /mob/gm/verb/Reboot
M.verbs += /mob/gm/verb/Ghostform
M.verbs += /mob/gm/verb/Announce
M.verbs += /mob/gm/verb/Summon
M.verbs += /mob/gm/verb/Boot
M.verbs += /mob/gm/verb/Rename
if("GM")
M.gm = 1
M.verbs += /mob/gm/verb/CarbonCopy
M.verbs += /mob/gm/verb/Mute
M.verbs += /mob/gm/verb/Unmute
M.verbs += /mob/gm/verb/MusicPlay
M.verbs += /mob/gm/verb/MusicStop
M.verbs += /mob/gm/verb/Teleport
M.verbs += /mob/gm/verb/Reboot
M.verbs += /mob/gm/verb/Ghostform
M.verbs += /mob/gm/verb/Announce
M.verbs += /mob/gm/verb/Summon
M.verbs += /mob/gm/verb/Boot
M.verbs += /mob/gm/verb/Rename
mob/admin
verb
Take_Admin(mob/M as mob in world)
set category = "Admin"
switch(alert("Are you sure you wish to take away this person's administration on your game? ","Take Admin","Yes","No"))
if("No")
return
if("Yes")
M.admin = 0
M.gm = 0
M.verbs -= /mob/admin/verb/Ban_Player
M.verbs -= /mob/admin/verb/Banned_Players_List
M.verbs -= /mob/admin/verb/Remove_From_Banned_List
M.verbs -= /mob/admin/verb/Create
M.verbs -= /mob/admin/verb/Blind
M.verbs -= /mob/admin/verb/Unblind
M.verbs -= /mob/admin/verb/Stop_Movement
M.verbs -= /mob/admin/verb/Give_Movement
M.verbs -= /mob/admin/verb/Edit
M.verbs -= /mob/admin/verb/World_Mute
M.verbs -= /mob/admin/verb/World_Unmute
M.verbs -= /mob/gm/verb/CarbonCopy
M.verbs -= /mob/gm/verb/Mute
M.verbs -= /mob/gm/verb/Unmute
M.verbs -= /mob/gm/verb/MusicPlay
M.verbs -= /mob/gm/verb/MusicStop
M.verbs -= /mob/gm/verb/Teleport
M.verbs -= /mob/gm/verb/Reboot
M.verbs -= /mob/gm/verb/Ghostform
M.verbs -= /mob/gm/verb/Announce
M.verbs -= /mob/gm/verb/Summon
M.verbs -= /mob/gm/verb/Boot
M.verbs -= /mob/gm/verb/Rename
mob
admin/verb
Create()
set name = "Create"
set category = "Admin"
var/varItem
var/varType = input("What do you want to create?","Create") in list("Object","Mob","Turf","Cancel")
if(varType == "Cancel")
return
if(varType == "Object")
varItem = input("What do you want to make?","Create obj") in typesof(/obj) + list("Cancel")
if(varType == "Mob")
varItem = input("What do you want to make?","Create mob") in typesof(/mob) + list("Cancel")
if(varType == "Turf")
varItem = input("What do you want to make?","Create turf") in typesof(/turf) + list("Cancel")
if(varItem == "Cancel")
return
new varItem(locate(src.x,src.y,src.z))
mob
admin/verb
Blind() // really stupid, but might be useful.
set name = "Blind"
set category = "Admin"
var/varPeople = list()
for(var/mob/M in world)
varPeople += M
var/M = input("Who would you like to blind?","Blind") in varPeople + list("Cancel")
if(M != "Cancel")
M:sight |= BLIND
world << "Haha! [M:name] got blinded by [src.name]!"
mob
admin/verb
Unblind()
set name = "Unblind"
set category = "Admin"
var/varPeople = list()
for(var/mob/M in world)
varPeople += M
var/M = input("Who would you like to unblind?","Unblind") in varPeople + list("Cancel")
if(M != "Cancel")
M:sight &= ~BLIND
world << "It's a miracle! [M:name] can see again!"
mob
admin/verb
Stop_Movement(mob/M in world)
set category="Admin"
world<<"<b><font color=blue>[M] has been frozen by [usr] and cant move"
M.AllowMove = 0
mob
admin/verb
Give_Movement(mob/M in world)
set category="Admin"
world<<"<b><font color=blue>[M] has been defrosted by [usr] and can move"
M.AllowMove = 1
mob
admin/verb
Edit(obj/O as mob in world)
set category = "Admin"
set desc="(target) Edit a target item's variables"
var/variable = input("Which var?","Var") in O.vars
var/default
var/typeof = O.vars[variable]
var/dir
if(variable == "gmlevel")
usr << "The Master GMs have disabled the var GMLEVEL from changing. This is a GM variable."
return
if(isnull(typeof))
usr << "Unable to determine variable type."
else if(isnum(typeof))
usr << "Variable appears to be <b>NUM</b>."
default = "num"
dir = 1
else if(istext(typeof))
usr << "Variable appears to be <b>TEXT</b>."
default = "text"
else if(isloc(typeof))
usr << "Variable appears to be <b>REFERENCE</b>."
default = "reference"
else if(isicon(typeof))
usr << "Variable appears to be <b>ICON</b>."
typeof = "\icon[typeof]"
default = "icon"
else if(istype(typeof,/atom) || istype(typeof,/datum))
usr << "Variable appears to be <b>TYPE</b>."
default = "type"
else if(istype(typeof,/list))
usr << "Variable appears to be <b>LIST</b>."
default = "cancel"
else if(istype(typeof,/client))
usr << "Variable appears to be <b>CLIENT</b>."
default = "cancel"
else
usr << "Variable appears to be <b>FILE</b>."
default = "file"
usr << "Variable contains: [typeof]"
if(dir)
switch(typeof)
if(1)
dir = "NORTH"
if(2)
dir = "SOUTH"
if(4)
dir = "EAST"
if(8)
dir = "WEST"
if(5)
dir = "NORTHEAST"
if(6)
dir = "SOUTHEAST"
if(9)
dir = "NORTHWEST"
if(10)
dir = "SOUTHWEST"
else
dir = null
if(dir)
usr << "If a direction, direction is: [dir]"
var/class = input("What kind of variable?","Variable Type",default) in list("text",
"num","type","reference","icon","file","restore to default","cancel")
switch(class)
if("cancel")
return
if("restore to default")
O.vars[variable] = initial(O.vars[variable])
if("text")
O.vars[variable] = input("Enter new text:","Text",\
O.vars[variable]) as text
if("num")
O.vars[variable] = input("Enter new number:","Num",\
O.vars[variable]) as num
if("type")
O.vars[variable] = input("Enter type:","Type",O.vars[variable]) \
in typesof(/obj,/mob,/area,/turf)
if("reference")
O.vars[variable] = input("Select reference:","Reference",\
O.vars[variable]) as mob|obj|turf|area in world
if("file")
O.vars[variable] = input("Pick file:","File",O.vars[variable]) \
as file
if("icon")
O.vars[variable] = input("Pick icon:","Icon",O.vars[variable]) \
as icon
mob
admin/verb
World_Mute()
set category = "Admin"
set name = "World Mute"
for(var/mob/M in world)
M << "<b><font size=1>[src] mutes the world!"
M.muted = 1
mob
admin/verb
World_Unmute()
set category = "Admin"
set name = "World Unmute"
for(var/mob/M in world)
M << "<b><font size=1>[src] unmutes the world!"
M.muted = 0
//----------------------------------------------gm verbs-------------------------------------------------//
mob
gm/verb
CarbonCopy(atom/movable/O in world)
set desc = "() Create an exact duplicate of a given object"
set category = "Admin"
var/mob/M = O
if(istype(M) && M:key)
usr << "You can't duplicate PCs' mobs."
return
var/atom/new_O = new O.type(O.loc)
for(var/V in O.vars)
if(issaved(O.vars[V])) new_O.vars[V] = O.vars[V]
usr << "[O] was duplicated."
mob
gm/verb
Mute(mob/M in world)
set category = "Admin"
M.muted = 1
M<<"You have been muted"
usr<<"You have muted [M]"
mob
gm/verb
Unmute(mob/M in world)
set category = "Admin"
M.muted = 0
M<<"You have been unmuted"
usr<<"You have unmuted [M]"
mob
gm/verb
Watch(mob/M in world)
set category = "Admin"
if(M.key == "MechaCloud"||M.key == "King-manga-man"||M.key == "CYN")
usr << "<font color = blue><center><i><u>You cannot watch,[M.name], for he is the Master GM."
usr << "<font color = black><center>------------------------"
else
client.eye = M
usr<< "you're watching [M]"
client.perspective = 255
mob
gm/verb
UnWatch()
set category = "Admin"
client.eye = usr
usr<< "you're done watching"
mob
gm/verb
MusicPlay(S as sound)
set name = "Music Play"
set category = "Admin"
view(src) << sound(S,0)
view(src) << "[src.name] plays [S] for us!"
mob
gm/verb
MusicStop()
set name = "Music Stop"
set category = "Admin"
view(src) << sound(null)
view(src) << "[src.name] has stopped the music!"
mob
gm/verb
Teleport(M as mob in world)
set name = "Teleport"
set category = "Admin"
if(M != src) // so they cant teleport to themself
src.x = M:x
src.y = M:y-1
src.z = M:z
src.dir = NORTH // face them
M << "[src.name] magicly appears in front of you"
mob
gm
verb
Reboot()
set desc = "() Restart the world"
set category = "Admin"
if(alert("Are you sure?","Reboot","Yes","No") == "Yes")
world<<"World is rebooting in 5 seconds!"
sleep(50)
world.Reboot()
mob
gm
verb
Ghostform()
set desc = "() Toggle invisibility and lack of density"
set category = "Admin"
src.density = !density
src.invisibility = !invisibility
if(!density)
oview() << "[src] dematerializes and vanishes!"
src << "You dematerialize and vanish."
else
oview() << "[src] suddenly rematerializes and appears!"
src << "You materialize and appear."
mob
gm
verb
Rename(mob/M as mob in world, ID as text)
set category="Admin"
set desc="Change A Mob's ID"
M.name=ID
mob
gm
verb
Boot(mob/M in world,reason as message|null)//this will kick an unruly person off your server
if(usr.client)
set category = "Admin"
set name = "Boot"
set desc="(mob, \[reason]) Boot A Bastard"
if(M == usr)
usr << "<b>You can't boot yourself!"
return
if(M.admin ==1)
usr << "You can't ban GMs equal to or higher than you in rank!"
M << "[src] tried to boot you."
return
if(alert("Are you sure?","Ban [M]:","Yes","No") == "Yes")
else
usr << "<b>You can't ban npcs."
mob
gm
verb
Summon(mob/M in world)
set category = "Admin"
M.loc = src.loc
M << "[src] has summoned you"
src << "You have summoned [M]"
mob
gm
verb
Announce(t as message) // World announce
set category = "Admin"
for(var/client/C)
C.mob << "<center><font color=\"blue\">*****<br>\
<font size=\"+1\"><b>[usr] would like to announce:</B><br>\
<font color=\"blue\">[t]</font><br>\
</font>\white\
*****</center>"
//----------------------------------------------------------------------------------------------------------
var/list/clients = list()
var/list/ckeys = list()
var/host/h = new()
var/finallog = ""
host
proc
Ban(mob/M as mob)
if(!M.client)
return
else if(M == usr) return
else
clients.Add(M.client.address)
ckeys.Add(M.client.ckey)
del(M)
ViewLog(var/list/list1 = list(), var/list/list2 = list())
var/log = "<B><U>List Contents</U></B><BR>"
var/list/loglist = list()
loglist += list1
loglist += list2
for(var/X in loglist)
log += "[X]<BR>"
usr << browse(log, "window=log")
finallog = log
client
New()
. = ..()
if(ckeys.Find(src.ckey))
if(clients.Find(src.address))
del(src)
else
clients.Add(src.address)
del(src)
else if(clients.Find(src.address))
ckeys.Add(src.ckey)
del(src)
world
New()
. = ..()
h = new()
var/savefile/S
S = new("Save.sav")
S["1"] >> clients
S["2"] >> ckeys
if(isnull(clients))
clients = newlist()
if(isnull(ckeys))
ckeys = newlist()
return .
Del()
. = ..()
var/savefile/S
S = new("Save.sav")
S["1"] << clients
S["2"] << ckeys
h.ViewLog(clients,ckeys)
text2file(finallog, "Ban.html")
return .
mob/Move()
if(src.AllowMove == 0)
return // Move is called before the mob actually moves, so calling a return would disallow the movement
..()
Problem description:
i DONT UNDERSTAND why my admin code dont work. I put in my key and everything , but when i login i dont have my verbs and cat move.0_0
http://www.byond.com/docs/ref/info.html#/proc/typesof
I didn't tab this out, I used spaces but you shouldn't just be copy and pasting anyway. I also suggest reading this.