ID:713205
 
(See the best response by .screw.)
Help:Creating GM List


Problem description:
I want to mke a code that save keys into a list. I'm ttrying to make a gm list for my game. I aso want to make a verb that allows me to add and remove member from the list.
list += GM.key


It's pretty easy.
Best response
mob
var/list/gm_list = list()
verb
Add_GM()
var/gm_name = ckey(input("What key would you like to add?", "Add GM") as text|null)
if((gm_name in gm_list) || !gm_name) return // if the person is already a gm, do nothing

gm_list += gm_name // if the person is not already a gm

world << "[gm_name] is now a gm!"

Remove_GM()
var/gm_name = ckey(input("What key would you like to remove?", "Remove GM") in gm_list+"Exit")
if(!(gm_name in gm_list))return // saftey check
gm_list -= gm_name // if the person is a gm

world << "[gm_name] is no longer a gm!"
thank you