Jump to content

How to make animation for player?


Recommended Posts

I want to make animation for player, who will seat on Moto

function getPedAnimation(ped, thePed) -- The Command Function 
    if thePlayer then -- If a player name entered then 
        thePlayerToCopyFrom = addHelmetOnEnter -- get player from his name 
        CLO_Pose_Hat, Anim = getPedAnimation(thePlayerToCopyFrom) -- get the player animation 
        if CLO_Pose_Hat then -- if got the animation successfully then 
            setPedAnimation(localPlayer, CLO_Pose_Hat, Anim) -- set my animation the same 
            outputChatBox("* Copied Successfully !") -- output chat message 
        end 
    else     
        outputChatBox("* Please Enter a Player Name To Copy From !") -- if you didnt entered a player name , then output a chat box message 
    end 
end 
addCommandHandler("copyanim", CopyAnimation) --  adding the Command Handler 
addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) --add an event handler for onVehicleStartEnter 
function addHelmetOnEnter ( thePlayer, seat, jacked ) 
    if ( getElementModel ( source ) == 522 ) then -- if its a nrg 
        addPedClothes ( thePlayer, "moto", "moto", 16 ) -- add the helmet 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), addHelmetOnEnter ) 
  
function removeHelmetOnExit ( thePlayer, seat, jacked ) 
    if ( getElementModel ( source ) == 522 ) then -- if its a nrg 
        removePedClothes ( thePlayer, 16 ) -- remove the helmet 
    end 
end 
addEventHandler ( "onVehicleExit", getRootElement(), removeHelmetOnExit ) 

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...