drk Posted April 9, 2012 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 EPT Team Server Development: 0% Learning C++ | C++ is amazing
Jaysds1 Posted April 9, 2012 Posted April 9, 2012 You has a error on line 7 Thanks My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
DjMixCuma Posted April 10, 2012 Author Posted April 10, 2012 Okey working but i edited speed to 0.00001 and speed not changed
50p Posted April 10, 2012 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; - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
DjMixCuma Posted April 10, 2012 Author 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
50p Posted April 10, 2012 Posted April 10, 2012 Ok no problem. We'll leave it open in case others have the same problem. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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