From 9b7d966c14d55f7006e751af5e4c7dedc851cb2f Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 8 May 2022 23:44:56 -0300 Subject: Modernize a couple other SQL statements --- npc/001-8/hub.txt | 7 ++++++- npc/commands/super-menu.txt | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'npc') 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: -- cgit v1.2.3-70-g09d2