ID:156821
 
Allo. Well for now im pretty much think i got my save system working as i need it to and i think i got everything else working properly to (atleast im hoping) and also hoping i got this in the right section. since it is more then one thing i guess.

Anyways i decided to start venturing into the realm of Admin granting and other various nefarious verbs.

So anyways i decided a good way of doing it would to possibly make a proc that could be called by the verb to create a list of players after running it through some checks to ensure it was actually a client and not a enemy mob etc etc.

EDIT: I originally had a code here that checks for all clients first inside the actual verb click. thought it didnt work but ran some client tests and it turns out it worked fine. so yeah only question now is how i can run multi checks from a list for my ooc

//incomplete ooc verb raw form without filtering and other tidbits.
mob/verb/OOC(msg as text)//revamp
var/list/AdminCols = list("1337" = "blue","1" = "purple","2" = "#red" ,"3" = "#FFFF33", "0" = "F7E1CB")

if("[ckey] = 1337" in admins) //i cant seem to figure out how to run multiple checks for things i want it to be able to check for "[ckey] = 1","[ckey] = 2" and "[ckey] = 3".
//but all attempts can only read the first check.
world << output("<font color = [AdminCols["[usr.alev]"]]><b>[usr]</b>:</font> [msg]", "OOCO")
else
world << output("<font color = green><b>[usr]</b>:</font> [msg]", "OOCO")


Any advice on both codes is appreciated.

And thanks for the patience :)
Depends how you intend to check who is/isnt admin, looks like you'll be using findText or findtextEx (depending on your BYOND version).

SoL's admins are simply determined by a pre-coded list with theire ckey typed in
var/list
LevelOneGMs=list("playera","playerb","playerf")
LevelTwoGMs=list("saucepanman","midgetbuster")

proc/GMLogin()
if(src.ckey in LevelTwoGMs)
src.verbs+=//verbs
src.Title="Overlord"
src.Admin=1


But thats just me o_o

Judging by your second bit of code though, I would use this:

var/Admins[]

mob/verb/AppointAdmin(mob/T in Clients())
switch(alert...) //etc
if("Lev 3")
if(!admins) admins=new()
admins[T.ckey]=3
//--------------------
mob/verb/ooc(msg as text)
//stuff
//more stuff
if(admins[usr.ckey]==1337
//MGM version of ooc
else if(admins[usr.ckey]==3
//GM version
else
//player version


Personally, I would prefer to go with the preset standard list idea.
In response to Saucepan Man
Well my admins only have one pre-coded admin which is me. the rest are then given their status which is written to the same save file as my other wordly stuff such as bans, mutes etc etc. and are called on a world start and saved on a world end.

That way all admins are always key based and dont require hard coding to create new admins.