ID:167940
 
I need to know how to have a list(var/list/Testers = list("Chwgt")) saved. And then when they login, it check the list for their key if it's there, they're allowed in, otherwise they're booted. And a verb to add testers while in the game(Not sure if mines messing up or if it's something else).

Any help is appreciated.

--Chwgt
Usually it helps to show us code. Yeah, use if(src.key in Testers) that should work.
Simple enough.

var/list
testers = list("chwgt")
// save the 'ckey' version of their key

proc
save_test_list()
var/savefile/S = new("testers.sav")
S["testers"] << testers

load_test_list()
if(fexists("testers.sav"))
var/savefile/S = new("testers.sav")
S["testers"] >> testers

mob
Login()
if(!(src.ckey in testers)) // if their ckey isn't in the list, don't let them in
src << "You are not a tester, so you cannot log in now!"
del(src)
// regular login code

verb/add_tester(t as text)
t = ckey(t)
if(!t) return
testers += t
src << "'[t]' added to testers list."


Just call save_test_list() when the world is closed, and load_test_list() when it is created.

~~> Unknown Person
In response to Unknown Person (#2)
Thanks.
In response to Kalzar (#1)
This is Developer How-To. If the post is in the right position, and it is, we need not any code. He's actually asking for code.
In response to CaptFalcon33035 (#4)
Yeah, I read his post wrong =P