Jump to content

setCameraMatrix


Cornelis

Recommended Posts

Hi,

I'm creating my own gamemode, but I want to create a screen behind my login window. There is only one problem, it only changes one time. Could somebody help me?

startCamera = 
{  
    {1320.6896972656, -951.76672363281, 100.9468614891, 1364.1717529297, -800.80603027344, 75.560821533203}, 
    {149.31686401367, 2386.1716308594, 65.455644607544, 400.84384155273, 2528.552734375, 16.574115753174}, 
    {966.36157226563, 2589.4494628906, 10.156999588013, 966.626953125, 2588.5498046875, 10.503839492798, 0.7}, 
    {-2770.24, -1133.92, 38.14, -2881.06, -907.75, 9.301} 
} 
  
function createCameraMatrix () 
    local x, y, z, xx, yy, zz = unpack (startCamera [math.random (#startCamera)]) 
    startCameraTimer = setTimer (setCameraMatrix, 5000, 0, x, y, z, xx, yy, zz) 
end 
  
function destroyCameraMatrix () 
    killTimer (startCameraTimer) 
    setCameraTarget (getLocalPlayer ()) 
end 
  
addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), 
function() 
--Settings 
    createCameraMatrix () 
end) 

Thanks!

Link to comment
startCamera = 
{ 
    {1320.6896972656, -951.76672363281, 100.9468614891, 1364.1717529297, -800.80603027344, 75.560821533203}, 
    {149.31686401367, 2386.1716308594, 65.455644607544, 400.84384155273, 2528.552734375, 16.574115753174}, 
    {966.36157226563, 2589.4494628906, 10.156999588013, 966.626953125, 2588.5498046875, 10.503839492798, 0.7}, 
    {-2770.24, -1133.92, 38.14, -2881.06, -907.75, 9.301} 
} 
  
function createCameraMatrix () 
     startCameraTimer = setTimer(function() 
          local x, y, z, xx, yy, zz = unpack(startCamera[math.random(#startCamera)]) 
          setCameraMatrix(x, y, z, xx, yy, zz) 
     end,5000,0) 
end 
  
function destroyCameraMatrix () 
     if isTimer(startCameraTimer) then killTimer(startCameraTimer) end 
     setCameraTarget(localPlayer) 
end 
  
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
--Settings 
     createCameraMatrix () 
end) 

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