Jump to content

setCameraTarget problem


|H|TiTanium

Recommended Posts

Hello, it's not a big problem and I'm sure you can do it easily, as I'm not an experienced scripter yet, I thought about asking you how do I do it. My problem is that I can do my screen black using fadeCamera but I don't know how do I back to normal. I tried setTimer but probably I made something wrong and due that it doesn't work. It's made client-side

This is the function which makes my screen black:

function piscar( hitElement, matchingDimension ) 
        if ( hitElement == getLocalPlayer() and source == myMarker ) then 
        fadeCamera ( false, 1, 0, 0, 0 ) 
    end 
end 
addEventHandler( "onClientMarkerHit", getRootElement(), piscar ) 

As you see, when I reach marker, my screen is faded to black, but it doesn't back to normal, the only thing I need is a way of making screen back to normal.

Edited by Guest
Link to comment

EDIT: Please, there is a bug, before screen gets faded the camera is already placed and looking to the wall, how do I make screen fade first and then camera gets placed and looking at the wall ?

So now, I got a new problem, when the player reaches marker, his camera is faded to black and then it backs to normal, then when it's back a GUI appears and the camera is looking to the wall ( as I want ), but when the player clicks on Close button, the camera still looking at wall, I tried setCameraTarget , but the seems impossible as what I'm trying to do can only be made on server-side ( I'm scripting on client-side ), I got these lua codes, First code is working perfectly, camera is faded, GUI appears, camera is looking at wall. Second code is the problem...

function showGUI( hitElement, matchingDimension ) 
        if ( hitElement == getLocalPlayer() and source == myMarker ) then 
                setCameraMatrix( 2151.23975, -1178.32861, 23.82031, 2139.42456, -1178.52942, 23.99219 ) -- This is where camera is at and where it's looking at 
                showChat( false ) -- Chat is hidden as soon as camera is faded 
                guiSetVisible ( myWindow, true ) -- Gui appears and also Cursor 
                showCursor( true ) 
           end 
end 
addEventHandler( "onClientMarkerHit", getRootElement(), showGUI ) 

The above code is when player reaches the marker, and the below is when player clicks on "Close" button. Problem is here :

function quandofecha( thePlayer ) 
        fadeCamera ( false, 1, 0, 0, 0 ) 
        setTimer ( fadeCamera, 1000, 1, true ) 
        setCameraTarget( thePlayer ) -- I'm sure I'm doing this wrongly, but I don't have any idea of how do I back the camera, also I think it's not possible on client-side ( I'm building on it ) and please, teach me how do I do it... 
        showChat( true ) 
end 

addEventHandler("onClientGUIClick", myButton2, quandofecha, false)

Edited by Guest
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...