aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/database/sv_setup.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/database/sv_setup.lua')
-rw-r--r--gamemode/core/database/sv_setup.lua7
1 files changed, 6 insertions, 1 deletions
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)