ID:142309
 

var
Players

mob
proc
Save()
var/savefile/F = new("players/[src.key].sav")
src.V = src.verbs
src.pokemonstuff = src.pokemonlist
S["X"] << src.x
S["Y"] << src.y
S["Z"] << src.z
S["Name"] << src.name
S["Icon"] << src.icon
S["IconState"] << src.icon_state
S["dir"] << src.dir
Write(F)
src << "<font color=blue><b>Your game has been saved!"

mob
proc
LoadPlayer()
if(fexists("players/[usr.key].sav"))
var/savefile/F = new("players/[src.key].sav")
Read(F)
for(var/stuff in usr.V)
usr.verbs += stuff
for(var/mob/Pokemon/P in usr.pokemonstuff)
usr.pokemonlist = usr.pokemonstuff
for(var/mob/Pokemon/P in usr.pokemonlist)
P:owner=usr
world << "<font color=#000046><B>Info: <font color=silver>[src]([src.key]) has logged in..."
S["X"] >> src.x
S["Y"] >> src.y
S["Z"] >> src.z
S["Name"] >> src.name
S["Icon"] >> src.icon
S["IconState"] >> src.icon_state
S["dir"] >> src.dir

turf
New
density = 1
layer = 999
Click()
//usr.loc = locate(10,10,1)
usr.Save()
var/name = input("","Name") as text|null
if(length(name) > 25)
usr << "No HTML, and names like that are too long"
return
if(length(name) < 1)
usr << "You must have A name."
return
usr.name="[html_encode(name)]"
usr.Change_Icon()
usr.loc=locate(7,7,3)
usr.Save()
turf
Quit
density=1
layer=999
Click()
del(usr)

mob
verb
Savenow()
set name = "Save"
usr.Save()

mob/var/list
V
pokemonstuff
atom/movable/var
xco=0
yco=0
zco=0

turf
Load
density = 1
layer = 999
Click()
usr.LoadPlayer()
mob
proc
DeleteChar()
if(fexists("players/[src.key].sav"))
var/sure=alert(src,"Are you sure you want to delete your character?","Confirmation","No","Yes")
if(sure=="Yes")
sleep(0)
fdel("players/[src.key].sav")
src << "Character Deleted"
else
src << "Canceled deleting '[src.key].sav'"
else
src << "You do not have a character saved on this server."
turf
Delete
density = 1
layer = 999
Click()
usr.DeleteChar()

mob
Logout()
Players -= 1
world << "<font color=green>[src.name] has logged out!"


Alright heres the run down of the issue, whenever a player saves and logs back in, all of their pokemon (its a pokemon game) are gone. I want to know how to fix this, any idea?

no usr in procs

fgsfdsfsdf
In response to Darkmag1c1an11
He never used usr in procs besides Click() which is perfectly acceptable, because if he used src in there, he would be referring to the turf instead of the person who clicked it.
In response to Andre-g1
Andre-g1 wrote:
Click() which is perfectly acceptable

True.

He never used usr in procs besides Click()

False.
In response to Kaioken
Didn't notice because it was blue(the colour).

My bad.
Next time, instead of recoloring all of the code (and making it look awful), just post the relevant code within the dm tags.
It doesn't appear to have an F["pokemon"] there as far as I can see, and you are using usr in a proc, where it never belongs.. (Didn't really read much of your code, because it's not in dm tags.)
EDIT:
You have defined your savefile as 'F,' but you're using S everywhere else...
In response to Naokohiro
So how do you suggest I fix this problem?
I changed the F to S and it still has the same problem..
In response to Scumdog
Did you listen to what some here have said, to not use usr in the proc? :/
In response to Naokohiro
I'll try that.. Thanks, so I change the usr. to src?
In response to Scumdog
In other words, what do I do? Sorry.. I'm not an expert coder yet