Jump to content

Change anim


WASSIm.

Recommended Posts

Hi guys, How to change colt45 anim like deagle ? I make this code but nothing work

 

local animations = {
	["colt45_crouchfire"] = "python_crouchfire", 
	["colt45_fire"] = "python_fire", 
	["colt45_reload"] = "python_reload"
}



function loadMod(path, model)
	local ifp = engineLoadIFP(path, model)
	if (ifp) then
	    for _, player in ipairs(getElementsByType("player")) do
            for animOld, anim in ipairs(animations) do 
	            engineReplaceAnimation(player, model, animOld, model, anim) 
            end
	    end
	    for _, ped in ipairs(getElementsByType("ped")) do
            for animOld, anim in ipairs(animations) do 
	            engineReplaceAnimation(ped, model, animOld, model, anim) 
            end
	    end
	end
end

loadMod("file/colt45.ifp", "colt45")

 

Link to comment
  • 9 months later...
Hello Wassim,
I guess you can just try this feature :

function change_animation()
    local value = getWeaponProperty(desert_eagle, "poor", "anim_loop_start");
    setWeaponProperty (colt_45, poor, anim_loop_start, value);
end;

addEventHandler ("onResourceStart", getRootElement(), change_animation);

 

I'm not sure it works but give it a try, it may help you.

If it worked don't forget to repeat the process with rest of weapon levels ( std, pro ).

Edited by CouldnoT
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...