Jump to content

It goes not back to the player! [NOT FIXED!]


Recommended Posts

Hello,

Pls help me with my problem. I want that when i open my window that it goes to a specific view. This works fine, but now the problem. When i want that the view returns to the player then it dont work. Can someone help me, pls?

  
function dxCreateNewsWindow () 
    dxDrawImage(369.0,135.0,607.0,433.0,"background.png",180.0,0.0,0.0,tocolor(50,50,50,255),false) 
    dxDrawImage(369.0,170.0,607.0,410.0,"background.png",180.0,0.0,0.0,tocolor(255,255,255,255),false) 
    dxDrawText("       VG",375.0,139.0,905.0,165.0,tocolor(0,221,255,255),1.0,"bankgothic","left","center",false,false,false) 
    dxDrawText("The       - News.",375.0,139.0,905.0,165.0,tocolor(90,90,90,255),1.0,"bankgothic","left","center",false,false,false) 
    dxDrawText(newsText,406.0,201.0,942.0,547.0,tocolor(255,255,255,255),1,"clear","left","top",false,false,false)  
end 
  
function createViewOpen () 
    setCameraMatrix(1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
end 
  
local  back = getCameraMatrix() 
local localPlayer = getLocalPlayer () 
  
function backToView () 
        setCameraTarget() 
end 
  
  
local shown = false 
  
function showNewsWindow() 
    if shown == false then 
        addEventHandler("onClientRender", root, dxCreateNewsWindow) 
        addEventHandler("onClientRender", root, createViewOpen) 
        shown = true 
    else 
        shown = false 
        removeEventHandler("onClientRender", root, dxCreateNewsWindow) 
        addEventHandler("onClientRender", root, backToView) 
    end 
end 
  

Edited by Guest
Link to comment
setCameraTarget() 

setCameraTarget(localPlayer) 

and remove this

addEventHandler("onClientRender", root, backToView) 
addEventHandler("onClientRender", root, createViewOpen) 

and this not needed

local localPlayer = getLocalPlayer () 

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