joedajoester
Members- 
                
Posts
256 - 
                
Joined
 - 
                
Last visited
 
Everything posted by joedajoester
- 
	It doesnt remove parachute or change the handling back to normal.
 - 
	It stays attached to the car.
 - 
	The object does not disappear. And was it line 30? It usually says error at line __ this time it didnt.
 - 
	So my script i need to perform the function, Breakoff when the mph is at 0 I get error: then expected near = local parachute = createObject(3131, 0, 0, 0) function Break(thePlayer) if (not isPedInVehicle(thePlayer)) then return end local vehicle = getPedOccupiedVehicle(thePlayer) local handling = getVehicleHandling(vehicle) setElementData(vehicle, "slowing", vehicle) setVehicleHandling(vehicle, "brakeDeceleration", 20.08) setVehicleHandling(vehicle, "tractionMultiplier", 1.08) attachElements(parachute, vehicle, 0, -1.2, -0.1, 80, 0, 0) end addCommandHandler ( "break", Break ) function Breakoff(vehicle) getElementVelocity(vehicle) if mph = 0 then local handling = getElementData(vehicle, "slowing") setVehicleHandling(vehicle, "brakeDeceleration", slowing) setVehicleHandling(vehicle, "tractionMultiplier", slowing) detachElements(parachute) end end
 - 
	I get attachElements error function Break(thePlayer) if (not isPedInVehicle(thePlayer)) then return end local vehicle = getPedOccupiedVehicle(thePlayer) local handling = getVehicleHandling(vehicle) setElementData(vehicle, "slowing", vehicle) setVehicleHandling(vehicle, "brakeDeceleration", 20.08) setVehicleHandling(vehicle, "tractionMultiplier", 1.08) attachElements(parachute, vehicle, 0, 0, 0) setTimer (Breakoff, 8000, 1, vehicle) end addCommandHandler ( "break", Break ) function Breakoff(vehicle) local handling = getElementData(vehicle, "slowing") setVehicleHandling(vehicle, "brakeDeceleration", slowing) setVehicleHandling(vehicle, "tractionMultiplier", slowing) end local parachute = createObject(371, 0, 0, 0)
 - 
	Omg thank you i never used timers u were right lol
 - 
	Hi, something is going wrong, the timer isnt doing anything. function Break(player) if (not isPedInVehicle(player)) then return end local vehicle = getPedOccupiedVehicle(player) local handling = getVehicleHandling(vehicle) setElementData(vehicle, "slowing", vehicle) setVehicleHandling(vehicle, "brakeDeceleration", 20.08) setVehicleHandling(vehicle, "tractionMultiplier", 2.08) end function Breakoff(vehicle) setTimer (Breakoff, 5000, 0) local handling = getElementData(vehicle, "slowing") setVehicleHandling(vehicle, "brakeDeceleration", slowing) setVehicleHandling(vehicle, "tractionMultiplier", slowing) end addCommandHandler ( "break", Break )
 - 
	Ok thanks for all the help
 - 
	Nevermind it works now, but it doesnt work for the handbrake. Is it possible for that?
 - 
	<meta> <info author="joedajoester" version="1.0" type="script" name="car parachute break"/> <script src="server.lua" type="server" /> </meta>
 - 
	Yes its server side
 - 
	error handlingSetBrakeDeceleration a nil value
 - 
	Can you try mine and see if it works please
 - 
	Try this, im not sure if it works, but give it a try. function setElementSpeed(element, unit, speed) if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then local diff = speed/acSpeed local x,y,z = getElementVelocity(element) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end ------ function turn(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) if (not vehicle) then return end local rX, rY, rZ = getVehicleRotation(vehicle) local Speeds = getElementSpeed(vehicle, "mph") local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setElementRotation(vehicle, rX, rY, rZ + 180) local Boost = 0 -- You Can set this to 0 if You Dont Need it ! setTimer(setElementSpeed,50,1,vehicle,1,-Speeds+Boost outputChatBox("You turned your vehicle with " .. tostring(Speeds) .. " mph", thePlayer) end function bindTheKey() for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn) outputChatBox("#00FF00You can press #0000FF'left ctrl' #00FF00in vehicle to turn for 180 degrees!", player, 255, 255, 255, true) end end addEventHandler("onResourceStart", resourceRoot, bindTheKey) addEventHandler("onPlayerJoin", root, function() bindKey(source, "lctrl", "down", turn) end)
 - 
	Hi, this doesnt work i get no error. function Break local player = getPlayerFromName("joedajoester") local vehicle = getPedOccupiedVehicle(player) handlingSetBrakeDeceleration(vehicle, 0.08) addCommandHandler ( "break", Break ) end
 - 
	Anyone!?!?! im trying this but i get no effect. handlingSetBrakeDeceleration(vehicle, 20)
 - 
	Hi, i have a brilliant idea, but how would i setElementVelocity in a linear movement or, slow down a car quickly? Thanks
 - 
	What does the script do? More info so we know what to make for staff or admin only. You want staff or admin only?
 - 
	I got it all to work on my other pc with a lan test server. Gotta try on real server Thanks!
 - 
	It works, but i join my server and i see a sky only and i cant do anything. I get error when i join server, query failed: no such table: players attempt to index local 'db' (a boolean value)
 
