Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- GTA SA - Dead Camera test
- Author: RBS ID
- ]]
- -- print ped variable when using find all peds code
- function ped_test()
- for _, ped in {PedFindInAreaXYZ(0, 0, 0, 99999)} do
- TextPrintString("_: " .. tostring(_) .. "\nped: " .. tostring(ped), 1, 1)
- end
- end
- function main()
- while not SystemIsReady() do
- Wait(0)
- end
- local cam = {
- pos = {
- x = 0, y = 0, z = 0, h = 0
- },
- look = {
- x = 0, y = 0, z = 0, h = 0
- }
- }
- local toggle = false
- local temp = {
- }
- local timer = {
- startCamToFadeIn = GetTimer()
- }
- while 1 < 2 do
- Wait(0)
- --ped_test()
- if IsButtonBeingReleased(14, 0) then
- toggle = not toggle
- if not toggle then
- Wait(1)
- CameraFade(100, 1)
- PlayerSetControl(1)
- CameraReturnToPlayer()
- else
- PlayerSetControl(0)
- cam.pos.h = 0
- cam.pos.x, cam.pos.y, cam.pos.z = PlayerGetPosXYZ()
- cam.pos.z = cam.pos.z + 3
- cam.look.x, cam.look.y, cam.look.z = PlayerGetPosXYZ()
- timer.startCamToFadeIn = GetTimer()
- end
- end
- --cam.pos.x, cam.pos.y, cam.pos.z = PlayerGetPosXYZ()
- --cam.pos.y = cam.pos.y - 0.5
- --cam.pos.z = cam.pos.z + 3
- if toggle then
- cam.pos.x, cam.pos.y, temp[1] = PlayerGetPosXYZ()
- --cam.look.x, cam.look.y, cam.look.z = PlayerGetPosXYZ()
- cam.pos.h = cam.pos.h + 0.04
- cam.pos.h = cam.pos.h < -math.pi and math.pi or (cam.pos.h > math.pi and -math.pi or cam.pos.h)
- cam.pos.x, cam.pos.z = cam.pos.x-math.sin(cam.pos.h)*3, cam.pos.z+0.02
- cam.look.x, cam.look.y = cam.pos.x, cam.pos.y
- CameraSetXYZ(
- cam.pos.x, cam.pos.y+3, cam.pos.z,
- cam.pos.x, cam.pos.y, temp[1]
- )
- TextPrintString("WASTED", 0.1, 1)
- if GetTimer() >= timer.startCamToFadeIn+3000 then
- CameraFade(3000, 0)
- end
- end
- --TextPrintString("Pos X: " .. tostring(cam.pos.x) .. ", Y: " .. tostring(cam.pos.y) .. ", Z: " .. tostring(cam.pos.z) .. "\nLook X: " .. tostring(cam.look.x) .. ", Y: " .. tostring(cam.look.y) .. ", Z: " .. tostring(cam.look.z), 1, 2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement