From 83c173d28418b8d951769abdb53b6f8a1c257dca Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Sat, 22 Dec 2018 18:16:49 -0200
Subject: Helper funcion: DelAccRegFromEveryPlayer( KEY )

---
 npc/commands/event.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'npc/commands')

diff --git a/npc/commands/event.txt b/npc/commands/event.txt
index 9113fac8a..44a00192a 100644
--- a/npc/commands/event.txt
+++ b/npc/commands/event.txt
@@ -14,6 +14,18 @@ function	script	DelItemFromEveryPlayer	{
     return;
 }
 
+// Delete an acc_reg entry from all players. Full arrays only. Affect num and str db.
+// WARNING, irreversible and dangerous!
+// DelAccRegFromEveryPlayer( KEY )
+function	script	DelAccRegFromEveryPlayer	{
+    if (getarg(0, -1) < 0)
+        return;
+
+    query_sql("DELETE FROM `acc_reg_num_db` WHERE `key`="+getarg(0));
+    query_sql("DELETE FROM `acc_reg_str_db` WHERE `key`="+getarg(0));
+    return;
+}
+
 // Christmas cannot be on GlobalEventMenu because it affects seasons system
 function	script	sChristmas	{
         // Add Christmas drops
-- 
cgit v1.2.3-70-g09d2