Im just confused on how the keys work. Im reading a demo that shows admin keys but i have never seen anything where you input the key. Help would be apreciated.
var/list/Admins = list("FretFulGun","KirbyAllStar") //and access them like... if(src.key in Admins) //Do something here! //The src depends of course where you use this //In something like Click() src and usr are different //You should almost never use usr in procs
#2 Mar 30 2007, 4:35 pm (Edited on Mar 30 2007, 4:50 pm)
mob/Admin/verb/announce(msg as text) world << "[html_encode(usr.name)<font color = red>ANNOUNCES [html_encode(msg)]!"
mob/Login() if(src.key in Admins) src.verbs+=typesof(/mob/Admin/verb/)
The html_encode is to ensure that the user of the verb can't put dangerous html in the msg or in their name. I'm not sure how you have yours set up but you can change the usr.name to the usr.key if you need to. With this you also can have as many Admin verbs as you need just make sure they are under the "mob/Admin/verb/" path and add that in on your mob/Login or client/New().
your key: FretFulGun
your ckey: fretfulgun
you could make a list of admins like...