Code:
Problem description:
Here is the problem i want the door password to save so when i log it back the password wil bee the save so i can go in the door again.
Becasue when i log out and go in back i have to buy the door back casue the password don't work.
Can you please help me
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!"</30000></<>
ID:262221
Feb 7 2005, 1:19 pm
|
|
In response to Lummox JR
|
|
O mybad i kinda new at this here is the codes again
An th problem is the same it would save 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!" |
In response to Sayian Hunter
|
|
You still didn't listen. Bold = HTML and you didn't post it inside the DM brackets.
|
In response to N1ghtW1ng
|
|
what do you mean i don't under stand you
|
In response to Sayian Hunter
|
|
Sayian Hunter wrote:
O mybad i kinda new at this here is the codes again |
In response to Sayian Hunter
|
|
< d m >
Your code goes here < / d m > Problem goes here. Just remember, don't put spaces like I did, if you do it properly, you should get this: Code! Code Problem: Your problem with the above code. |
Lummox JR