ID:144181
 
Code:
mob/Login
var/list/GMs = new("Jazzyfizzle"=ADMIN,"Beatdown_system"=GM)
if(usr = "Jazzyfizzle")
set category = 'GM'


Problem description:

Im new at coding and Im trying to set an admin code so it can define myself and set a category (For only myself) in GM but Im not sure really what to do so I basicly went with how I thought it would go...Plz help ^_^

1) I don't think new /list can initialize lists with items -- use the list() proc for that.

2) For some reason you have stuff indented under the list creation line...

3) No put 'usr' in proc. Ugh.

4) For checking/comparisons, use '==', not '='.

5) 'set' may only be used unconditionally and must always be at the top of the proc.

6) This isn't even a verb, and worse, its the Login() proc, why are you setting the category?...

7) You have no parenthesis after 'Login' in your first line, so you're not even actually overriding the proc, but creating a new mob subtype...

What you want is to make GM verbs and add them to GMs when they login, optionally depending on rank and whatnot. Small example:
var/list/GMs = list("kaioken","ckey2") //define and create a global list

client/New() //override client/New() which is called when a player connects
..() //do the default behavior, logging in the player into a mob
if(src.ckey in GMs) //if the player's ckey is found in the list
src.verbs += typesof(/GM/verb)-/GM/verb //add all \
verbs of type /GM/verb to the player's 'verbs' list - look up typesof(). typesof() also returns the base type, so we remove that first, since we don't need it.


GM/verb //these are the actual verbs
Boot(mob/M in world) del M
Mute(mob/M in world) M.muted = 1
//etc