ID:148213
 
I am trying to let the player equip these tubes to give him more paint capacity. And allow the player to equip up to two tubes. I can't seem to get this to work:
    Black_Tube
icon = 'items.dmi'
icon_state = "tube"


if(amount == 0)
if(equipped == 0)
verb/Equip_Tube()
set category = "Commands"
usr.max_paint += 100
usr.equipped = 1
usr.amount = 1
del(src)
else
verb/Unequip_Tube()
set category = "Commands"
usr.max_paint -= 100
usr.equipped = 0
usr.amount = 0
new/obj/Black_Tube(usr)
else if(amount == 1)
if(equipped2 = 0)
verb/Equip_Tube()
set category = "Commands"
usr.max_paint += 100
usr.equipped2 = 1
usr.amount = 2
del(src)
else
verb/Unequip_Tube()
set category = "Commands"
usr.max_paint -= 100
usr.equipped2 = 0
usr.amount = 1
new/obj/Black_Tube(usr)
else
alert("You may not hold more than two paint tubes!")


I get multiple errors:
obj.dm:44:error:amount:duplicate definition
obj.dm:44:error:0:duplicate definition
obj.dm:44:error:== :instruction not allowed here
obj.dm:44:error::empty type name (indentation error?)
obj.dm:45:error:equipped:duplicate definition
obj.dm:45:error:0:duplicate definition
obj.dm:45:error:== :instruction not allowed here
obj.dm:45:error::empty type name (indentation error?)
obj.dm:45:error::empty type name (indentation error?)
obj.dm:59:error:amount:duplicate definition
obj.dm:59:error:1:duplicate definition
obj.dm:59:error:== :instruction not allowed here
obj.dm:59:error::empty type name (indentation error?)
obj.dm:60:error:equipped2:undefined var
obj.dm:60:error::empty type name (indentation error?)
obj.dm:60:error::empty type name (indentation error?)
obj.dm:75:error:"You may not hold more than two paint tubes!":value not allowed here
obj.dm:46:error::empty type name (indentation error?)
obj.dm:61:error::empty type name (indentation error?)

Thanks for any help.
You can't use if() outside of a proc. However, you can add and subtract verbs from the <code>verbs</code> list, such as:
obj
equippable
verb
equip()
//bleh
verbs -= /obj/equippable/verb/equip
verbs += /obj/equippable/proc/unequip
proc
unequip()
//blorg
verbs -= /obj/equippable/proc/unequip
verbs += /obj/equippable/verb/equip

Remember: verbs are just procs that are placed in src's verbs list by default.