ID:167076
 
I need to know how to make the code so only the person who made the object can delete it. Anyone know how to? Please help.
Give the obj an Owner var, then when deleting check to see if the mob is the owner of the obj, if he is delete it, if not dont delete it.
In response to Jester619
i know i need to do that just not shure how...
mob
verb
Destroy(obj/O as obj in oview(1))
set category = "Commands"
if(O.owner == usr.key)
del(O)
else
usr << "You cannot delete this, it's not yours." // i dont really know your vars for stuff, so heres just owner.


EDIT: I just figured you didn't know how to use the owner var, so.. here. Obviously the indentention is wrong, so dont just copy and paste. But you get the gist.
obj/var/owner

obj
poo
icon = 'stuff.dmi'
mob/verb/Build
Poo()
set category = "Build"
view() << "[usr] Poos!"
var/o = new/obj/poo(usr.loc)
o:owner = usr.key
In response to Evidence
You should generally avoid using : (as you are in o:owner). Change the var/o to var/obj/o and then o.owner will work.