ex:
obj/donate_button
icon = 'donate.dmi'
var
clicked = FALSE
Click()
if(clicked) return
clicked = TRUE
My_Function(usr)
clicked = FALSE
proc
My_Function()
if(usr.client.PayDimes(5,"Flick", "DONATE")
world << "Thanks"
else
world << "Thanks anyway"
return
If I click the object once, then click 'Cancel' on the PayDimes() input box, neither of the world outputs shows up, and I can't click the object anymore, as the Click() proc seems to have failed before reaching the 'clicked = FALSE' statement. I have found a way around this, but I would like to know if this is the way this is supposed to work or not.
flick()
obj/donate
icon='donate.dmi'
Click(K as num)
if(usr.client.PayDimes(K,"Flick"))
if(K==0)
return
else
world<<"[usr] has donated [K] dime\s"