From ca033ae2d7cb1728b236d246f8dd54bc9836e839 Mon Sep 17 00:00:00 2001 From: Kuzkay <31634013+Kuzkay@users.noreply.github.com> Date: Mon, 30 Dec 2019 19:57:39 +0100 Subject: [PATCH] Fixed issue where players with symbols in their names would crash the mariadb plugin --- OKAYY Framework Basic/kuz_Essentials/profile/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OKAYY Framework Basic/kuz_Essentials/profile/main.lua b/OKAYY Framework Basic/kuz_Essentials/profile/main.lua index ef1d481..7a3d71f 100644 --- a/OKAYY Framework Basic/kuz_Essentials/profile/main.lua +++ b/OKAYY Framework Basic/kuz_Essentials/profile/main.lua @@ -213,11 +213,12 @@ function CreateProfile(player) - + local fullName = GetPlayerName(player) + local name = fullName:gsub( "%W", "" ) print("creating") local query = mariadb_prepare(sql, "INSERT INTO `profiles` (`steamid`, `name`, `money`, `bank`, `level`, `experience`, `position`, `inventory`, `role`, `job`, `donator`) VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?');", tostring(GetPlayerSteamId(player)), - GetPlayerName(player), + fullName, Config.StartMoney, Config.StartBank, 1, @@ -299,4 +300,4 @@ function OnPlayerQuit(player) loaded[player] = false end) end -AddEvent("OnPlayerQuit", OnPlayerQuit) \ No newline at end of file +AddEvent("OnPlayerQuit", OnPlayerQuit)