CursorX Posted February 5, 2014 Posted February 5, 2014 may i request a query to delete the item 7179 from their inventory,cart,storage and guild storage thank you... Quote
Missingno Posted February 23, 2014 Posted February 23, 2014 You could just add OR to the query to add an additional item, or you could create a script-based query to delete an array of items; here is the former: DELETE FROM `inventory` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `cart_inventory` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `storage` WHERE `id` = '7179' OR `id` = '909'; DELETE FROM `guild_storage` WHERE `id` = '7179' OR `id` = '909'; You can load this script and it will (in theory) automatically delete all the items from the array .@item_id from player inventories and storages, regardless of whether or not they are online; this is untested: - script delete_all -1,{ OnInit: // List of item IDs to delete setarray .@item_id[0], 909, 910, 911; // Build list of account IDs query_sql "SELECT `account_id` FROM `login`", .@account_id; // Loop for each account for (.@i = 0; .@i < getarraysize(.@account_id); .@i++) { // Loop for each item for (.@j = 0; .@j < getarraysize(.@item_id); .@j++) { // Check if account is logged in if (isloggedin(.@account_id[.@i])) { // Delete items from online player inventory attachrid .@account_id[.@i]; delitem .@item_id[.@j], countitem(.@item_id[.@j]); detachrid; } } } // Loop for each item for (.@i = .@j = 0; .@i < getarraysize(.@item_id); .@i++) { // Delete items from all inventories/storages query_sql "DELETE FROM `inventory` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `cart_inventory` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `storage` WHERE `id` = '"+ .@item_id[.@i] +"'"; query_sql "DELETE FROM `guild_storage` WHERE `id` = '"+ .@item_id[.@i] +"'"; // Build list of item names .@item_name$[.@j++] = getitemname(.@item_id[.@i]); } // Announce deleted items announce "The following items have been deleted: "+ implode(.@item_name$, ", "), bc_all; end; } 1 Quote
Missingno Posted February 5, 2014 Posted February 5, 2014 Run an SQL query for each table: DELETE FROM `inventory` WHERE `id` = '7179'; DELETE FROM `cart_inventory` WHERE `id` = '7179'; DELETE FROM `storage` WHERE `id` = '7179'; DELETE FROM `guild_storage` WHERE `id` = '7179'; 1 Quote
CursorX Posted February 23, 2014 Author Posted February 23, 2014 Run an SQL query for each table: DELETE FROM `inventory` WHERE `id` = '7179'; DELETE FROM `cart_inventory` WHERE `id` = '7179'; DELETE FROM `storage` WHERE `id` = '7179'; DELETE FROM `guild_storage` WHERE `id` = '7179'; hi.. how about i will delete two item what shud i add? and what query if i want to delete item that is equipped Quote
CursorX Posted February 23, 2014 Author Posted February 23, 2014 what if the player equipped that item? Quote
Missingno Posted February 23, 2014 Posted February 23, 2014 what if the player equipped that item? It's still in their inventory even when equipped, so it would similarly get deleted. Quote
Capuche Posted February 24, 2014 Posted February 24, 2014 The item id is in `nameid` not in `id` prontera,150,150,5 script iuniono 488,{ if ( getgmlevel() < 99 ) end; mes "item id to delete?"; input .item_id; close2; query_sql "DELETE FROM `inventory` WHERE `nameid` = '"+ .item_id +"'"; query_sql "DELETE FROM `cart_inventory` WHERE `nameid` = '"+ .item_id +"'"; query_sql "DELETE FROM `storage` WHERE `nameid` = '"+ .item_id +"'"; query_sql "DELETE FROM `guild_storage` WHERE `nameid` = '"+ .item_id +"'"; addrid 0; delitem .item_id, countitem( .item_id ); end; } 2 Quote
Question
CursorX
may i request a query to delete the item 7179 from their inventory,cart,storage and guild storage
thank you...
7 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.