Jump to content
  • 0

Delitem Problem help please


Question

Posted
		for(set .@i,0; .@i < getarraysize(@inventorylist_id); set .@i,.@i+1){
				for(set .@k,0; .@k<getarraysize(.delitems); set .@k,.@k+1){
					if(@inventorylist_id[.@i] == .delitems[.@k]){
					delitem .delitems[.@k],@inventorylist_amount[.@k];
					}
				}
		}

I have a problem with this it says.

[Error]: script:delitem: failed to delete 3 items (AID=2000000 item_id=14003).
[Debug]: Source (NPC): mainevent (invisible/not on a map)

Please help me.

8 answers to this question

Recommended Posts

Posted

got it.


				getinventorylist; 
				for(set .@k,0; .@k<getarraysize(.delitems); set .@k,.@k+1){
					if(countitem(.delitems[.@k])>0){
					delitem .delitems[.@k],@inventorylist_amount[.@k];
					}
				}

is this one correct now?

Posted
getinventorylist;
while( .@i < @inventorylist_count ){
	delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];
	.@i++;
}
end;

all item will be deleted.

Posted

no I just want to delete this list

	setarray .delitem[0],5288,5401,5471,515,5362,5361,5462,5225,5420,5313,5375,5389,5325,5463,5372,5379,
				  5137,5377,5800,18511,5376,5314,5155,18510,18508,18509,18506,5423,5224,4035,4092,
				  4004,4043,4031,4058,4133,4381,4079,4064,2310,2102,2504,2404,2621,2624,1208,1108,
				  1117,1408,1464,1302,1352,1514,1602,1705,1802,1902,1953,1550,1251,25001,14003,645,
				  657,656,678,12009,1751,715,716,717,7136,7135;

	setarray .delitems[0],14003,645,657,656,678,12009,1751,715,716,717,7136,7135;
Posted


setarray .delitem[0],5288,5401,5471,515,5362,5361,5462,5225,5420,5313,5375,5389,5325,5463,5372,5379,

5137,5377,5800,18511,5376,5314,5155,18510,18508,18509,18506,5423,5224,4035,4092,

4004,4043,4031,4058,4133,4381,4079,4064,2310,2102,2504,2404,2621,2624,1208,1108,

1117,1408,1464,1302,1352,1514,1602,1705,1802,1902,1953,1550,1251,25001,14003,645,

657,656,678,12009,1751,715,716,717,7136,7135;

setarray .delitems[0],14003,645,657,656,678,12009,1751,715,716,717,7136,7135;

.delitem_size = getarraysize( .delitem );

.delitems_size = getarraysize( .delitems );

// array 1

while( .@item1 < .delitem_size ){

.@i = countitem( .delitem[.@item1] );

if( .@i )

delitem .delitem[.@item1],.@i;

.@item1++;

}

// array 2

while( .@item2 < .delitems_size ){

.@i = countitem( .delitems[.@item2] );

if( .@i )

delitem .delitems[.@item2],.@i;

.@item2++;

}

Posted (edited)

The problem now is it don't continue on this part no warping happens.

set $teama$,0;
set $teamb$,0;
areawarp .Map$,66,60,79,77,"veil", 120, 110;	// Team A
areawarp .Map$,120,60,133,77,"veil", 120, 110;	// Team B
OnDoDismiss:
deletearray .@acc[0],getarraysize(.@acc);
query_sql("SELECT `account_id` FROM `char` WHERE `online` = '1'", .@acc);
for(set .@i,0; .@i<getarraysize(.@acc); set .@i,.@i+1){
attachrid .@acc[.@i];

if(strcharinfo(3) != .Map$) {end;}

	unequip EQI_HEAD_TOP;
	unequip EQI_ARMOR;
	unequip EQI_HAND_L;
	unequip EQI_HAND_R;
	unequip EQI_GARMENT;
	unequip EQI_SHOES;
	unequip EQI_ACC_L;
	unequip EQI_ACC_R;
	unequip EQI_HEAD_MID;
	unequip EQI_HEAD_LOW;

	while( .@item1 < .delitem_size ){
		.@i = countitem( .delitem[.@item1] );
		if( .@i )
			delitem .delitem[.@item1],.@i;
		.@item1++;
	}
	savepoint "veil", 120, 110;
}
set $teama$,0;
set $teamb$,0;
areawarp .Map$,66,60,79,77,"veil", 120, 110;	// Team A
areawarp .Map$,120,60,133,77,"veil", 120, 110;	// Team B

end;
Edited by gmprestige

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...