Skip to content

Commit

Permalink
Fixed issue where players with symbols in their names would crash the…
Browse files Browse the repository at this point in the history
… mariadb plugin
  • Loading branch information
Kuzkay authored Dec 30, 2019
1 parent d62dd5c commit ca033ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OKAYY Framework Basic/kuz_Essentials/profile/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -299,4 +300,4 @@ function OnPlayerQuit(player)
loaded[player] = false
end)
end
AddEvent("OnPlayerQuit", OnPlayerQuit)
AddEvent("OnPlayerQuit", OnPlayerQuit)

0 comments on commit ca033ae

Please sign in to comment.