Bringer Posted January 20, 2018 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: April 16 Share Posted January 20, 2018 Requesting for an NPC that will allow a player to delete all items specifically with id #10013 on players inventory Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted January 20, 2018 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: Yesterday at 07:50 PM Share Posted January 20, 2018 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; } Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted January 20, 2018 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: April 16 Author Share Posted January 20, 2018 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 Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted January 20, 2018 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted January 20, 2018 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; } Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted January 21, 2018 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: April 16 Author Share Posted January 21, 2018 (edited) @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; Edited January 21, 2018 by Bringer Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted January 21, 2018 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: Yesterday at 07:50 PM Share Posted January 21, 2018 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; Quote Link to comment Share on other sites More sharing options...
Question
Bringer
Requesting for an NPC that will allow a player to delete all items specifically with id #10013 on players inventory
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.