diff --git a/luascripts/admin/admin.lua b/luascripts/admin/admin.lua index 5652371..46f1310 100644 --- a/luascripts/admin/admin.lua +++ b/luascripts/admin/admin.lua @@ -52,10 +52,13 @@ function admin.onconnectattempt(clientId, firstTime, isBot) return "\n\nIt appears you do not have a ^7GUID^9/^7etkey^9. In order to play on this server, enable ^7PunkBuster ^9(use ^7\\pb_cl_enable^9) ^9and/or create an ^7etkey^9.\n\nMore info: ^7www.etkey.org" end - local playerId = db.getplayer(guid)["id"] - local ban = db.getBanByPlayer(playerId) - if ban then - return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"] + local player = db.getplayer(guid) + if player then + local playerId = player["id"] + local ban = db.getBanByPlayer(playerId) + if ban then + return "\n\nYou have been banned for "..ban["duration"].." seconds, Reason: "..ban["reason"] + end end end diff --git a/luascripts/db/sqlite3.lua b/luascripts/db/sqlite3.lua index 7355757..dce5067 100644 --- a/luascripts/db/sqlite3.lua +++ b/luascripts/db/sqlite3.lua @@ -32,7 +32,7 @@ local cur = nil -- players function sqlite3.addplayer(guid, ip) - cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."')")) + cur = assert(con:execute("INSERT INTO `player` (`guid`, `ip`, `level`) VALUES ('"..util.escape(guid).."', '"..util.escape(ip).."', 0)")) end function sqlite3.updateplayerip(guid, ip)