ID:139852
 
Code:
obj
sword
icon = 'sword.dmi'
verb
Get()
set src in oview(1)
view() << "[usr] picks up \a [src]"
src.loc = usr
Drop()//I added it in now it wont work
if (usr.sword_equipped ==1)
usr << "Unequip it first."
return
view() << "[usr] drops \a [src]"
src.loc = usr.loc
Equip()
if(usr.sword_equipped == 0)
usr.Strength += 2
usr.sword_equipped = 1
view() << "[usr] equips a sword."
else
usr << "You are already wielding something."
Unequip()
if(usr.sword_equipped == 1)
usr.Strength -= 2
usr.sword_equipped = 0
view() << "[usr] unequips a sword."
else
usr << "You aren't wielding this."


Problem description: Objects.dm:22:error: inconsistent indentation
Objects.dm:24:error: inconsistent indentation
Objects.dm:25:error: inconsistent indentation
Objects.dm:28:error: inconsistent indentation
Objects.dm:29:error: inconsistent indentation
Objects.dm:30:error: inconsistent indentation
Objects.dm:31:error: inconsistent indentation
Objects.dm:32:error: inconsistent indentation
Objects.dm:33:error: inconsistent indentation
Objects.dm:34:error: inconsistent indentation
Objects.dm:33:warning: empty 'else' clause
Objects.dm:35:error: inconsistent indentation
Objects.dm:36:error: inconsistent indentation
Objects.dm:37:error: inconsistent indentation
Objects.dm:38:error: inconsistent indentation
Objects.dm:39:error: inconsistent indentation
Objects.dm:40:error: inconsistent indentation
Objects.dm:41:error: inconsistent indentation
Objects.dm:40:warning: empty 'else' clause
Objects.dm:46:error: proc definition not allowed inside another proc


One of your else's is out of place in the drop verb.

Also you need to put your snippet inside of the dm tags.
In response to UmbrousSoul
Where do I need to put it to prevent being able to drop a weapon while it is equipped?
In response to M6qllp9M
You need to put in a check to see whether its equipped or not, and prevent them from dropping it if it is equipped.

I can't do it for you.
In response to UmbrousSoul
I put this on here to see if someone could help... If you cant help me then dont comment please.
In response to M6qllp9M
I did help you, you posted about inconsistent indentation and I pointed out the problem. That is helping. Then you request a new feature for your code, I can't do that for you.
As Umbrous did helpfully say, you're really not doing it right.
If you want to disable dropping while the sword is equipped, you should check at the beginning of Drop() the same way you do with Equip(). Adding "else" at the end of a verb with nothing before it won't automatically make the game check anything.

Drop()
if(usr.sword_equipped)
usr << "u hav et equip'd. no drop."
return
view() << "[usr] dropz!"
loc = usr.loc