working no foot animations in mp

This commit is contained in:
Pao
2023-02-09 22:13:51 +01:00
parent 21af15ed0e
commit 65ca3d285e
3 changed files with 11 additions and 25 deletions

View File

@@ -1,23 +1,17 @@
-- Thanks to Glytcher and Matías N. Salas for helping out with this
function SetMissingFootAnimation(check)
local player = getPlayer()
player:setVariable("IsCrawling", tostring(check))
if check then
player:setVariable("IsCrawling", "true")
if not isServer() and not isClient() then
print("SP, so it's fine")
else
player:setVariable("IsCrawling", "false")
end
-- if isClient() then
-- sendClientCommand("TOC", "SetCrawlAnimation", {})
-- end
sendClientCommand(player, "TOC", "NotifyNewCrawlAnimation", {id = player:getOnlineID(), check = check})
end
end

View File

@@ -129,16 +129,10 @@ end
-- Used to propagate animation changes after amputating a foot
ServerCommands["SetCrawlAnimation"] = function(args)
local source = getPlayer()
local player = getPlayerByOnlineID(args.id)
local check = args.check
if source ~= player then
if args.hasInjury then
player:setVariable('SetCrawlAnimation', 'true');
else
player:setVariable('SetCrawlAnimation', 'false');
end
end
player:setVariable('IsCrawling', tostring(check))
end

View File

@@ -27,11 +27,9 @@ end
-------- ANIMATIONS
TOC_Commands["SetCrawlAnimation"] = function(player, args)
TOC_Commands["NotifyNewCrawlAnimation"] = function(player, args)
local player_id = player:getOnlineID()
sendServerCommand(player, "TOC", "SetCrawlAnimation", {})
sendServerCommand("TOC", "SetCrawlAnimation", {id = args.id, check = args.check})
end