ID:149492
 
If you press load after using save, this should output all of the different character names a player has used; unfortunately, it doesn't work. Any ideas?


mob/verb
load()
if(!fexists("players/[usr.ckey]/index/char_list.sav"))
return
var/savefile/G = new("players/[usr.ckey]/index/char_list.sav")
var/list/temp
G["index"] >> temp
for(var/M in temp)
usr << M

save()
if(fexists("players/[usr.ckey]/index/char_list.sav"))
var/savefile/G = new("players/[usr.ckey]/index/char_list.sav")
var/list/temp
G["index"] >> temp
if(usr.name in temp)
else
temp += usr.name
G["index"] << temp
else
var/savefile/G = new("players/[usr.ckey]/index/char_list.sav")
var/list/temp = list(usr.name)
G["index"] << temp</<>
Suddenly I think I see the problem: usr.ckey probably isn't what you need. Try usr.client.ckey instead. usr will be the mob, which doesn't have a ckey var unless you gave it one. If you gave it a ckey value, odds are it's not being assigned correctly.

Lummox JR
In response to Lummox JR
it works now :) thanks for your help