diff --git a/media/lua/client/TOC_Client.lua b/media/lua/client/TOC_Client.lua index 9be70ef..ee555e6 100644 --- a/media/lua/client/TOC_Client.lua +++ b/media/lua/client/TOC_Client.lua @@ -7,15 +7,16 @@ local function OnTocServerCommand(module, command, args) if command == 'GivePlayerData' then --local surgeon = getPlayerByOnlineID(args[1]) - local surgeon_id = args[1] - local patient = getPlayer() + local surgeon_id = args[1] + + local patient = getPlayerByOnlineID(args[2]) local toc_data = patient:getModData().TOC -- todo maybe we cant send a table like this. Let's try something easier --local moneyAmount = playerTwo:getInventory():getCountTypeRecurse("Money") print("Giving info") - sendClientCommand(patient, "TOC", "SendPlayerData", {surgeon_id, 69}) + sendClientCommand(patient, "TOC", "SendPlayerData", {surgeon_id, toc_data}) elseif command == 'SendTocData' then print("Sending TOC data") diff --git a/media/lua/client/TOC_UI.lua b/media/lua/client/TOC_UI.lua index 52c21aa..38ae11d 100644 --- a/media/lua/client/TOC_UI.lua +++ b/media/lua/client/TOC_UI.lua @@ -632,14 +632,14 @@ function ISNewHealthPanel.onClick_TOC(button) -- button.character is patient -- button.otherPlayer is surgeon - sendClientCommand(button.otherPlayer, "TOC", "GetPlayerData", {button.otherPlayer:getOnlineID(), button.character:getOnlineID()}) -- sends 0 & 4 as arguments + sendClientCommand(button.otherPlayer, "TOC", "GetPlayerData", {button.otherPlayer:getOnlineID(), button.character:getOnlineID()}) - if MP_other_player_toc_data then - print("It works") - print(MP_other_player_toc_data) - else - print("Nopepppp") - end + -- if MP_other_player_toc_data ~= nil then + -- print("It works") + -- print(MP_other_player_toc_data) + -- else + -- print("Nopepppp") + -- end if button.character ~= button.otherPlayer then diff --git a/media/lua/server/TOC_MP_server.lua b/media/lua/server/TOC_MP_server.lua index 3d7be0d..471e219 100644 --- a/media/lua/server/TOC_MP_server.lua +++ b/media/lua/server/TOC_MP_server.lua @@ -25,10 +25,15 @@ local function OnTocClientCommand(module, command, player, args) print(command) if command == 'GetPlayerData' then + local surgeon_id = args[1] + local patient_id = args[2] + + + local playerOne = getPlayerByOnlineID(args[1]) local playerTwo = getPlayerByOnlineID(args[2]) local playerOneID = args[1] - sendServerCommand(playerTwo, "TOC", "GivePlayerData", {playerOneID}) + sendServerCommand(playerTwo, "TOC", "GivePlayerData", {surgeon_id, patient_id}) elseif command == 'SendPlayerData' then local playerOne = getPlayerByOnlineID(args[1]) local playerOneID = args[1]