ID:169472
 
I was trying to make a proc to remove any number of items from the users inventory when the proc is called. It doesn't work. Could someone help me out? I is the item path to re move and N is how many.

proc
RemoveItem(I,N)
var/a
for(I in src)
if(a>=N)
return
else
a++
del(I)
proc
RemoveItem(I,N)
var/a
do
sleep(1)
if(a>=N) return
a++
var/atom/A=locate(I) in src
if(A)
del(A)
while((locate(I) in src))
In response to Teh Governator
Thanks, I see my mistakes.