Jump to content

CCTV Script doesn't work


Mathias Lui

Recommended Posts

Hello Community,

I've got a problem with my script. When I try to run it it won't work. Nothing of it. I'm a newbie in scripting. Here's the xml file:

    "Mathias Lui" type="script" /> 
    

and the lua file (script.lua)

cam1 = createObject(1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0) 
function gotoCam1() 
    setCameraMatrix(source, 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061, roll = 0, fov = 100) 
end 
addCommandHandler("cctv", gotoCam1) 
function gotoPlayer() 
    setCameraTarget(source) 
end 
addCommandHandler("lcctv", gotoPlayer) 

I also tried this:

cam1 = createObject(1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0) 
function gotoCam1() 
    setCameraMatrix(localPlayer, 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061, roll = 0, fov = 100) 
end 
addCommandHandler("cctv 1 pw", gotoCam1) 
function gotoPlayer() 
    setCameraTarget(localPlayer) 
end 
addCommandHandler("lcctv", gotoPlayer) 

Hope you can help me!

Mathias Lui

Link to comment
-- ClientSide 
  
local cam1 = createObject ( 1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0 ) 
function gotoCam1(  ) 
    setCameraMatrix ( 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061,0,100 ) 
end 
addCommandHandler ( '1cctv', gotoCam1 ) 
  
  
function gotoPlayer  (  ) 
    setCameraTarget ( localPlayer ) 
end 
addCommandHandler ( '2cctv', gotoPlayer ) 

P.S : I changed the command both of them.

Link to comment
@Mr.pres[T]ege What did you do different? It works now (thanks for that) but what did you change? Was the command i used already in use? Or what was the error? I mean, the createObject didn't work as well but now it works.

The problem was in line 3 next time you should use the wiki bro actually in the client side there's no player variable also there's no need to use roll and fov to defined it because they are already defined .

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