ID:141183
 
Code:
ob
key = {"Magicmann","Island"}
Login()
world << "<center><B>Admin [usr] has logged in!</center></B>"
loc = locate(/turf/Start)
icon_state = "crazy colors"
life = 1000
verb
Repop()
set category = "Admin"
switch(alert("Are you sure you want to repop the world?","Repop","Yes","No"))
if("Yes")
world.Repop()
world<<"[usr] is repoping the world!."
if("No")
return
Fly()
set category = "Admin"
density = !density
Reboot()
set category = "Admin"
switch(alert("Are you sure you want to reboot the world?","Reboot","Yes","No"))
if("Yes")
world<<"<font size=1>World reboot iniated by [usr]. Reboot will be in one minute."
sleep(600)
world<<"Rebooting now! (That means Magicmann gets the last word!)"
world.Reboot()
if("No")
return
Announce(msg as text)
set category = "Admin"
world << "<B><center>Administrator [usr] would like to say:</center></B>"
world << "<center><B>[msg]</center></B>"
Edit_Stats()
set category = "Admin"
switch(alert("Would you rather add or take ten stats?","Stat Editing","Add","Subtract","Cancel"))
if("Add")
switch(alert("Would you rather add ten strength or defence?","Stat Adding","Strength","Defence"))
if("Strength")
usr.strength += 10
if("Defence")
usr.defence += 10
if("Subtract")
switch(alert("Would you rather subtract ten attack or defence?","Stat Subtracting","Strength","Defence"))
if("Strength")
usr.strength -= 10
if("Defence")
usr.defence -= 10
if("Cancel")
return


Problem description:
No matter what i do, it gives everyone whoever logs in GM. It happens ALL the time. I do not know how to fix it
Maybe you should make some checks to make sure they are allowed to be GM for one.
key = {"Magicmann","Island"}

I'm fairly certain this does absolutely nothing.

Mob.key holds a text value, not a list. I'm not even sure how that compiles. In any event, those verbs are declared under /mob. world.mob defaults to /mob, which means EVERY player that connects is a /mob, and has access to all of /mob's verbs.

In order to do what it looks like you're trying to do you'll need to come up with a better system that involves adding and removing verbs that are held in container objects.

/* This list contains all the keys for your admins */
var/list/admins = list("Magicmann","Island")

/* This is an example of a verb container */
mob/admin_container
New()
del src //There should NEVER be an actual instance of this mob.

verb
adminverb1()
adminverb2()
adminverb3()

/* This shows adding verbs from the container */
mob
Login()
. = ..()
if(key in admins)
src.verbs += typesof(/mob/admin_container/verb)
return .


Please don't copy+paste this, as it won't work. It's meant to illustrate a concept. If you have questions about it please feel free to ask :)
In response to CriticalBotch
CriticalBotch wrote:
> key = {"Magicmann","Island"}
>

I'm fairly certain this does absolutely nothing.
[...] I'm not even sure how that compiles.

That line is in valid syntax (read more), and what it does is set the key to the following text string:
Magicmann","Island