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<<"This costs 30,000 zenni!"
if(usr.zenni >= 30000)
usr.zenni -= 30000
usr<<"Okay! You may enter your House any time you want now!"
src.name = "[usr]'s House"
src.bought = 1
var/savefile/F = new("Houses.sav")
src.password = password1
F["Houses"] << Houses
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<<"Incorrect Password!"
else
usr<<"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 << "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:
The Probelm is when you buy it and set a passowrd, and log out you have to buy it again and put in the new password.
i want it so when you log out the password saves on the door so when you log in again you jsut put in the password to go in.