villr Posted September 17, 2011 Share Posted September 17, 2011 (edited) 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 how can i fix that? client solved and serverside solved end somebody can help me? plz Edited September 17, 2011 by Guest Link to comment
JR10 Posted September 17, 2011 Share Posted September 17, 2011 That's happened to me, I was doing something similar, and he falls. Freeze him, and then when you setCameraTarget unfreeze him, and move him up, z + 1. Link to comment
villr Posted September 17, 2011 Author Share Posted September 17, 2011 hmm could you give me a clue how i can do the moving? Link to comment
JR10 Posted September 17, 2011 Share Posted September 17, 2011 local x , y , z = getElementPosition ( player ) setElementPosition ( player , x , y , z + 1 ) Sorry I suck at explaining. 1 Link to comment
Castillo Posted September 17, 2011 Share Posted September 17, 2011 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
villr Posted September 17, 2011 Author Share Posted September 17, 2011 JR10: your code diden work attempt to perform arithmetic on local 'z' (a nil value) Castillo: yours did work half it do froze but when its over it do kill me and then this come Bad argument @ 'setElementFrozen' it Link to comment
JR10 Posted September 17, 2011 Share Posted September 17, 2011 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
Castillo Posted September 17, 2011 Share Posted September 17, 2011 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
villr Posted September 17, 2011 Author Share Posted September 17, 2011 It dosent's set back my camrea so idk if it worked. Link to comment
Castillo Posted September 17, 2011 Share Posted September 17, 2011 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
villr Posted September 17, 2011 Author Share Posted September 17, 2011 Got it working now,thx guys Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now