From 5e6e88f98300d4c3d41aad7cff5346539f4f9f66 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 21 Aug 2017 17:52:42 -0400 Subject: Fixed loading bug Fixed a bug where the equipment inventory would not load correctly. --- gamemode/core/mapstich/sv_mapstich.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gamemode/core/mapstich') diff --git a/gamemode/core/mapstich/sv_mapstich.lua b/gamemode/core/mapstich/sv_mapstich.lua index 93f8667..121c0c9 100644 --- a/gamemode/core/mapstich/sv_mapstich.lua +++ b/gamemode/core/mapstich/sv_mapstich.lua @@ -19,7 +19,7 @@ local function SavePlayerData(ply) query = q.s_fmt(query,pdat,ply:SteamID64()) else query = [[ - UPDATE playerdata SET PlayerData='%s' MetaData='%s' WHERE SteamID=%.0f + UPDATE playerdata SET PlayerData='%s', MetaData='%s' WHERE SteamID=%.0f ]] local pmet = util.TableToJSON({ lastserver = game.GetIPAddress(), @@ -36,6 +36,10 @@ local function SavePlayerData(ply) end) end +concommand.Add("artery_saveplayer",function(ply,cmd,args) + SavePlayerData(ply) +end) + net.Receive("art_zonechange",function(len,ply) timer.Simple(0.5,function() @@ -68,3 +72,7 @@ net.Receive("art_zonechange",function(len,ply) end end) end) + +hook.Add("PlayerDisconnected","save_data_on_disconnect",function(ply) + SavePlayerData(ply) +end) -- cgit v1.2.3-70-g09d2