Jump to content

setCameraTarget problem


Tockra

Recommended Posts

function playerJoin()
bindKey ( source, "enter", "down", enter,source )  -- bind the player's F1 down key
end
addEventHandler("onPlayerJoin",getRootElement(),playerJoin)
 
function enter()
local x,y,z = getElementPosition( player )
 
if(getDistanceBetweenPoints3D( x,y,z,2305.7766,-16.1296,26.7496) <= 1.0) then --Bank raus -- This run
if(getElementDimension(player) == 4) then -- This run
fadeCamera(player,false,2.5) -- This run
toggleAllControls (player,false) -- This run
 
setTimer( -- This run
function() -- This run
setElementRotation player, 0,0,180 ) -- This run
setElementPosition( player,1462.5670166016,-1013.8486328125,26.794647216797) -- This run
setCameraTarget(player,player) -- This dont run. I should set the camera behind the Player after setPosition... If i delete setElementRotation OR setElementPosition  it run...
triggerClientEvent(player,"destroyPedB",player) -- This run
setElementDimension(player,0) -- This run
toggleAllControls (player,true) -- This run
fadeCamera(player,true,2.5) -- This run
end , 2500,1) -- This run
end
end
end
end

So here is the complete code...

Its mystic o0

Link to comment

hm, dont have a clue why..

but you can try to set timer for it, to make a little interval between setting position and camera target. Or if this is not a problem - try to set camera client-side in your destroyPedB event (idk if you use this event somewhere else, and this will cause problems)

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