Tockra Posted August 7, 2010 Posted August 7, 2010 Hi , i have a problem with setCameraTarget... It returns true, but it dont run : http://pastebin.com/BXdJfACq
dzek (varez) Posted August 8, 2010 Posted August 8, 2010 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)!
Tockra Posted August 8, 2010 Author Posted August 8, 2010 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
dzek (varez) Posted August 8, 2010 Posted August 8, 2010 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)!
Tockra Posted August 8, 2010 Author Posted August 8, 2010 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...
The_Ex Posted August 8, 2010 Posted August 8, 2010 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
Tockra Posted August 8, 2010 Author Posted August 8, 2010 it didnt run when i setted the cameratarget before position or rotation... And setCameraMatrix help not by this problem ...
dzek (varez) Posted August 8, 2010 Posted August 8, 2010 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)!
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