ID:138990
 
Code:
client
{
New()
{
if(fexists("saves/[ckey]"))
{
var savefile/f = new("saves/[ckey]");
f>>usr;
src<<"Savefile loaded.";
}
return ..()
}

Del()
{
var savefile/f = new("saves/[ckey]");
f<<usr;
return ..()
}
}


Even after simplifying the code this much, I cannot get it to save 2 variables that I am trying to save.

As said, I have two variables. One is numeric, another is a list. I have tried many different methods to save these, and it wont load.

Can anyone suggest the best way to do this? I have no idea what I am doing wrong.

I tried doing f["cash"]<, but it didn't load anything back.

</<cash>
In client/New(), ..() should really be called as soon as possible, unless you're doing some kind of ban check.

You should also not be using usr here, as it is inappropriate in procs.

Beyond that you'll need to show the declarations of the vars involved.
In response to Lummox JR
I got that saving from the Guide itself. My efforts failed, so I went to the Guide for...guidance. It uses usr in it, so you may want to fix that.

Anyways, my declaration of the only two variables I need saved:

client_control
{
parent_type = /mob;


var
{
cash = 50;
list/pieces = list();
}
}


As I said, I used that saving example straight from the Guide in desperation. Any help would be appreciated.
In response to Albro1
If that's the type that you're saving, then presumably if you use mob instead of usr in those client loads/saves it should work out. But I'm still not seeing the big picture here.
In response to Lummox JR
I thank you greatly, Lummox JR.

I feel like an idiot, but I thank you. I never did like saving.