mta-resources/[insanity]/insanity-animdisabler/client.lua
2022-08-08 16:34:58 +02:00

37 lines
950 B
Lua

local disableAnims = {
{"ped","CLIMB_Stand_finish"},
{"ped","FALL_land"},
{"ped","Fight2Idle"},
{"ped","JUMP_land"},
{"ped","Player_Sneak_walkstart"},
{"ped","Run_stop"},
{"ped","Run_stopR"},
{"ped","WALK_start"},
{"ped","WALK_start_armed"},
{"ped","WALK_start_csaw"},
{"ped","WALK_start_rocket"},
{"ped","JUMP_launch"},
{"ped","JUMP_launch_R"}
}
local ifp = engineLoadIFP("CAR_dead_RHS.ifp","insanity.animdisabler")
function applyAnims(ped)
for _,anim in pairs(disableAnims) do
engineReplaceAnimation(ped,anim[1],anim[2],"insanity.animdisabler","CAR_dead_RHS")
end
end
addEventHandler("onClientPlayerSpawn",root,function()
applyAnims(source)
end)
for _,player in pairs(getElementsByType("player")) do
applyAnims(player)
end
addEventHandler("onClientPreRender",root,function()
for _,player in pairs(getElementsByType("player")) do
setPedAnimationSpeed(player,"CAR_dead_RHS",10)
end
end)