ID:142400
 
Code:
Permission(mob/M as mob in world)
if(M.race == "Test" && M.Stats>= M.Requirements && M.Permit == 0 && Admin >= 1)
switch(alert("Will you allow [M] to have the permit?",,"Yes","No","Never"))
if("Yes")
M.Permit = 1
else if("No")
return
else
M.PermitNever = 1
else
return


Problem description:Well, here's the RunTime error

runtime error: Cannot read null.race
proc name: Permission (/mob/proc/Permission)
usr: (/mob)
src: (/mob)
call stack:
(/mob): Permission(null)
(/mob): Login()

I've been working with it for a while, finally decided to ask for help.

Oh yeah, while I was testing it, I edited my Stats to the Requirements, if that helps.
It's saying that M wasn't defined. i.e.: you called the Permission proc with no arguments
You really shouldn't put "as mob in world" in a proc argument. Procs are not like verbs when it comes to arguments. "mob/M" means that M is a variable of the mob type, being used in the proc. "mob/M in world" means nothing in a proc, but gives you a list of mobs in the world as a verb.

Anyways as a sanity check, I always use "if(M)" in procs just to make sure.
In response to Kaiochao
Kaiochao wrote:
Anyways as a sanity check, I always use "if(M)" in procs just to make sure.

Why? If you're calling a proc wrong, it's better to get a big red error message about it than to not know that something isn't working.
In response to Garthor
True. If an argument is necessary and is needed for the proc to accomplish anything, adding a sanity check for it is quite pointless. Like you said, you need to fix the proc calls themselves. Just having a proc that is called for the purpose of doing nothing is already bad.