ID:141294
 
Code:
mob
key = {"Magicmann", "Island"}
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 minutes."
sleep(1000)
world.Reboot()
if("No")
return
Announce(msg as text)
set category = "Admin"
world << "<B><center>Administrator [usr] would like to say: [msg]</center></B>"


Problem description: For some reason, on my current project Rintai, people log into the game, and despite the key checker, everyone gets admin. I have no clue of how to fix this and would prefer not using a library as i would like to be able to keep things simple. And if possible, can you help with new commands?

Nice job showing us your mob/Login() and/or client/New() proc(s) :D
You probably want to show us your mob/Login() and client/New() procedures, if any, as Spunky Girl noted.

But more seriously, all mobs have all of those verbs by default. Unless you remove them all when people log in.

Also, why are you setting the mob's key? And why are you setting it to the string 'Magicmann", "Island'?

If you only had one admin, you could just make a /mob/admin type and set its key to 'Magicmann' or whatever, but since you've got two it'd be better to have a /mob/admin subclass that owns all the admin verbs, and if somebody logging in is an admin, verbs+=typesof(/mob/admin/verb)
In response to Jp
Heres my login stuff, and i do need the two admins
mob
icon = 'player.dmi'
Login()
world << "<B>[usr] has joined us today!</B>"
loc = locate(/turf/Start)

mob/Login()
..()
usr << "<B>Welcome to Rentai!</B> This is currently a test version so please do not judge harshly, more is to come."

If it has Login(), it is here. Everything is simple and i need my problem fixed

In response to Magicmann
Can I ask you why you made two separate logins?
mob
icon = 'player.dmi'
Login()
..()
world<<"[src] has joined the game" //no usr in procs!
loc = locate(/turf/start)
src<<"Welcome! blah blah"


Okay so back to the point at hand. There's many different ways to accomplish "admin" abilities upon login. The way I see to be the best (for this situation), is a simple list check.

First you establish a global list, and add all the people's key(s) who you'd like to be "admin" in your game.
var/list/Administrators = list()


Next, you want to override mob/Login() with a little if() check, to see if the player logging in, is in the list. And if he/she is, give them their "admin powers".
mob/Login()
..()
if(key in Administrators)
verbs += typesof(/mob/admin/verb)


And you're done! :D A simple question gets a simple, yet to some, very tedious (don't ask why), answer.
While the other replies do point at a better system for doing this they didn't really show you what's wrong with the one you're using.

What you're trying to do is give certain mob subtypes powers while limiting them to certain keys, this does work by setting the key variable as you're doing but it can only work for a single key.

The second problem is that you're defining everything under /mob when you should be defining it under /mob/admin or something similar.

mob
admin
key = "Magicmann"
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 minutes."
sleep(1000)
world.Reboot()
if("No")
return
Announce(msg as text)
set category = "Admin"
world << "<B><center>Administrator [usr] would like to say: [msg]</center></B>"


Would give only you the verbs under that type, but of course that's pretty limited and doesn't let you give power to other people. So as mentioned in the other replies you're going to want to have a list of people who get power then check that list when they Login() and give them the verbs.
Also, advanced calculus tells me 1 minute is about.. 60 seconds. Don't know how your clock ticks, but eurr..