summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-11-06 16:00:33 -0300
committerJesusaves <cpntb1@ymail.com>2019-11-06 16:00:33 -0300
commitfafc1246975e4e7306a6a1ff3adf10e9e77cc3af (patch)
tree32b5efbd178ee5385d32755afe89bd73de109b71 /npc/functions
parentd9d28a53089937750969b20635bcd042aea1f066 (diff)
downloadserverdata-fafc1246975e4e7306a6a1ff3adf10e9e77cc3af.tar.gz
serverdata-fafc1246975e4e7306a6a1ff3adf10e9e77cc3af.tar.bz2
serverdata-fafc1246975e4e7306a6a1ff3adf10e9e77cc3af.tar.xz
serverdata-fafc1246975e4e7306a6a1ff3adf10e9e77cc3af.zip
DelItemFromEveryPlayer can now be cast during script runtime; Not only at startup
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/util.txt10
1 files changed, 10 insertions, 0 deletions
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;
}