ID:145627
 
Code:
<var/list/MASTER_GM

mob/proc/GMCheck()
if(GMs.Find(key) || _temp_gm) return 1
return 0

mob/proc/AdminGMCheck()
if(Admins.Find(key)) return 1
return 0

mob/proc/MasterGMCheck()
if(MASTER_GM.Find(src.key)) return 1
return 0

mob/proc/AddGMVerbs()
//everyone gets the basic package
if(GMCheck() || AdminGMCheck() || MasterGMCheck())
for(var/X in typesof(/mob/GM_verbs/verb)) //add every verb
src.verbs += X

//the master GM and the admins get a few extras!
if(AdminGMCheck() || MasterGMCheck())
for(var/X in typesof(/mob/admin_GM_verbs/verb)) //add every verb
src.verbs += X

//finally, the master GM gets two more for keeping Admins in line
if(MasterGMCheck())
for(var/X in typesof(/mob/master_GM_verbs/verb))
src.verbs += X

//Set their names to include the prefixes and suffixes.
//Be sure not to allow duplication.
if(MasterGMCheck())
if(MASTER_GM_PREFIX && !findtext(name, MASTER_GM_PREFIX))
src.name = "[MASTER_GM_PREFIX][name]"
if(MASTER_GM_SUFFIX && !findtext(name, MASTER_GM_SUFFIX))
src.name = "[name][MASTER_GM_SUFFIX]"
if(AdminGMCheck())
if(ADMIN_GM_PREFIX && !findtext(name, ADMIN_GM_PREFIX))
src.name = "[ADMIN_GM_PREFIX][name]"
if(ADMIN_GM_SUFFIX && !findtext(name, ADMIN_GM_SUFFIX))
src.name = "[name][ADMIN_GM_SUFFIX]"
if(GMCheck())
if(GM_PREFIX && !findtext(name, GM_PREFIX))
src.name = "[GM_PREFIX][name]"
if(GM_SUFFIX && !findtext(name, GM_SUFFIX))
src.name = "[name][GM_SUFFIX]"


Problem description:
Those are from Spuzzum's S_Admin library. (I edited the master gm thing so it was a list.) The problem is, when I use it, I get a runtime error:

runtime error: Cannot execute null.Find().
proc name: MasterGMCheck (/mob/proc/MasterGMCheck)
usr: KirbyRules (/mob)
src: KirbyRules (/mob)
call stack:
KirbyRules (/mob): MasterGMCheck()
KirbyRules (/mob): AddGMVerbs()
KirbyRules (/mob): GM Check()
KirbyRules (/mob): Login()


Anyone have any idea of what I'm doing wrong?

var/list/MASTER_GM = list()
An incorrect use of Find(), my friend. Try doing this:
mob/proc/MasterGMCheck()
return (key in MASTER_GM)?1:0 //basically if(src.key in MASTER_GM)return 1
In response to DarkCampainger
Thanks! I can't believe that's all I had to do. But now I'm having problems adding GMs:

mob/proc/
Give_GM_Powers()
if(src.ckey == "kirbyrules")
MASTER_GM += usr.ckey
src.AddGMVerbs()
if(usr.ckey == "kirbyxxx")
MASTER_GM += usr.ckey
src.AddGMVerbs()
if(usr.ckey == "xkirby2")
MASTER_GM += usr.ckey
src.AddGMVerbs()
if(usr.ckey == "akruru")
Admins += usr.ckey
src.AddGMVerbs()
if(usr.ckey == "darcksol")
Admins += usr.ckey
src.AddGMVerbs()
if(usr.ckey == "bazzoka")
Admins += usr.ckey
src.AddGMVerbs()

mob/Login()
..()
Give_GM_Powers()


It doesn't give me any errors, but it doesn't give the people there verbs. Little help please?
In response to Hell Ramen
Hell Ramen wrote:
> mob/proc/MasterGMCheck()
> return (key in MASTER_GM)?1:0 //basically if(src.key in MASTER_GM)return 1


The use of the tertiary operator is not needed here, my friend.

mob/proc/MasterGMCheck()
return key in MASTER_GM


~~> Unknown Person
In response to Unknown Person
It makes it more readable!
<________<
In response to Hell Ramen
Hell Ramen wrote:
<________<

Why is his mouth so big!? <_<