jingzhi Posted November 24, 2015 Share Posted November 24, 2015 Here is a part of arresting system scripts: addEvent("onPlayerArrested",true) addEventHandler("onPlayerArrested",root, function(arrestercop) arrester = arrestercop toggleAllControls(false,true,false) fadeCamera() setCameraTarget(arrestercop) addEventHandler("onClientRender",root,cuffed) end) function cuffed() local copx, copy, copz = getElementPosition (arrester) local x, y, z = getElementPosition (localPlayer) local rx, ry, _ = getElementRotation (localPlayer) local dist = getDistanceBetweenPoints2D (copx, copy, x, y) local relx = copx - x local rely = copy - y if rely == 0 then if relx < 0 then copangle = 90 else copangle = 270 end else if rely > 0 then local copangle = 360 - math.deg(math.atan(relx / rely)) % 360 else local copangle = 180 - math.deg(math.atan(relx / rely)) end end setElementRotation(localPlayer,_,_, copangle) if dist < 5 then setControlState("forwards", false) setControlState("sprint", false ) else setControlState("forwards", true) setControlState("sprint", true ) if dist > 50 then setElementPosition(localPlayer,copx,copy,copz) end end end The arrested players can still change the direction when they move the mouse, any help? Link to comment
SpecT Posted November 24, 2015 Share Posted November 24, 2015 Have you tried with this: toggleAllControls(false,false,false) If yes then try to cancel the event onClientMouseMove 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