From 522cdfc0e24b45cf02d8c22cef85fa32408f1376 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 21 Aug 2017 20:43:26 -0400 Subject: Fixed a bug with server teleporters Server teleports were not saveing to the database in the right format --- gamemode/core/database/sv_setup.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gamemode/core/database') diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua index 6a7548d..6676735 100644 --- a/gamemode/core/database/sv_setup.lua +++ b/gamemode/core/database/sv_setup.lua @@ -67,7 +67,10 @@ function sql.GetPlayerData(ply) ply:ConCommand("connect " .. mtbl.lastserver) return end - ply:SetPos(mtbl.lastlocation) + local _,_,x,y,z = string.find(mtbl.lastlocation,"([-%d%.]+) ([-%d%.]+) ([-%d%.]+)") + local vec = {x,y,z} + for k,v in pairs(vec) do vec[k] = tonumber(v) end + ply:SetPos(Vector(unpack(vec))) q.deserialize_player(ply,plyd) end end @@ -88,6 +91,8 @@ function sql.CreatePlayerTable(ply) local plymet = data.newmeta() local plydata = util.TableToJSON(plytbl) local metdata = util.TableToJSON(plymet) + print("plydata", plydata) + print("metdata", metdata) local q_str = q.s_fmt(create_player_query,s64,plydata,metdata) local q_suc = function(res,li) --print("Inserted new player",ply) -- cgit v1.2.3-70-g09d2