Jump to content
  • 0

About delitem command


Question

Posted (edited)

How can I delete or what is the command for deleting equipment of the player (not in the inventory) example i have 2 pcs Shield in my inventory, and 1 shied (put on)in my Equipment, <<< -- so how can i delete this Shield in my equipment (not the 2 pcs Shield in my inventory) ? :)

Edited by kyeme

7 answers to this question

Recommended Posts

  • 0
Posted (edited)
On 9/21/2012 at 9:43 PM, Z3R0 said:

http://ea.dj-yhn.com...etinventorylist

@inventorylist_id[] - array of item ids.

@inventorylist_amount[] - their corresponding item amounts.

@inventorylist_equip[] - whether the item is equipped or not.

@inventorylist_refine[] - for how much it is refine

So you can use the following

 


 function del_equipped_item(.@item_id) {
getinventorylist;

for (set .@a, 0; .@a < @inventorylist_count; set .@a, .@a + 1) {
  if (@inventorylist_id[.@a] == .@item_id && @inventorylist_equip[.@a]) {
	delitem @inventorylist_id[.@a], 1;
	goto L_item_delete;
  }
}

mes "Item Not Found";
close;

L_item_delete:
mes "Item Deleted";
close;
 }
 

 

SIGH!!!! Damn you emistry, I didn't even see your post, and oddly enough we posted the exact same piece of code... lol

Still not work properly when we have the same item ID in the inventory. Is there any other function for delete item in specific item's ID?

Edited by SiRoCu
I mean Object ID of an item
Posted

try this..

prontera,155,181,5 script Sample 757,{
getinventorylist;
for( set .@i,0; .@i < @inventorylist_count; set .@i,.@i + 1 )
if( @inventorylist_id[.@i] == 1234 && @inventorylist_equip[.@i] ){
 delitem @inventorylist_id[.@i],1;
 mes "DONE";
}
close;
}

change the itemID here..

@inventorylist_id[.@i] == 1234

@Kyeme..

delitem cant work properly here.....it might delete the wrong item if you have more than 1 in your inventory.....

Posted (edited)

@Sir Emistry I already test the script but the command is for only deleting item in the inventory not in my equipped -> in the equipment slot. So there's no command here? or impossible?

I want to delete first the Equipped -> in my equipment slot, before the item in my inventory.

Edited by kyeme
Posted

http://ea.dj-yhn.com...etinventorylist

@inventorylist_id[] - array of item ids.

@inventorylist_amount[] - their corresponding item amounts.

@inventorylist_equip[] - whether the item is equipped or not.

@inventorylist_refine[] - for how much it is refine

So you can use the following

 function del_equipped_item(.@item_id) {
getinventorylist;

for (set .@a, 0; .@a < @inventorylist_count; set .@a, .@a + 1) {
  if (@inventorylist_id[.@a] == .@item_id && @inventorylist_equip[.@a]) {
	delitem @inventorylist_id[.@a], 1;
	goto L_item_delete;
  }
}

mes "Item Not Found";
close;

L_item_delete:
mes "Item Deleted";
close;
 }

SIGH!!!! Damn you emistry, I didn't even see your post, and oddly enough we posted the exact same piece of code... lol

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...