Help-Help Posted April 28, 2013 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
Patskie Posted April 28, 2013 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
Patskie Posted April 28, 2013 Posted April 28, 2013 Error can click NPc idk why Show your error Edited the previous post. Quote
Help-Help Posted April 28, 2013 Author Posted April 28, 2013 You try this at your server and working? Quote
Patskie Posted April 28, 2013 Posted April 28, 2013 You try this at your server and working? Yeap tried and working. Quote
Help-Help Posted April 28, 2013 Author 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
Patskie Posted April 28, 2013 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
Patskie Posted April 28, 2013 Posted April 28, 2013 ty ty look not working Check if there's an error. eAthena? Any error? Quote
Capuche Posted April 28, 2013 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
Patskie Posted April 29, 2013 Posted April 29, 2013 Ya forgot to say you need to log out before this it took effect Quote
frenzmu06 Posted April 29, 2013 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
Patskie Posted April 29, 2013 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
frenzmu06 Posted April 29, 2013 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
Help-Help Posted April 29, 2013 Author Posted April 29, 2013 So no effect NPc hahahaha ha I want no need log out etc Quote
Capuche Posted April 29, 2013 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
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
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.