Jump to content

DjMixCuma

Members
  • Posts

    83
  • Joined

  • Last visited

Everything posted by DjMixCuma

  1. My code local facing = 0 local distance = 5; local height = 1; local speed = 0.0002 local gLocalPlayer = getLocalPlayer(); function rotateCameraAroundPlayer() local x, y, z = getElementPosition(gLocalPlayer) if isPedInVehicle(gLocalPlayer) then x, y, z = getElementPosition(getPedOccupiedVehicle(gLocalPlayer)) end local camX = x + math.cos(facing / math.pi * 180) * distance; local camY = y + math.sin(facing / math.pi * 180) * distance; setCameraMatrix(camX, camY, z + height, x, y, z) facing = facing + 0.0002 end function startRotatingCamera() addEventHandler("onClientPreRender", root, rotateCameraAroundPlayer); end function stopRotatingCamera() removeEventHandler("onClientPreRender", root, rotateCameraAroundPlayer); end function setCameraOnPlayerJoin() fadeCamera(source, true, 3) startRotatingCamera() end addEventHandler("onClientPlayerJoin", getRootElement(), setCameraOnPlayerJoin) function setPlayerColor() setPlayerNametagColor(source, 0, 204, 0) end addEventHandler("onClientPlayerJoin", getRootElement(), setPlayerColor) Client side and not working !!
  2. This working but it is fast and then gradually slows. See my 2nd line : local speed = 3 Just make it 2 or 1 or 0.5 or whatever you want. and stoped in 180 but i want full 360 rotate and repeat.
  3. This working but it is fast and then gradually slows and stoped in 180 but i want full 360 rotate and repeat. It moves away not 360*
  4. local nCount = 0 local nPlus = 0.1 function setCameraOnPlayerJoin() fadeCamera(source, true, 3) setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316, 0, nCount ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) addEventHandler( 'onClientPreRender', root, function( ) if math.floor( nCount ) == 180 then nCount = 0 end nCount = nCount + nPlus setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316, 0, nCount ) end ) My script and not working. Bad argument @ `setCamerMatrix`.
  5. This not working. This have error: Bad argument @ `setCamerMatrix`.
  6. why is not rotate 360* ?? setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316, 0, 180)
  7. I known this function, but that not turns in 360*
  8. Hi! I want to create 360* Camera, like in Los Santos Stories, when player joined to server. (ip 91.204.162.80:22003) please give me code, because i'm noob in lua and for you is trifle.
×
×
  • Create New...