Jump to content

Make a ped sit...


benwilkins

Recommended Posts

  
       giovanna = createPed(258,  2135.662109375, -1739.5107421875, 17.281345367432) 
     
    setElementInterior(giovanna, 0) 
    setElementDimension(giovanna, 0) 
    setPedFrozen(giovanna, true) 
    setPedAnimation (giovanna, "INT_OFFICE", "OFF_Sit_Idle_Loop", -1, false, false, false ) 
    setPedRotation(giovanna, 87) 
    setElementFrozen(giovanna, true) 

He spawns, but wont sit..

Link to comment
  
  
       giovanna = createPed(258,  2135.662109375, -1739.5107421875, 17.281345367432) 
    
    setElementInterior(giovanna, 0) 
    setElementDimension(giovanna, 0) 
    setPedRotation(giovanna, 87) 
    setTimer(setPedAnimation ,1000,1,giovanna, "INT_OFFICE", "OFF_Sit_Idle_Loop", -1, false, false, false ) 
  

Link to comment

It's not about spawning, it's related to streaming in or setting the syncer, as this problem (also preventing the ped from being given the weapon or getting warped into vehicle) also occurs when setPedAnimation/giveWeapon/warpPedIntoVehicle are used on ped which isn't near any player.

Link to comment
--Server side 
addEvent( "createAnim",true )  
  
giovanna = createPed( 258,  2135.662109375, -1739.5107421875, 17.281345367432 ) 
setElementData( giovanna,"anim",true ) 
--[[ 
setElementInterior( giovanna, 0 ) 
setElementDimension( giovanna, 0 ) 
]] 
-- is default 0 
setPedRotation( giovanna, 87 ) 
setElementFrozen( giovanna, true ) 
  
addEventHandler( "createAnim",root, 
    function( ) 
        setPedAnimation ( source, "INT_OFFICE", "OFF_Sit_Idle_Loop", -1, false, false, false ) 
    end 
)    
  
-- Client side 
addEventHandler( "onClientElementStreamIn",root, 
    function( ) 
        if getElementType( source ) == "ped" and getElementData( source,"anim" ) then 
            triggerServerEvent( "createAnim",source ) 
        end 
    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...