diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-05-07 13:47:40 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-05-07 13:47:40 -0400 |
| commit | 9e0537b0aa417e88a6a61238484ddcef74080ae0 (patch) | |
| tree | e2bd590ec3de41d384aa5f6206b14e1a73647846 /gamemode/core/database | |
| parent | 191ba416c8b611ea4901cead138789a357c56134 (diff) | |
| download | artery-9e0537b0aa417e88a6a61238484ddcef74080ae0.tar.gz artery-9e0537b0aa417e88a6a61238484ddcef74080ae0.tar.bz2 artery-9e0537b0aa417e88a6a61238484ddcef74080ae0.zip | |
Added tons of stuff
Diffstat (limited to 'gamemode/core/database')
| -rw-r--r-- | gamemode/core/database/sv_setup.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gamemode/core/database/sv_setup.lua b/gamemode/core/database/sv_setup.lua index 2fb7ed7..2cb69d1 100644 --- a/gamemode/core/database/sv_setup.lua +++ b/gamemode/core/database/sv_setup.lua @@ -34,13 +34,18 @@ local function connect() MySQLite.initialize(config) end hook.Add("DatabaseInitialized","setup_table",function() + assert(MySQLite.isMySQL(),"Database wasn't mysqloo, something is probably wrong!") local setup_success = function(res,li) print("Set up connection to db") end print("Setup query:",setup_db) MySQLite.query(setup_db,setup_success,q_fai) end) -connect() + +hook.Add("Initialize","initalizedbconnection",function() + connect() +end) + --Retruns (PlayerData, MetaData) or nil function sql.GetPlayerData(ply) @@ -65,7 +70,7 @@ function sql.GetPlayerData(ply) return end print("We were on the right server") - --[[ + print("Before finding data in the metatable, mtbl was ") PrintTable(mtbl) print(type(mtbl.lastlocation)) @@ -74,8 +79,8 @@ function sql.GetPlayerData(ply) for k,v in pairs(vec) do vec[k] = tonumber(v) end print("setting player pos to") PrintTable(vec) - ]] - ply:SetPos(mtbl.lastlocation) + + ply:SetPos(Vector(unpack(vec))) q.deserialize_player(ply,plyd) end end |
