ID:144263
 
Code:
obj/var/Owner

obj
verb/Get()
set category = "Commands"
if(src in view(1))
if(src.Owner == usr.key)
src.loc = usr
usr << "You got the [src]!"
else
usr << "This does not belong to you!"

verb/Drop()
set category = "Commands"
set src in usr
src.loc = usr.loc
view() << "[usr] drops the [src]"


Problem description:

I want that code to make it only the owner of the obj can pick it up,
If its not the owner who trys to pick the item up, It gets a msg,
I've gotten no errors,
But it doesent work,
Im in the game.. I bring in a clone to help me..
I drop an obj, But no one can pick it up, Not even me!

Can someone tel me whats rong?
Or recode it so it will work for me..
Because i do not understand.

- Bevan
obj/var/Owner

obj
verb/Get()
set category = "Commands"
if(src in view(1))
if(src.Owner == usr.key)
src.loc = usr
usr << "You got the [src]!"
else
usr << "This does not belong to you!"

verb/Drop()
set category = "Commands"
set src in usr
src.loc = usr.loc]
src.Owner = usr.key
view() << "[usr] drops the [src]"

You forgot to make the Owner var to the users key when you drop it.
Hope this helps.

In response to Armiris
Oh, That might work,

Thanks!


- Bevan
In response to BEVAN
sorry, typo.
just change this:
src.loc = usr.loc]

to this:
src.loc = usr.loc

I accidentally added a ']' at the end.
In response to Armiris
heres the complete code and is errors

obj/var/Owner

obj
verb/Get()
set category = "Commands"
if(src in view(1))
if(src.Owner == usr.key)
src.loc = usr
usr << "You got the [src]!"
else
usr << "This does not belong to you!"

verb/Drop()
set category = "Commands"
set src in usr
src.loc = usr.loc
src.Owner = usr.key
view() << "[usr] drops the [src]"


Errors:


MAP-And-other Crap.dm:587:error:verb/Drop:undefined var
MAP-And-other Crap.dm:587::warning: operation has no effect here
MAP-And-other Crap.dm:588:= :warning: assignment of procedural properties takes place at compile-time. Move this to the top of the procedure to avoid this warning.
MAP-And-other Crap.dm:589:in :warning: assignment of procedural properties takes place at compile-time. Move this to the top of the procedure to avoid this warning.

In response to BEVAN
Never mind,
Fixed it.

Just was to far across.
In response to BEVAN
did you copy and paste it?
if not i'll check the code again.
and your help with my code didn't work
added 5 errors.