maybe fixed some issues in mp, need to check

This commit is contained in:
Jonny_Bro (Nikita) 2023-09-08 22:45:59 +05:00
parent 0347a6f6e8
commit 01a45fccde
5 changed files with 50 additions and 11 deletions

View file

@ -10,11 +10,14 @@ BodyAnimString = "nil"
BodyAnimMDLString = "nil" BodyAnimMDLString = "nil"
BodyAnimSpeed = 1 BodyAnimSpeed = 1
bodyanimlastattachang = Angle(0, 0, 0) bodyanimlastattachang = Angle(0, 0, 0)
followplayer = true followplayer = true
deleteonend = true deleteonend = true
lockang = false lockang = false
CamAddAng = false CamAddAng = false
CamIgnoreAng = false CamIgnoreAng = false
-- local BodyAnimPos = Vector(0, 0, 0) -- local BodyAnimPos = Vector(0, 0, 0)
-- local BodyAnimAngLerp = Angle(0, 0, 0) -- local BodyAnimAngLerp = Angle(0, 0, 0)
-- local DidDraw = false -- local DidDraw = false
@ -24,29 +27,38 @@ local savedeyeangb = Angle(0, 0, 0)
-- local bodylockview = false -- local bodylockview = false
-- local bodyanimdone = false -- local bodyanimdone = false
-- local holstertime = 0 -- local holstertime = 0
local animmodelstring = "" local animmodelstring = ""
local showweapon = false local showweapon = false
local showvm = false local showvm = false
local usefullbody = false local usefullbody = false
local ignorez = false local ignorez = false
local customcycle = false local customcycle = false
deathanim = false deathanim = false
local allowmove = false local allowmove = false
local allowedangchange = false local allowedangchange = false
local attach, attachId, weapontoidle = nil, nil, nil local attach, attachId, weapontoidle = nil, nil, nil
local smoothend = false local smoothend = false
local endlerp = 0 local endlerp = 0
camoffset = Vector() camoffset = Vector()
camjoint = "eyes" camjoint = "eyes"
BodyAnimCrouchLerp = 1 BodyAnimCrouchLerp = 1
BodyAnimCrouchLerpZ = 0 BodyAnimCrouchLerpZ = 0
BodyAnimLimitEase = false BodyAnimLimitEase = false
CamShake = false CamShake = false
CamShakeAng = Angle() CamShakeAng = Angle()
CamShakeMult = 1 CamShakeMult = 1
local lastangy = 0 local lastangy = 0
viewtiltlerp = Angle() viewtiltlerp = Angle()
ViewTiltAngle = Angle() ViewTiltAngle = Angle()
local BodyAnimStartPos = Vector() local BodyAnimStartPos = Vector()
local view = {} local view = {}
local justremoved = false local justremoved = false
@ -696,8 +708,6 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
end end
hook.Add("CreateMove", "BodyLimitMove", function(cmd) hook.Add("CreateMove", "BodyLimitMove", function(cmd)
-- local ply = LocalPlayer()
if IsValid(BodyAnimMDL) and not allowmove then if IsValid(BodyAnimMDL) and not allowmove then
cmd:ClearButtons() cmd:ClearButtons()
cmd:ClearMovement() cmd:ClearMovement()

View file

@ -914,7 +914,6 @@ fbfunctions = {
local defaultcamoffset = Vector() local defaultcamoffset = Vector()
local playermodelbones = {"ValveBiped.Bip01_L_UpperArm", "ValveBiped.Bip01_R_UpperArm"} local playermodelbones = {"ValveBiped.Bip01_L_UpperArm", "ValveBiped.Bip01_R_UpperArm"}
local fingers = {"ValveBiped.Bip01_L_Finger4", "ValveBiped.Bip01_L_Finger41", "ValveBiped.Bip01_L_Finger3", "ValveBiped.Bip01_L_Finger31", "ValveBiped.Bip01_L_Finger2", "ValveBiped.Bip01_L_Finger21", "ValveBiped.Bip01_L_Finger1", "ValveBiped.Bip01_L_Finger11", "ValveBiped.Bip01_R_Finger4", "ValveBiped.Bip01_R_Finger41", "ValveBiped.Bip01_R_Finger3", "ValveBiped.Bip01_R_Finger31", "ValveBiped.Bip01_R_Finger2", "ValveBiped.Bip01_R_Finger21", "ValveBiped.Bip01_R_Finger1", "ValveBiped.Bip01_R_Finger11"} local fingers = {"ValveBiped.Bip01_L_Finger4", "ValveBiped.Bip01_L_Finger41", "ValveBiped.Bip01_L_Finger3", "ValveBiped.Bip01_L_Finger31", "ValveBiped.Bip01_L_Finger2", "ValveBiped.Bip01_L_Finger21", "ValveBiped.Bip01_L_Finger1", "ValveBiped.Bip01_L_Finger11", "ValveBiped.Bip01_R_Finger4", "ValveBiped.Bip01_R_Finger41", "ValveBiped.Bip01_R_Finger3", "ValveBiped.Bip01_R_Finger31", "ValveBiped.Bip01_R_Finger2", "ValveBiped.Bip01_R_Finger21", "ValveBiped.Bip01_R_Finger1", "ValveBiped.Bip01_R_Finger11"}
local fingerscustom = { local fingerscustom = {
@ -1011,7 +1010,6 @@ eventsounds = {
} }
local CharaName = "Faith" local CharaName = "Faith"
local CharaLen = #CharaName
local function BodyEventSounds(anim) local function BodyEventSounds(anim)
local tbl = eventsounds[anim] local tbl = eventsounds[anim]
@ -1022,7 +1020,7 @@ local function BodyEventSounds(anim)
for k, v in pairs(tbl) do for k, v in pairs(tbl) do
local func = nil local func = nil
if v:Left(CharaLen) == CharaName then if v:Left(#CharaName) == CharaName then
func = ply.FaithVO func = ply.FaithVO
else else
func = ply.EmitSound func = ply.EmitSound

View file

@ -271,7 +271,12 @@ hook.Add("PostDrawTranslucentRenderables", "GrappleBeam", function()
render.DrawBeam(LerpVector(ropelerp, lhandpos - ropedown, rhandpos), lhandpos, 1.5, 0, 1) render.DrawBeam(LerpVector(ropelerp, lhandpos - ropedown, rhandpos), lhandpos, 1.5, 0, 1)
render.DrawBeam(ropetop, lp:GetGrapplePos(), 1.5, 0, 1) render.DrawBeam(ropetop, lp:GetGrapplePos(), 1.5, 0, 1)
BodyAnim:SetSequence("grapplecenter") -- BodyAnim:SetSequence("grapplecenter")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("grapplecenter")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('grapplecenter')")
end
ropelerp = math.Approach(ropelerp, 1, FrameTime() * 2) ropelerp = math.Approach(ropelerp, 1, FrameTime() * 2)
else else

View file

@ -9,7 +9,13 @@ function DoJumpTurn(lookbehind)
VMLegs:Remove() VMLegs:Remove()
end end
BodyAnim:SetSequence("jumpturnfly") -- BodyAnim:SetSequence("jumpturnfly")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("jumpturnfly")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('jumpturnfly')")
end
BodyAnimCycle = 0 BodyAnimCycle = 0
BodyAnimSpeed = 1 BodyAnimSpeed = 1
BodyLimitX = 40 BodyLimitX = 40
@ -39,9 +45,19 @@ function DoJumpTurnStand()
local activewep = LocalPlayer():GetActiveWeapon() local activewep = LocalPlayer():GetActiveWeapon()
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
BodyAnim:SetSequence("jumpturnlandstandgun") -- BodyAnim:SetSequence("jumpturnlandstandgun")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("jumpturnlandstandgun")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('jumpturnlandstandgun')")
end
else else
BodyAnim:SetSequence("jumpturnlandstand") -- BodyAnim:SetSequence("jumpturnlandstand")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("jumpturnlandstand")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('jumpturnlandstand')")
end
ParkourEvent("jumpturnlandstand", LocalPlayer(), game.SinglePlayer()) ParkourEvent("jumpturnlandstand", LocalPlayer(), game.SinglePlayer())
end end

View file

@ -17,9 +17,19 @@ local function Hardland(jt)
end end
DoJumpTurn(jt) DoJumpTurn(jt)
BodyAnim:SetSequence("jumpturnflyidle") -- BodyAnim:SetSequence("jumpturnflyidle")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("jumpturnflyidle")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('jumpturnflyidle')")
end
else else
BodyAnim:SetSequence("jumpcoilend") -- BodyAnim:SetSequence("jumpcoilend")
if CLIENT and IsFirstTimePredicted() then
BodyAnim:SetSequence("jumpcoilend")
elseif game.SinglePlayer() then
ply:SendLua("BodyAnim:SetSequence('jumpcoilend')")
end
end end
end end
end end