ID:145991
 
Code:
var/equipw
var/equipa
var/equips

obj
var
ammount = 1
equipa = 1
equipw = 1
equips = 1 // Defined twice to see if it fixed it
Toy_Sword
Price = 20
icon = 'Weapons.dmi'
icon_state = "toy"
verb/Get()
set src in oview(0)
if(usr.contents.len==0)
src.Move(usr)
else if(usr.contents.len>=1)
for(var/obj/O in usr.contents)
if(O.name==src.name)
O.ammount+=1
del src
else
src.Move(usr)
verb/Equip()
if(!usr.equipw)
usr<<"You already have a weapon equipped!"
return
else
usr<<"You equip the Toy Sword!"
usr.equipw = 0
usr.str += 3
verb/Unequip()
if(usr.equipw)
usr<<"You don't have this equipped!"
return
else
usr.equipw = 1
usr<<"You unequip the Toy Sword!"


Problem description: obj.dm:78:error:usr.equipw:undefined var
obj.dm:83:error:usr.equipw:undefined var
obj.dm:86:error:usr.equipw:undefined var
obj.dm:90:error:usr.equipw:undefined var

PS:Equipw = weapon, s=shield, a=armor


currently you have this
obj
var
ammount = 1
equipa = 1
equipw = 1
equips = 1 // Defined twice to see if it fixed it

change it to this
obj
var/ammount = 1
var/equipa = 1
var/equipw = 1
var/equips = 1 // Defined twice to see if it fixed it
In response to The Riddler
Nope, doesn't work... Anyone else?
The variable you're trying to get isn't defined under a mob type, therefore when you try to find it using usr, it won't work.
mob/var {equipw;equipa;equips}

And Riddler, it doesn't matter which way he does it, both ways work.
Could even do it as so;
var {a;b;c;d;e;f;g;h;i;j;k;l}
Your equipment system has a serious design flaw. For one thing, the equipw/a/s vars should belong to a mob; they should not be global. For another thing, you should be setting them to an actual weapon/armor/shield or to null, not to 1 or 0.

It's next to useless for the weapon itself to keep track of whether it's equipped. What's far more important is to know which weapon, if any, a mob is using.

Lummox JR