drk Posted April 9, 2012 Share Posted April 9, 2012 try this:local facing = 0 local distance = 5; local height = 1; local speed = 0.0002 function rotateCameraAroundPlayer() local x, y, z = getElementPosition(localPLyer) if isPedInVehicle(localPlayer) then x, y, z = getElementPosition(getPedOccupiedVehicle(localPlayer)) 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 addEventHandler("onClientResourceStart", resourceRoot,function() --Use onClientResourceStart for localPlayer fadeCamera(true, 3) --no need for source if the client is localPlayer startRotatingCamera() setPlayerNametagColor(0, 204, 0) --If it's client-side, don't add source end) I add comments to let you know the stuff your missing You has a error on line 7 Link to comment
Jaysds1 Posted April 9, 2012 Share Posted April 9, 2012 You has a error on line 7 Thanks Link to comment
DjMixCuma Posted April 10, 2012 Author Share Posted April 10, 2012 Okey working but i edited speed to 0.00001 and speed not changed Link to comment
50p Posted April 10, 2012 Share Posted April 10, 2012 Okey working but i edited speed to 0.00001 and speed not changed Ok, change this line: facing = facing + 0.0002; to this line: facing = facing + speed; Link to comment
DjMixCuma Posted April 10, 2012 Author Share Posted April 10, 2012 Okey working but i edited speed to 0.00001 and speed not changed Ok, change this line: facing = facing + 0.0002; to this line: facing = facing + speed; Big TY moderator can close subject Link to comment
50p Posted April 10, 2012 Share Posted April 10, 2012 Ok no problem. We'll leave it open in case others have the same problem. 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