Jump to content

setCameraTarget problem


Tockra

Recommended Posts

Posted

pastebin seems to be down (tried here and via webproxy), could you paste it somewhere else?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
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

h32yhix1ossu.png
Posted

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)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Client site it dont run too...

Now i added:

setTimer(
function()
setCameraTarget(player,player)
end,60,1) --  It needs at least 50, for runinng...

Why im the sole exception, who have problem...

h32yhix1ossu.png
Posted

Try setting camera target before setting position and rotation. If it works but looks some kinda wierd you have to use timer or some kind of setCameraMatrix/setCameraTarget combination.

MTASA.LV - Latvian MTA Community

Posted

its working with setTimer or not?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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