ID:143259
 
Code:
UCS
parent_type=/obj/
icon='Cheat Stars.dmi'
CL
name="CHEAT STAR HALF A (COMBINE)"
icon_state="FINALC1"
Click()
if(usr.COMBINING==0)
usr.COMBINING=1
world<<OUT("[usr.name] IS COMBINING THE CHEAT STARS! WATCH OUT!","WC")
usr<<OUT("This is a tedious process, you must wait 100 seconds, but this will make you berserk","GA")
usr.berserk=1
var/PERCENT=0
var/DONE=0
while(!DONE)
sleep(10)
PERCENT+=1
usr<<OUT("[PERCENT]% done combining","LC")
if(PERCENT==100)
break
else
continue
usr<<OUT("Thanks for waiting! ENJOY YOUR STAR!","LC")
world<<OUT("[usr.name] has finished combining the stars! No more berserk!","WC")
usr.berserk=0
usr.COMBINING=0
usr.contents+=new/UCS/CF
del(/UCS/CR)
del(/UCS/CL)
return
else
usr<<OUT("No double combining!","GA")
return


Problem description:
How would I make it actually delete the items from the user's contents? I've tried usr.contents-=/stuff/stuff and the del(/stuff/stuff) that I have right now.
del() needs an atom, not a path.
In response to Kaiochao2536
Thats not much help.
In response to Madjarjarbinks
If you wanted to delete everything, you could put

del(src.contents)
In response to Jman9901
_> But that would delete the other cheat stars in the inventory.
In response to Madjarjarbinks
Well I said if you wanted to delete everything... Why don't you just look up del() proc, del atom or something...
In response to Jman9901
J, still not useful. No luck.
In response to Madjarjarbinks
Try this after the code...

usr.contents -= new/UCS/CF
In response to Jman9901
Already tried that, I had to do that for(var/blah/blan in contents) stuff.
In response to Madjarjarbinks
But this is the "-=" thing. It should work without all of the for(blahblahblah) junk...
In response to Jman9901
Its what I tried at first, but the things stayed in the inventory both
In response to Madjarjarbinks
If you tried a for(), it would work. Or just defining a var locating a certain object in your contents, and deleting it.
In response to Kaiochao2536
I already did a for() you foo.
var/UCS/CR/One = locate() in usr
var/UCS/CL/Two = locate() in usr
if(One) del One
if(Two) del Two


That should do it. You may want to use those checks in the very beginning, to make sure they have both parts (I'm assuming they're both needed to combine) and then do the deleting at the end like you were trying to do.
In response to Detnom
I don't really understood what you trying to do but i think this is what you ae trying to do is delte all the cheaps by the name of CR in the contents if so try this the idents my be offset because i did it right in the forum and btw you should have put this in developers how to
for(var/UCS/CR/S in src.contents)
del(S)
In response to DoomRaiden
What I did finds one of each type he's wanting to delete and deletes them if it finds them. What you're doing is looping through the contents and deleting all the CRs, which is still leaving the CLs. And if a person has multiple pieces, that'll get rid of them, and I don't know if that's what the owner is wanting to accomplish or not. What I posted should work just fine.
In response to Detnom
like i said i didnt undersntad his thing very well and i forgot to do the CL i figure if you know how to do one you can do the other one