Jump to content

Script error (camera)


MisterQuestions

Recommended Posts

Hi i got a error this supose to set the camera to a garage when player uses command, but just have errors :( whats wrong?

Server-Side

function garage1() 
fadeCamera( source, true, 5) 
setCameraMatrix(source, 1873, -2101, 14, 1873, -2101, 14) 
--Un extra... 
outputChatBox ( "#FF9E00Welcome to the garage!", getRootElement(), 255, 255, 255, true ) 
end 
addCommandHandler("g1", garage1) 

Logs

[2014-09-19 20:52:28] WARNING: gm\server.lua:14: Bad argument @ 'fadeCamera' [Expected element at argument 1, got nil] 
[2014-09-19 20:52:28] WARNING: gm\server.lua:15: Bad argument @ 'setCameraMatrix' [Expected element at argument 1, got nil] 

Link to comment
  
playerCars = {} 
  
function garage1(source) 
fadeCamera( source, true, 5) 
setCameraMatrix(source, 1873, -2101, 14, 1873, -2101, 14) 
playerCars[source] = createVehicle(345, 1873, -2101, 14) 
setElementVisibleTo(playerCars[source], root, false) 
setElementVisibleTo(playerCars[source], source, true) 
outputChatBox ( "#FF9E00Welcome to the garage!", source, 255, 255, 255, true ) 
end 
addCommandHandler("g1", garage1) 
  
addEventHandler("onPlayerQuit", root, function() 
     if playerCars[source] then 
           destroyElement(playerCars[source]) 
           playerCars[source] = nil 
     end 
end 
) 
  
addEventHandler("onPlayerLogin", root, function() 
     if playerCars[source] then 
           destroyElement(playerCars[source]) 
           playerCars[source] = nil 
     end 
end 
) 
  

I-guess.

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