for(var/obj/apple/a in usr.contents) del a
would delete both. can anyone help?
ID:165142
Feb 17 2007, 8:20 am (Edited on Feb 17 2007, 8:58 am)
|
|
when i want to check for an item in usr.contents, i do this: for(var/obj/a in usr.contents) but what if i only want to get ONE? like for example if i want to delete ONE apple but i have two, writing this:
for(var/obj/apple/a in usr.contents) del a would delete both. can anyone help? |
I'd try locate.
And what are you using this for? If you are using it for something such as obj/apple/verb/Eat(), I'd just put a del(src) in the verb. |
In response to Jon88
|
|
Oh, so if i wrote:
var/obj/apple/a = locare(/obj/apple) in usr.contents then one of my apples would be deleted? Yeah, that works perfectly, thanks again everyone. |
In response to Bobthehobo
|
|
I am filling up a pot with flour, and i just thought that the player might have a pot with them that they want to keep empty as well as the one they are filling up.
|
(You might need the list itself, player.contents instead of player, but I'm not sure)