From fafc1246975e4e7306a6a1ff3adf10e9e77cc3af Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 6 Nov 2019 16:00:33 -0300 Subject: DelItemFromEveryPlayer can now be cast during script runtime; Not only at startup --- npc/functions/util.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'npc/functions/util.txt') diff --git a/npc/functions/util.txt b/npc/functions/util.txt index 725c1723e..1190714e7 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -18,6 +18,16 @@ function script DelItemFromEveryPlayer { query_sql("DELETE FROM `guild_storage` WHERE `nameid`="+getarg(0)); query_sql("DELETE FROM `rodex_items` WHERE `nameid`="+getarg(0)); query_sql("DELETE FROM `auction` WHERE `nameid`="+getarg(0)); + debugmes "Deleting item %d", getarg(0); + + // Del items which SQL can't reach + .@c = getunits(BL_PC, .@players, MAX_CYCLE_PC); + for (.@i = 0; .@i < .@c; .@i++) { + .@am=countitem(getarg(0), .@players[.@i]); + if (.@am) debugmes "DELETE %d items from ACC %d", .@am, .@players[.@i]; + if (.@am) + delitem(getarg(0), .@am, .@players[.@i]); + } return; } -- cgit v1.2.3-70-g09d2