summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-05-08 23:44:56 -0300
committerJesusaves <cpntb1@ymail.com>2022-05-08 23:44:56 -0300
commit9b7d966c14d55f7006e751af5e4c7dedc851cb2f (patch)
tree7897c772e51ed74b23b1592fd6e91d784b5f3a9e
parentfbdcd2ee71d1aa32eedc55e17adf57a39e0974b2 (diff)
downloadserverdata-9b7d966c14d55f7006e751af5e4c7dedc851cb2f.tar.gz
serverdata-9b7d966c14d55f7006e751af5e4c7dedc851cb2f.tar.bz2
serverdata-9b7d966c14d55f7006e751af5e4c7dedc851cb2f.tar.xz
serverdata-9b7d966c14d55f7006e751af5e4c7dedc851cb2f.zip
Modernize a couple other SQL statements
-rw-r--r--npc/001-8/hub.txt7
-rw-r--r--npc/commands/super-menu.txt7
2 files changed, 12 insertions, 2 deletions
diff --git a/npc/001-8/hub.txt b/npc/001-8/hub.txt
index 414ba25ad..9ba3cf5e8 100644
--- a/npc/001-8/hub.txt
+++ b/npc/001-8/hub.txt
@@ -354,7 +354,12 @@ OnPCLogoutEvent:
if (@cartinventorylist_count>=1) {
// Obviously a cheater, you should not be using the cart on the event. I HATE CHEATERS!
// Destroy everything you had on the cart
- query_sql("DELETE FROM `cart_inventory` WHERE `char_id`="+getcharid(0));
+ if ($@HAS_API) {
+ query_sql("DELETE FROM `cart_inventory` WHERE `char_id`="+getcharid(0));
+ } else {
+ apiasync("SQL", sprintf("DELETE FROM `cart_inventory` WHERE `char_id`='%d'", getcharid(0)));
+ apiasync("SQLRUN", "");
+ }
// Destroy the cart. Cheaters doesn't deserve it!!
setcart(0);
// Delete the storage register. You now need to pay it again, to don't cheat anymore!
diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt
index 8a9cb2dd2..cf9b49c51 100644
--- a/npc/commands/super-menu.txt
+++ b/npc/commands/super-menu.txt
@@ -26,7 +26,12 @@ function script SuperMenu {
case 2: MOTDConfig 1; break;
case 3: GlobalEventMenu 1; break;
case 4:
- query_sql("UPDATE `char` SET `guild_id`=1 WHERE `char_id`="+getcharid(0));
+ if (!$@HAS_API) {
+ query_sql("UPDATE `char` SET `guild_id`=1 WHERE `char_id`="+getcharid(0));
+ } else {
+ apiasync("SQL", sprintf("UPDATE `char` SET `guild_id`=1 WHERE `char_id`='%d'", getcharid(0)));
+ apiasync("SQLRUN", "");
+ }
break;
case 5: HallOfReferral; break;
case 6: