client
var
adminlvl = 0
proc
give_admin(var/client/m, lvl)
lvl = max(0, min(adminLevels.len, lvl))
for(var/x = 1, x <= lvl, x++)
m.verbs += typesof(adminLevels[x])
m << "You have been given level [lvl] admin abilities."
if(!admins.Find(src))
admins += src
adminlvl = lvl
save_admins(m, lvl)
null_power(var/client/target)
world << adminlvl
world << target.adminlvl
if(target.adminlvl >= adminlvl)
src << "[target.key] is too high level of an admin to perform this action."
return FALSE
return TRUE
client/Level4
var/Admin = 4
verb
Make_Admin(client/target in world, var/lv as num)
set category = "Admin"
if(null_power(target))
give_admin(target, lv)
Problem description:
I'm having problems with my admin system once again.. I just cannot figure out what is going wrong here. I'm getting a runtime error when I use the Make_Admin verb, saying 'adminlvl' for the target is undefined. It says...
runtime error: undefined variable /mob/var/adminlvl
proc name: null power (/client/proc/null_power)
source file: Admin.dm,45
usr: Kits (/mob)
src: Kitsueki (/client)
call stack:
Kitsueki (/client): null power(keynamehere (/mob))
Kitsueki (/client): Make Admin(keynamehere (/mob), 4)
Now, as you can see the variable -is- defined, but I'm being told otherwise. Anyone have any clue what the problem is?
runtime error: undefined variable /mob/var/adminlvl
It's trying to connect to it as if it was defined for a mob and not the client.
Shouldn't src be m?