Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Share Posted April 28, 2013 NPc only for admin that can delete item for all account Example I want to delete gold coins if my players have that just type in NPc the Id of item enter and the item will disappear Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 28, 2013 Try : prontera,150,150,0 script Delete 100,{ set .@GMLevel,99; set .@npc$,strnpcinfo(1); if (getgmlevel() < .@GMLevel) close; mes .@npc$; mes "Input the item id"; next; input .@id; next; if (getitemname(.@id) == "") { mes .@npc$; mes "Invalid id number"; close; } mes .@npc$; mes "So, you want to delete " +getitemname(.@id)+ "?"; next; if (select("- Yes:- No") - 1) close; mes .@npc$; mes "Processssinnggg..."; next; query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `inventory` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'"); mes .@npc$; mes "Done!"; close; } 2 Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 28, 2013 Error can click NPc idk why Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 28, 2013 Error can click NPc idk why Show your error Edited the previous post. Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 28, 2013 You try this at your server and working? Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 28, 2013 You try this at your server and working? Yeap tried and working. Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 28, 2013 Ty Ty done done my problem is I didn't reloadscript hehehe Question if my players have 102 Yggdrasil will be deleted all? Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 28, 2013 Ty Ty done done my problem is I didn't reloadscript hehehe Question if my players have 102 Yggdrasil will be deleted all? Yes Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 28, 2013 ty ty look not working Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 28, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 28, 2013 ty ty look not working Check if there's an error. eAthena? Any error? Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 28, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 28, 2013 rathena Quote Link to comment Share on other sites More sharing options...
Capuche Posted April 28, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted April 28, 2013 You can't delete an item in the inventory of player online by sql prontera,150,145,0 script Delete 100,{ set .@GMLevel,99; set .@npc$,strnpcinfo(1); if (getgmlevel() < .@GMLevel) close; mes .@npc$; mes "Input the item id"; next; input .@id; next; if (getitemname(.@id) == "") { mes .@npc$; mes "Invalid id number"; close; } mes .@npc$; mes "So, you want to delete " +getitemname(.@id)+ "?"; next; if (select("- Yes:- No") - 1) close; mes .@npc$; mes "Processssinnggg..."; next; .@self = getcharid(3); query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE i FROM `inventory` i left join `char` c on c.`char_id` = i.`char_id` WHERE i.`nameid` = '501' and c.`online` = '0'"); query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'"); do { .@size = query_sql( "select `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ .@loop +", 128", .@account_id ); .@loop += 128; for ( .@i = 0; .@i < .@size; .@i += 1 ) { attachrid .@account_id[.@i]; delitem .@id, countitem( .@id ); } } while( .@size > 0 ); attachrid .@self; mes .@npc$; mes "Done!"; close; } Storage etc.. will be update after the player log out log in Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 29, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 29, 2013 Ya forgot to say you need to log out before this it took effect Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted April 29, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Share Posted April 29, 2013 how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 29, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 14 hours ago Share Posted April 29, 2013 how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process Off topic. Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted April 29, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Share Posted April 29, 2013 how about kick everyone from the server who has the items you are deleting first before proceeding to deletion process Off topic. lol how did that became off topic? what i mean is = check first the players and kick them before you go the deleting process of item in the script posted by capuche which is since as capuche said: You can't delete an item in the inventory of player online by sql You can't delete an item in the inventory of player online by sql prontera,150,145,0 script Delete 100,{ set .@GMLevel,99; set .@npc$,strnpcinfo(1); if (getgmlevel() < .@GMLevel) close; mes .@npc$; mes "Input the item id"; next; input .@id; next; if (getitemname(.@id) == "") { mes .@npc$; mes "Invalid id number"; close; } mes .@npc$; mes "So, you want to delete " +getitemname(.@id)+ "?"; next; if (select("- Yes:- No") - 1) close; mes .@npc$; mes "Processssinnggg..."; next; .@self = getcharid(3); query_sql("DELETE FROM `auction` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `cart_inventory` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `guild_storage` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE i FROM `inventory` i left join `char` c on c.`char_id` = i.`char_id` WHERE i.`nameid` = '501' and c.`online` = '0'"); query_sql("DELETE FROM `mail` WHERE `nameid` = '" +.@id+ "'"); query_sql("DELETE FROM `storage` WHERE `nameid` = '" +.@id+ "'"); do { .@size = query_sql( "select `account_id` from `char` where `online` = '1' order by `account_id` desc limit "+ .@loop +", 128", .@account_id ); .@loop += 128; for ( .@i = 0; .@i < .@size; .@i += 1 ) { attachrid .@account_id[.@i]; delitem .@id, countitem( .@id ); } } while( .@size > 0 ); attachrid .@self; mes .@npc$; mes "Done!"; close; } Storage etc.. will be update after the player log out log in 1 Quote Link to comment Share on other sites More sharing options...
Help-Help Posted April 29, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted April 29, 2013 So no effect NPc hahahaha ha I want no need log out etc Quote Link to comment Share on other sites More sharing options...
Capuche Posted April 29, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted April 29, 2013 I already made the change to delete items in the inventory of online players in the previous post (forgot to tell this) Quote Link to comment Share on other sites More sharing options...
Help-Help Posted May 7, 2013 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 108 Reputation: 2 Joined: 03/16/13 Last Seen: August 9, 2015 Author Share Posted May 7, 2013 can you make this eathena version too? Quote Link to comment Share on other sites More sharing options...
Question
Help-Help
NPc only for admin that can delete item for all account
Example I want to delete gold coins if my players have that just type in NPc the Id of item enter and the item will disappear
Link to comment
Share on other sites
18 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.