ID:146956
 
Realizing that I am relying too much on third-party libraries that add too many functions that I don't need, I decided to rewrite all the systems I can. However, I am having trouble with the coding that handles banning players.

Here is the error that I get:
admin.dm:20:error:M.key:undefined var

and here is the problematic coding.

    Ban(M as mob in world, R as text)
set hidden = 1
set desc = "Select a player and enter a reason."
switch(alert("Are you sure you want to ban [M]?",,"Yes","No"))
if("Yes")
M << "[usr] has opted to ban you for [R]."
world << "[M] has violated [R] and is banned."
banned.Add("[M.key]") // Error here


This goes right under the booting section, and is a mob/verb. I have a global list named "banned", so that doesn't seem to be the problem.

I am trying to make it so that, when an administrator bans someone, it adds it to a global list that will be searched upon login.

At the moment, there is no coding for a negative response.
Ban() should be defined as
Ban(mob/M as mob in world)
Drafonis, make it so you have to input the key. Otherwise people would mass spam your game then log off, and repeat. =/