I have made buttons that when u click them, it changes icon.
you can only click 1 at a time and you have to unclick that one to select another. I want to make things that only happen if a certain button is selected
My coding to do this is like....
if(active == "attack")
stuff that happens
attack is name of button
active is var that names the selected button
I have also tried....
if(active == /obj/buttons/attack)
stuff that happens
neither seem to work but if i do a message to the usr like....
usr << "[active] is selected"
..when "attack" is clicked it says....
"the attack is selected"
so it recognized what active was but how do i make the correct "if" statement to make this work??
thank you for your time!!!!!
ID:148047
Jul 28 2003, 8:08 pm
|
|
In response to Zaltron
|
|
hey thanks for the speedy reply!
I did something like that earlier but it took a long time and got messed up. I'll try your way but i dont really understand it. im a 2 week rookie mob/proc/check() i know thats the directory and the proc name for(var/obj/blah/o in usr.client.screen)um i dont really understand this... neither do i this... um... &&? what does that do?if(o.name=="blah"&&o.selected==1) Thanks for the advice but i really like to know what im doing so i can dont have to keep bothering the veterans here |
In response to Xallius
|
|
i found another way
i made a new var called optioncode and one called code then i gave each option's code a number so if i want the first option, i just say if optioncode == 1 thanks for the advice ! and plz tell me your opinion of this approach! |
In response to Xallius
|
|
Xallius wrote:
i found another way Sounds like a good approach to me. |
mob/proc/check()
I hope that made some sence.