benwilkins Posted January 18, 2012 Posted January 18, 2012 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..
BriGhtx3 Posted January 18, 2012 Posted January 18, 2012 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 )
Xeno Posted January 18, 2012 Posted January 18, 2012 EDIT: Woops, beat me to it, haha Try that.. setTimer(setPedAnimation, 1000,1,giovanna, "INT_OFFICE", "OFF_Sit_Idle_Loop", -1, false, false, false )
Slothman Posted January 19, 2012 Posted January 19, 2012 It's important to delay any changes to a ped after creating it, as it seems to take a tiny fraction of a second for the ped to spawn.
DiSaMe Posted January 19, 2012 Posted January 19, 2012 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.
Slothman Posted January 21, 2012 Posted January 21, 2012 That's correct, you will need to reapply the animation using the event onClientElementStreamIn.
Kenix Posted January 21, 2012 Posted January 21, 2012 --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 )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now