Ok i want to thank everyone again for helping me ill prob be posting alot lol, but its been awsome witht the help cause its helping me to learn alot. Well off to my question i wanted to create it so when you double clicked my recovery tank you get a list, where you can then choose from a set of options. Right now heres the code i have
obj
rectank
icon_state = "rectank"
DblClick()
usr.healtank = input("Do you want to Recover?","Healtank",usr.healtank) in list ("Heal-$50","Cancel")
if("Heal-$50")
usr.health = usr.healthmax
usr.money -= 50
if("Cancel")
del(src)
return
Ok i have all the vars right and theres no errors (assume theres no indentation problems). But when i make the obj on the map and go double click it nothing happens. Any help would be apreciated thanks again.
-kalzimere
ID:150442
Sep 24 2001, 1:21 pm
|
|
In response to FIREking
|
|
wow thanks a ton for your help fireking.
|
In response to Kalzimere
|
|
Ok well i got the code working some waht more cleare now thanks to fire king but it still won't work when i double click the obj on the map. Heres the code again:
rectank icon_state = "rectank" DblClick() var/answer = input("Do you want to Recover?") in list ("Heal-$50","Cancel") switch(answer) if("Heal-$50") if(usr.money > 50) usr.health= usr.health max usr.money -= 50 else alert("You do not have enough money.") if("Cancel") del(src) return 0 lol well its all screwed up there but assume its all idented right and no errors. Now do i have to realate this code to the obj on the map through a propertty on the obj any help is again appreciated. -Kalzimere |
In response to FIREking
|
|
FIREking wrote:
Kalzimere wrote:start() proc/start() var/list/L = new L += "Heal-$50" L += "test" L += "Cancel" var/answer = input("Do you want to recover?","HealTank") in L try this, it has a test in the list just to see something that might be happening notice you cannot copy and paste code from forums, we have to use spaces, and byond has to use tab keys... --FIREking |
obj
rectank
icon = 'something.dmi'
icon_state = "rectank"
DblClick()
var/answer = input("Do you want to recover?","HealTank") in list("Heal-$50","Cancel")
switch(answer)
if("Heal-$50")
if(usr.money > 50)
usr.money -= 50
usr.health = usr.healthmax
else
alert("You dont have enough money!")
if("Cancel")
del(src)
return 0
have fun!
--FIREking