Jump to content
  • 0

NPC Delete Inventroy


Question

5 answers to this question

Recommended Posts

  • 0
Posted
prontera,0,0,0	script	yes i am npc	444,{
	mes"player name?";
	input .@name$;
	attachrid(getcharid(3,.@name$))
	delitem 10013,countitem(10013);
	detachrid;
	close;
}

 

  • 0
Posted
41 minutes ago, sader1992 said:

prontera,0,0,0	script	yes i am npc	444,{
	mes"player name?";
	input .@name$;
	attachrid(getcharid(3,.@name$))
	delitem 10013,countitem(10013);
	detachrid;
	close;
}

 

Can i yess there a menu yes or not and need to input name

  • 0
Posted

try this.


prontera,155,181,5	script	Sample	4_F_KAFRA1,{
	if (getgmlevel() >= 99) {
		mes "Do you want to remove an item from a player's inventory?";
		if (select("Yes", "No") == 1) {
			mes "Player name?";
			input .@player_name$;
			.@aid = getcharid(3, .@player_name$);
			if (!.@aid) {
				mes "Player isn't online.";
				.@aid = 0;
			}
			else {
				mes "Item ID?";
				input .@item_id;
				if (getitemname(.@item_id) == "null" || getitemname(.@item_id) == "") {
					mes "Invalid items";
					.@item_id = 0;
				}
			}
		}
		close2;
		if (.@aid > 0 && .@item_id > 0) {
			if (attachrid(.@aid)) {
				.@count = countitem(.@item_id);
				if (.@count > 0) {
					delitem .@item_id, .@count;
					mes "A GM removed "+.@count+"x "+getitemname(.@item_id)+" from your inventory.";
					close2;
				}
			}
		}
	}
	else {
		npctalk "Only GM can use this npc.";
	}
	end;
}

 

  • 0
Posted
56 minutes ago, Bringer said:

@sader1992 @Emistry thanks for the reply

i use code 

 


	getinventorylist;
	for (set .@a, 0; .@a < @inventorylist_count; set .@a, .@a + 1) 
		if (@inventorylist_id[.@a] == 10013) 
			delitem @inventorylist_id[.@a], 1;

 

^

=

if(countitem(10013)) delitem 10013,1;

 

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