Jump to content

Animation


Ujeelka

Recommended Posts

Hello! I cant find on wiki how can i add a player animation. I do not know where to start. I want to sit down on a bench when i type /sit ( which is the animation to sit on bench ?).

function ??????
setPlayerAnimation -- This code is for animation ??
  setPlayerAnimation( player, "player", "WOMAN_idle")
end
addCommandHandler("sit", ??????)

Link to comment
Many peds functions can be used on players. Try this:
function makePlayerSitDown(player,cmdname)
setPedAnimation(player,"ped","SEAT_idle",-1,true,false,true)
end
addCommandHandler("sit",makePlayerSitDown)

Thank you very much for help !

Now i try to add a command to stopAnimation...i think...

Link to comment

ok... i make this for stop animation...i think its good (i want to stop animation when i type /stop)

function makePlayerSitDown(player,cmdname)
setPedAnimation(player,"ped","SEAT_idle",-1,true,false,true)
end
addCommandHandler("sit",makePlayerSitDown)
 
function stopAnimation(player,cmdname)
addCommandHandler("stop",stopAnimation)

Link to comment
  • 8 years later...

I should have a robbery script in a robbery animation (cat_safe_rob) if someone could help the whole script here, and if anyone knows where and what to write, to take a robbery animation for a few seconds, you can paste it for me. :D Thanks in advance.

Script:

function createRob()
    Marker = createMarker ( 1788.9731445313,-1123.0570068359,23.5, "cylinder", 1, 255, 0, 0, 5 )
    setElementCollisionsEnabled( Marker, false )
    bl = createBlipAttachedTo(Marker,45)
    outputChatBox( "", root, 0, 255, 0 )
end
addEventHandler("onResourceStart", resourceRoot,createRob)
 
addEventHandler("onMarkerLeave",root,
function ( player )
    if ( source ~= Marker ) then
        return
    end
    if ( isPedInVehicle( player ) ) then
        return
    end
        destroyElement( Marker )
        destroyElement( bl )
        randomMoney = math.random ( 22000, 22000 )
        randomWanted = math.random ( 5, 5 )
        givePlayerMoney(player,randomMoney)
        setPlayerWantedLevel ( player, randomWanted )
        robPlayer = getPlayerName(player)
        outputChatBox("",root,0,255,0,true)
        setTimer( createRob, 600000, 1 )
    end
)
 

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