Jump to content

setCameraTarget


Lloyd Logan

Recommended Posts

Posted

Hey, why isn't this setting the camera on the player?

--CLIENT

function showGUIf() 
    guiSetVisible(GUIEditor.window[1], false) 
            guiSetVisible(btn1, false) 
            showCursor(false) 
            triggerServerEvent("setT", getLocalPlayer()) 
end 
addEvent("stopj", true) 
addEventHandler("stopj", root, showGUIf) 

--SERVER

function setTT(thePlayer) 
    setElementPosition(thePlayer, 375.8310546875, -65.7509765625, 1001.507812) 
    setCameraTarget(thePlayer) 
end 
addEvent("setT", true) 
addEventHandler("setT", getRootElement(), setTT) 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

if ( btn1 ) is inside the window, Then there's no need to set it visibility .

It'll change with the windows visibility ^^

+

--> server

function setTT () 
    setElementPosition(source, 375.8310546875, -65.7509765625, 1001.507812) 
    setCameraTarget(source, source) 
end 
addEvent("setT", true) 
addEventHandler("setT", getRootElement(), setTT) 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

  • Moderators
Posted
Hey, why isn't this setting the camera on the player?

--CLIENT

function showGUIf() 
    guiSetVisible(GUIEditor.window[1], false) 
            guiSetVisible(btn1, false) 
            showCursor(false) 
            triggerServerEvent("setT", getLocalPlayer()) 
end 
addEvent("stopj", true) 
addEventHandler("stopj", root, showGUIf) 

--SERVER

function setTT(thePlayer) 
    setElementPosition(source, 375.8310546875, -65.7509765625, 1001.507812) 
    setCameraTarget(source,source) 
    if thePlayer then 
         outputChatBox("IIYAMA is wrong") 
    end 
end 
addEvent("setT", true) 
addEventHandler("setT", getRootElement(), setTT) 

triggerServerEvent("setT", getLocalPlayer()) -- 2 arguments = correct trigger, source, thePlayer)

@X~|Mr.ALM

damn you was 1 second before me....

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Thanks guys, I managed to fix it myself as the argument was wrong client side!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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