dunno at this point

This commit is contained in:
Pao
2023-01-12 15:13:57 +01:00
parent 53a814463a
commit bf01a5dc0d
5 changed files with 206 additions and 36 deletions

View File

@@ -3,16 +3,45 @@
---Server side
local Commands = {}
-- todo what is this?
Commands["SendServer"] = function(player, arg)
local otherPlayer = getPlayerByOnlineID(arg["To"])
print("The Only Cure Command: ", arg['command'])
sendServerCommand(otherPlayer, "TOC", arg["command"], arg)
end
local function OnTocClientCommand(module, command, player, args)
if module == 'TOC' then
print(command)
if command == 'GetPlayerData' then
local playerOne = getPlayerByOnlineID(args[1])
local playerTwo = getPlayerByOnlineID(args[2])
local playerOneID = args[1]
sendServerCommand(playerTwo, "TOC", "GivePlayerData", {playerOneID})
elseif command == 'SendPlayerData' then
local playerOne = getPlayerByOnlineID(args[1])
local playerOneID = args[1]
local toc_data = args[2]
sendServerCommand(playerOne, "TOC", "SendTocData", {playerOneID, toc_data})
end
end
end
local onClientCommand = function(module, command, player, args)
if module == 'TOC' and Commands[command] then
args = args or {}
Commands[command](_, args)
end
end
Events.OnClientCommand.Add(onClientCommand)
Events.OnClientCommand.Add(OnTocClientCommand)
--Client 1 -> Server -> Client 1