obj
house_Door
icon = 'turfs.dmi'
icon_state = "door"
density = 1
layer = MOB_LAYER + 2
password
var/opened=0
bought = 0
verb
Buy()
set src in oview(1)
set category="Door"
if(src.bought == 0||src.bought == null)
switch(alert("Would you like to Purchase this house? it cost 30,000 zenni", "Purchase", "Yes","No"))
if("Yes")
if(usr.zenni < 30000)
usr<<"<b><font color = Lime>This costs 30,000 zenni!"
if(usr.zenni >= 30000)
usr.zenni -= 30000
usr<<"<b><font color = Silver>Okay! You may enter your House any time you want now!"
src.name = "[usr]'s House"
src.bought = 1
var/savefile/G = new("Houses.sav")
G["Houses"] << password
usr.client.SaveMob()
Open()
set src in oview(1)
set category="Door"
set name="Open"
if(src.password == null && src.bought == 1)
var/password1 = input("What do you wish to make the password? make it hard so no one can come in except you") as text
src.password = password1
else
if(src.opened == 0 && src.bought == 1||src.opened == null && src.bought == 1)
var/choice = input("What is the password?") as text
if(choice == src.password)
src.opened=1
flick("door5",src)
src.icon_state="door7"
density=0
sleep(30)
flick("door6",src)
src.icon_state="door"
src.opened=0
density=1
else
usr<<"<b><i><u><font color = Red>Incorrect Password!"
else
usr<<"<b>This Door isn't bought yet!"
Sell_House()
set src in oview(1)
set category="Door"
set name="Sell House"
if(src.opened == 0 && src.bought == 1||src.opened == null && src.bought == 0)
usr << "<b><font color = Silver>You sold your House back to the community and got 15,000 zenni back."
usr.zenni += 15000
src.bought = 0
src.verbs += /obj/house_Door/verb/Buy
else
usr << "You can't!"
Problem description:</bThe problem is when i buy the door and set a password. And i log out and go in again the i have to buy the door all over and make a new password again.
I want it so when you log out and go in back you have the same password