ID:149269
 
Okay, the problem with the following code is: For instance, i got cape 1, and Cape 2, in the inventory, when i Click equip, it says
You wear Cape 1
You wear Cape 2

But, if there is 2 different kinds of items in the inventory, i want to choose which one to equip, any ideas?

Code:


    Equip
icon = 'hud.dmi'
icon_state = "save"
layer=1000000001
New(client/C)
screen_loc = "1,8"
C.screen+=src
Click()
for(var/obj/Cloths/O in usr)
if (O.loc != usr)
return
if (suffix == null)
var/Can_Equip = 1
if (usr.equiped == 1)
Can_Equip = 0
if (Can_Equip)
usr << "<font face=Courier>You Wear Your \icon[O]<font color = blue> [O]."
usr.DEF += power
usr.equiped = 1
suffix = "(Wearing)"
else
usr << "<font face=Courier>Your already wearing somthing."
else
suffix = null
usr.DEF -= power
usr.equiped = 0
usr << "<font face=Courier>You Remove Your \icon[O]<font color = blue> [O]."


RaeKwon
Have you tried switch if it's even possible, I don't know its just an idea.
Bah that was easy, i fixed it simply by going....


    Equip
icon = 'hud.dmi'
icon_state = "save"
layer=1000000001
New(client/C)
screen_loc = "1,8"
C.screen+=src
Click()
var/obj/Cloths/O = input("What do you wish to wear?", "Wear", null) in usr
if (O.loc != usr)
return
if (suffix == null)
var/Can_Equip = 1
if (usr.equiped == 1)
Can_Equip = 0
if (Can_Equip)
usr << "<font face=Courier>You Wear Your \icon[O]<font color = blue> [O]."
usr.DEF += power
usr.equiped = 1
suffix = "(Wearing)"
else
usr << "<font face=Courier>Your already wearing somthing."
else
suffix = null
usr.DEF -= power
usr.equiped = 0
usr << "<font face=Courier>You Remove Your \icon[O]<font color = blue> [O]."



RaeKwon
In response to Strange Kidd
RaeKwon......asking for help....thats a new one!
In response to KaosXL
Well no one is perfect, not even RaeKwon.
In response to KaosXL
KaosXL wrote:
RaeKwon......asking for help....thats a new one!


No. Not really.
In response to Strange Kidd
Yo, it was just a joke, Calm down.