Jump to content

[SOLVED]camera script problem


villr

Recommended Posts

hey guys i got a big trouble now,i have maked a newsstudio and camrea script and yea this thigns but i have seen a problem,that when i make the cam set back the player do fall underground at the posistion they where :S

how can i fix that?

client

  
solved 
     
  

and serverside

  
solved 
end 

somebody can help me? plz

Edited by Guest
Link to comment

Try something like this:

function showintro1() 
    fadeCamera(root,false,1 ) 
    setTimer(fadeCamera,1000,1,root,true,5 )  
    setTimer(start,1500,1) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ),showintro1) 
  
function start() 
for index, player in pairs(getElementsByType("player")) do 
    setElementFrozen(player, true) 
end 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
anchor1 = createPed(57,808.0,-1285.66,6.27) 
anchor2 = createPed(219,808.0,-1284.11,6.27) 
anchor3 = createPed(187,808.0,-1282.50,6.27) 
setPedFrozen(anchor1,true) 
setPedFrozen(anchor2,true) 
setPedFrozen(anchor3,true) 
setElementRotation(anchor1,0,0,270) 
setElementRotation(anchor2,0,0,270) 
setElementRotation(anchor3,0,0,270) 
setTimer(anims,1000,1) 
end 
  
function anims() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setTimer(floodmess,3000,1) 
end 
  
function floodmess() 
setPedAnimation( anchor2 ) 
setPedAnimation( anchor2,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
triggerClientEvent(root,"flood1",root) 
setTimer(bye,4000,1) 
setTimer(beach,9000,1) 
end 
  
function bye() 
setPedAnimation( anchor1,"GANGS", "hndshkda",5000,false,false,false) 
setPedAnimation( anchor2,"GANGS", "hndshkaa",5000,false,false,false) 
setPedAnimation( anchor3,"GANGS", "hndshkba",5000,false,false,false) 
setTimer(anims1,4000,1) 
end 
  
function anims1() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
end 
  
function anims2() 
setPedAnimation(carla,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
setPedAnimation(carla1,"ped", "WOMAN_runpanic",5000,true,true,false) 
setTimer(setPedAnimation,6000,1,carla) 
end 
  
function beach() 
setCameraMatrix(root,923.71,-1846.40,10.627,0,-10000,00) 
newsvan = createVehicle(582,925.06,-1851.71,10.2375) 
setVehicleRotation(newsvan,0,0,36) 
setVehicleColor(newsvan,106,106,106,106) 
carla = createPed(141,921.89,-1849.92,10.121) 
carla1 = createPed(245,910.39,-1857.66,9.75) 
setElementRotation(carla,0,0,353.53) 
setElementRotation(carla1,0,0,263) 
triggerClientEvent(root,"flood2",root) 
setRainLevel(1) 
setTimer(anims2,1000,1) 
setTimer(byebeach,8000,1) 
end 
  
function byebeach() 
destroyElement(carla1) 
destroyElement(carla) 
destroyElement(newsvan) 
triggerClientEvent(root,"flood3",root) 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
setTimer(anims1,1000,1) 
setTimer(bye,4000,1) 
setTimer(back,6000,1) 
end 
  
function back(source) 
triggerClientEvent(root,"flood4",root) 
resetRainLevel() 
fadeCamera(root,false,1 ) 
setTimer(fadeCamera,1000,1,root,true,5 )    
setCameraTarget(root,source) 
setElementFrozen(source,false) 
end 

Link to comment
function showintro1() 
    fadeCamera(root,false,1 ) 
    setTimer(fadeCamera,1000,1,root,true,5 ) 
    setTimer(start,1500,1) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ),showintro1) 
  
function start() 
for index, player in pairs(getElementsByType("player")) do 
    setElementFrozen(player, true) 
end 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
anchor1 = createPed(57,808.0,-1285.66,6.27) 
anchor2 = createPed(219,808.0,-1284.11,6.27) 
anchor3 = createPed(187,808.0,-1282.50,6.27) 
setPedFrozen(anchor1,true) 
setPedFrozen(anchor2,true) 
setPedFrozen(anchor3,true) 
setElementRotation(anchor1,0,0,270) 
setElementRotation(anchor2,0,0,270) 
setElementRotation(anchor3,0,0,270) 
setTimer(anims,1000,1) 
end 
  
function anims() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setTimer(floodmess,3000,1) 
end 
  
function floodmess() 
setPedAnimation( anchor2 ) 
setPedAnimation( anchor2,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
triggerClientEvent(root,"flood1",root) 
setTimer(bye,4000,1) 
setTimer(beach,9000,1) 
end 
  
function bye() 
setPedAnimation( anchor1,"GANGS", "hndshkda",5000,false,false,false) 
setPedAnimation( anchor2,"GANGS", "hndshkaa",5000,false,false,false) 
setPedAnimation( anchor3,"GANGS", "hndshkba",5000,false,false,false) 
setTimer(anims1,4000,1) 
end 
  
function anims1() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
end 
  
function anims2() 
setPedAnimation(carla,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
setPedAnimation(carla1,"ped", "WOMAN_runpanic",5000,true,true,false) 
setTimer(setPedAnimation,6000,1,carla) 
end 
  
function beach() 
setCameraMatrix(root,923.71,-1846.40,10.627,0,-10000,00) 
newsvan = createVehicle(582,925.06,-1851.71,10.2375) 
setVehicleRotation(newsvan,0,0,36) 
setVehicleColor(newsvan,106,106,106,106) 
carla = createPed(141,921.89,-1849.92,10.121) 
carla1 = createPed(245,910.39,-1857.66,9.75) 
setElementRotation(carla,0,0,353.53) 
setElementRotation(carla1,0,0,263) 
triggerClientEvent(root,"flood2",root) 
setRainLevel(1) 
setTimer(anims2,1000,1) 
setTimer(byebeach,8000,1) 
end 
  
function byebeach() 
destroyElement(carla1) 
destroyElement(carla) 
destroyElement(newsvan) 
triggerClientEvent(root,"flood3",root) 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
setTimer(anims1,1000,1) 
setTimer(bye,4000,1) 
setTimer(back,6000,1) 
end 
  
function back(source) 
triggerClientEvent(root,"flood4",root) 
resetRainLevel() 
fadeCamera(root,false,1 ) 
setTimer(fadeCamera,1000,1,root,true,5 )   
setCameraTarget(root,source) 
setElementFrozen(source,false) 
local x, y , z = getElementPosition ( source ) 
setElementPosition ( source , x , y , z + 1) 
end 

Link to comment

You never defined 'source' at 'back' function, that's why.

function showintro1() 
    fadeCamera(root,false,1 ) 
    setTimer(fadeCamera,1000,1,root,true,5 ) 
    setTimer(start,1500,1) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ),showintro1) 
  
function start() 
for index, player in pairs(getElementsByType("player")) do 
    setElementFrozen(player, true) 
end 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
anchor1 = createPed(57,808.0,-1285.66,6.27) 
anchor2 = createPed(219,808.0,-1284.11,6.27) 
anchor3 = createPed(187,808.0,-1282.50,6.27) 
setPedFrozen(anchor1,true) 
setPedFrozen(anchor2,true) 
setPedFrozen(anchor3,true) 
setElementRotation(anchor1,0,0,270) 
setElementRotation(anchor2,0,0,270) 
setElementRotation(anchor3,0,0,270) 
setTimer(anims,1000,1) 
end 
  
function anims() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setTimer(floodmess,3000,1) 
end 
  
function floodmess() 
setPedAnimation( anchor2 ) 
setPedAnimation( anchor2,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
triggerClientEvent(root,"flood1",root) 
setTimer(bye,4000,1) 
setTimer(beach,9000,1) 
end 
  
function bye() 
setPedAnimation( anchor1,"GANGS", "hndshkda",5000,false,false,false) 
setPedAnimation( anchor2,"GANGS", "hndshkaa",5000,false,false,false) 
setPedAnimation( anchor3,"GANGS", "hndshkba",5000,false,false,false) 
setTimer(anims1,4000,1) 
end 
  
function anims1() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
end 
  
function anims2() 
setPedAnimation(carla,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
setPedAnimation(carla1,"ped", "WOMAN_runpanic",5000,true,true,false) 
setTimer(setPedAnimation,6000,1,carla) 
end 
  
function beach() 
setCameraMatrix(root,923.71,-1846.40,10.627,0,-10000,00) 
newsvan = createVehicle(582,925.06,-1851.71,10.2375) 
setVehicleRotation(newsvan,0,0,36) 
setVehicleColor(newsvan,106,106,106,106) 
carla = createPed(141,921.89,-1849.92,10.121) 
carla1 = createPed(245,910.39,-1857.66,9.75) 
setElementRotation(carla,0,0,353.53) 
setElementRotation(carla1,0,0,263) 
triggerClientEvent(root,"flood2",root) 
setRainLevel(1) 
setTimer(anims2,1000,1) 
setTimer(byebeach,8000,1) 
end 
  
function byebeach() 
destroyElement(carla1) 
destroyElement(carla) 
destroyElement(newsvan) 
triggerClientEvent(root,"flood3",root) 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
setTimer(anims1,1000,1) 
setTimer(bye,4000,1) 
setTimer(back,6000,1) 
end 
  
function back() 
triggerClientEvent(root,"flood4",root) 
resetRainLevel() 
fadeCamera(root,false,1 ) 
setTimer(fadeCamera,1000,1,root,true,5 )   
setCameraTarget(root,root) 
for index, player in pairs(getElementsByType("player")) do 
    setElementFrozen(player,false) 
    local x, y , z = getElementPosition ( player ) 
    setElementPosition ( player, x , y , z + 1) 
    end 
end 

Link to comment
function showintro1() 
    fadeCamera(root,false,1 ) 
    setTimer(fadeCamera,1000,1,root,true,5 ) 
    setTimer(start,1500,1) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ),showintro1) 
  
function start() 
for index, player in pairs(getElementsByType("player")) do 
    setElementFrozen(player, true) 
end 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
anchor1 = createPed(57,808.0,-1285.66,6.27) 
anchor2 = createPed(219,808.0,-1284.11,6.27) 
anchor3 = createPed(187,808.0,-1282.50,6.27) 
setPedFrozen(anchor1,true) 
setPedFrozen(anchor2,true) 
setPedFrozen(anchor3,true) 
setElementRotation(anchor1,0,0,270) 
setElementRotation(anchor2,0,0,270) 
setElementRotation(anchor3,0,0,270) 
setTimer(anims,1000,1) 
end 
  
function anims() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setTimer(floodmess,3000,1) 
end 
  
function floodmess() 
setPedAnimation( anchor2 ) 
setPedAnimation( anchor2,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
triggerClientEvent(root,"flood1",root) 
setTimer(bye,4000,1) 
setTimer(beach,9000,1) 
end 
  
function bye() 
setPedAnimation( anchor1,"GANGS", "hndshkda",5000,false,false,false) 
setPedAnimation( anchor2,"GANGS", "hndshkaa",5000,false,false,false) 
setPedAnimation( anchor3,"GANGS", "hndshkba",5000,false,false,false) 
setTimer(anims1,4000,1) 
end 
  
function anims1() 
setPedAnimation( anchor1,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor2,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
setPedAnimation( anchor3,"INT_OFFICE", "OFF_Sit_Idle_Loop",5000,false,false,false) 
end 
  
function anims2() 
setPedAnimation(carla,"GANGS", "prtial_gngtlkC",5000,false,false,false) 
setPedAnimation(carla1,"ped", "WOMAN_runpanic",5000,true,true,false) 
setTimer(setPedAnimation,6000,1,carla) 
end 
  
function beach() 
setCameraMatrix(root,923.71,-1846.40,10.627,0,-10000,00) 
newsvan = createVehicle(582,925.06,-1851.71,10.2375) 
setVehicleRotation(newsvan,0,0,36) 
setVehicleColor(newsvan,106,106,106,106) 
carla = createPed(141,921.89,-1849.92,10.121) 
carla1 = createPed(245,910.39,-1857.66,9.75) 
setElementRotation(carla,0,0,353.53) 
setElementRotation(carla1,0,0,263) 
triggerClientEvent(root,"flood2",root) 
setRainLevel(1) 
setTimer(anims2,1000,1) 
setTimer(byebeach,8000,1) 
end 
  
function byebeach() 
destroyElement(carla1) 
destroyElement(carla) 
destroyElement(newsvan) 
triggerClientEvent(root,"flood3",root) 
setCameraMatrix(root,815,-1284.33,7.33,-40000,0,00) 
setTimer(anims1,1000,1) 
setTimer(bye,4000,1) 
setTimer(back,6000,1) 
end 
  
function back() 
triggerClientEvent(root,"flood4",root) 
resetRainLevel() 
fadeCamera(root,false,1 ) 
setTimer(fadeCamera,1000,1,root,true,5 ) 
for index, player in pairs(getElementsByType("player")) do 
    setCameraTarget(player, player) 
    local x, y, z = getElementPosition ( player ) 
    setElementPosition ( player, x , y , z + 1.5) 
    setElementFrozen(player,false) 
    end 
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...