Some more stuff, included body locations
This commit is contained in:
76
media/lua/server/JCIO_ClientCommands.lua
Normal file
76
media/lua/server/JCIO_ClientCommands.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
|
||||
|
||||
local ClientCommands = {}
|
||||
|
||||
|
||||
-- Main handler of base functions for TOC, not changed till now 'cause it works
|
||||
ClientCommands.SendServer = function(player, arg)
|
||||
local otherPlayer = getPlayerByOnlineID(arg["To"])
|
||||
sendServerCommand(otherPlayer, "JCIO", arg["command"], arg)
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- Cutting Limbs
|
||||
ClientCommands.AskDamageOtherPlayer = function(_, arg)
|
||||
|
||||
local patient = getPlayerByOnlineID(arg[1])
|
||||
local patient_id = arg[1]
|
||||
local part_name = arg[2]
|
||||
|
||||
sendServerCommand(patient, "JCIO", "AcceptDamageOtherPlayer", {patient_id, part_name})
|
||||
|
||||
end
|
||||
|
||||
ClientCommands.AskStopAmputationSound = function(_, args)
|
||||
|
||||
print("JCIO: We're in AskStopAmputationSound")
|
||||
sendServerCommand("JCIO", "StopAmputationSound", {surgeon_id = args.surgeon_id})
|
||||
|
||||
|
||||
end
|
||||
|
||||
-- Animations
|
||||
ClientCommands.NotifyNewCrawlAnimation = function(player, args)
|
||||
|
||||
sendServerCommand("JCIO", "SetCrawlAnimation", {id = args.id, check = args.check})
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- Cheats
|
||||
ClientCommands.AskToResetEverything = function(_, arg)
|
||||
local clicked_player = getPlayerByOnlineID(arg[1])
|
||||
sendServerCommand(clicked_player, "JCIO", "ResetEverything", {})
|
||||
end
|
||||
|
||||
|
||||
-- Global Mod Data data handler
|
||||
ClientCommands.ChangePlayerState = function(playerObj, args)
|
||||
ModData.get("JCIO_PLAYER_DATA")[playerObj:getUsername()] = args
|
||||
ModData.transmit("JCIO_PLAYER_DATA")
|
||||
end
|
||||
|
||||
|
||||
------ Global Mod Data -----------
|
||||
|
||||
function TOC_OnInitGlobalModData()
|
||||
ModData.getOrCreate("JCIO_PLAYER_DATA")
|
||||
end
|
||||
|
||||
Events.OnInitGlobalModData.Add(TOC_OnInitGlobalModData)
|
||||
|
||||
|
||||
------------------------------------------------------
|
||||
|
||||
local function OnClientCommand(module, command, playerObj, args)
|
||||
if module == 'TOC' and ClientCommands[command] then
|
||||
ClientCommands[command](playerObj, args)
|
||||
end
|
||||
end
|
||||
|
||||
Events.OnClientCommand.Add(OnClientCommand)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user