/*
Usage:
Initializer (REQUIRED): var/names/n = new/names
Adding: n.add(name) -> [ TRUE | FALSE ]
Removing: n.rem(name) -> [ TRUE | FALSE ]
File Existence: n.load() -> [ TRUE | FALSE ]
Exporting Names: n.load(1) -> [ /list ]
*/
names
var/namefile = "savefile/system/names.sav"
proc/load(export=0)
if(fexists(namefile))
switch(export)
if(1)
var{namelist[];savefile/F = new(namefile)}
F["n"] >> namelist
. = namelist
else .=1
else .=0
proc/add(name)
var/namelist[] = list()
if(load()) namelist = load(1)
if(name in namelist) return 0
namelist+=name
var/savefile/F = new(namefile)
F["n"]<<namelist
.=1
proc/rem(name)
var/namelist[] = list()
if(load()) namelist = load(1)
if(!(name in namelist)) return 0
namelist-=name
var/savefile/F = new(namefile)
F["n"]<<namelist
.=1
Note: There is no play-by play one what is done in the code, I'm not a good explainer. The usage (how to use) is at the top.