ID:143314
 
Code:
mob
Login()
if(usr.ckey in Admin)
usr.verbs+=typesof(/mob/Admin/verb)
..()
world << "[usr] has logged in!"
usr.loc = locate(9,40,1)
var/savefile/X = new("playerdata/[usr.ckey]hasfile")

Read(X)
usr.hasfile << X["hasfile"]
usr.icon_state = null
LOGIN
switch(alert("Choose an option...","Login","New","Load"))
if("New")
var/savefile/F = new("playerdata/[usr.ckey]")
del(X)
del(F)
usr.hasfile = 1
usr.UpdateGPA()

usr << "Please wait while you are registered for School..."
if(usr.gender == "male")
usr.setgender = "malestudent"

if(usr.gender == "female")
usr.setgender = "femalestudent"

sleep(50)
usr.icon = 'mob.dmi'
usr.icon_state = usr.setgender
usr.loc = locate(24,7,2)
if(usr.ckey in principal)
usr.icon_state = "principal"
return ..()


if(usr.ckey in teacher)
usr.icon_state = "[usr.gender]teacher"
return ..()







if("Load")
if(usr.hasfile == 1)
var/savefile/F = new("playerdata/[usr.ckey]")
Read(F)
usr.x = F["x"]
usr.y = F["y"]
usr.z = F["z"]
usr.icon_state = F["icon_state"]
usr.setgender = F["setgender"]
usr.contents = F["contents"]
return

if(usr.hasfile == 0)
goto LOGIN
return








Stat()
statpanel("Backpack")
stat(contents)


statpanel("Grades")
stat("GPA:", usr.gpa/100)









var
list
principal = list("jaxxmarron")

teacher = list("")

Admin = list("jaxxmarron")

gpa = 0
math = 50
english = 50
science = 50
history = 50

setgender

hasfile = 0



proc
UpdateGPA()
usr.gpa = usr.math+usr.english+usr.science+usr.history



Logout()
var/savefile/F = new("playerdata/[usr.ckey]")
var/savefile/X = new("playerdata/[usr.ckey]hasfile")
Write(F)
F["x"] << usr.x
F["y"] << usr.y
F["z"] << usr.z
F["icon_state"] << usr.icon_state
F["setgender"] << usr.setgender
X["hasfile"] << usr.hasfile
F["contents"] << usr.contents
del(usr)


Problem description:
Yes, it's HIDEOUS code. But it's still in the beginning stages.

Whenever I try to run my game, I get errors whenever I pick up the Notebook Item

Notebook Code:
obj
Notebook
icon = 'obj.dmi'
icon_state = "notebook"
owner
verb
Pick_Up()
set src in oview(1)
src.owner = usr
src.name = "[src.owner]'s Notebook"
src.Move(usr)

Read_Notebook()
set src in view(0)
var/notebook = {"
<html>
<head><title>
[src.owner]'s Notebook</title></head>
<body>
[usr.notebook]</body>
</html>
"}

usr << browse(notebook,"window=notebook")


Take_Notes()
set src in view(0)
usr.notebook += "<br></br>"
usr.notebook += input("Write What?","Notebook")


var
owner



Basically, whenever I save with the Notebook in my inventory, I can't load my file properly the next time I run the game.

Any help would be greatly appreciated!

Thanks!

-JaxxMarron
Format:
Write(savefile/F)

Default action:
Write the value of each variable to a directory by the same name as the variable. Variables marked tmp, global, or const and variables which are equal to their initial value are skipped.



Same goes for read.