Playstation23 Posted July 5, 2009 Share Posted July 5, 2009 Does anybody know where I can find a cruise control script? It's for a friend of mine's server. Link to comment
Infinity* Posted July 15, 2009 Share Posted July 15, 2009 You need to script this by your self,cuz i don't think that script is released or created. Link to comment
DakiLLa Posted July 16, 2009 Share Posted July 16, 2009 https://community.multitheftauto.com/index.php?p= ... ils&id=353 you can take a look on this... Link to comment
robhol Posted July 16, 2009 Share Posted July 16, 2009 In the future, DaK, it'd be nice if you didn't plagiarize, let alone steal my scripts. This is not the first time it's happened. Just learn scriptng yourself. What if you need something and there's no ready script to steal? Link to comment
DakiLLa Posted July 16, 2009 Share Posted July 16, 2009 well..i think that was a bad idea to upload it.. but i didnt write that "I have made this script" anyway, this theme is closed. Link to comment
cokacola Posted August 27, 2009 Share Posted August 27, 2009 Hello, i know this topic is a few months old, but i have infact made a successful cruise control script, even though it is kinda weird --some form of cruise control theCruiseTimer = "noone-nothing" function cruiseOff(thePlayer) --its on, so turn it off killTimer(theCruiseTimer) theCruiseTimer = "noone-nothing" setControlState ( thePlayer, "accelerate", false ) setControlState ( thePlayer, "brake_reverse", false ) end function cruiseOn(thePlayer, speed, theCar) theCar1 = getPedOccupiedVehicle(thePlayer) if(theCar1) then local x1, y1, z1 = getElementVelocity(theCar) local speed1 = math.sqrt(x1^2 + y1^2 + z1^2) * 161 if(speed1 < speed) then setControlState ( thePlayer, "brake_reverse", false ) setControlState ( thePlayer, "accelerate", true ) elseif(speed1 > speed) then setControlState ( thePlayer, "accelerate", false ) setControlState ( thePlayer, "brake_reverse", true ) end else cruiseOff(thePlayer) end end function cruiseControl(thePlayer) local theCar = getPedOccupiedVehicle(thePlayer) if(theCruiseTimer == "noone-nothing") then if(theCar) then local x, y, z = getElementVelocity(theCar) .sqrt(x^2 + y^2 + z^2) * 161 local speed = math local.sqrt(x^2 + y^2 + z^ speed =2) * 161 math.sqrt(x^2 + y^2 + z^2) * 161 --its off, so turn it on theCruiseTimer = setTimer(cruiseOn, 50, 0, thePlayer, speed, theCar) else outputChatBox("Error: players don't have cruise control switches. Must be in car.", thePlayer) end else cruiseOff(thePlayer) end end addCommandHandler("ct", cruiseControl) it is a bit weird, so you may wanna remove the setControlState ( thePlayer, "brake_reverse", true ) and anything other setControlState with "brake_reverse" in it, thats only if you dis-like the constant breaking though. Now, when you type /ct this function should keep the car going what ever km/h speed your car is driving. have fun P.S. i don't care if anyone else has posted theirs already, so what, i posted mine too Link to comment
Playstation23 Posted August 28, 2009 Author Share Posted August 28, 2009 Thanks for that mate! I'll tell him now. Link to comment
cokacola Posted August 29, 2009 Share Posted August 29, 2009 np, im shore he will be glad Link to comment
JohnDoe91286 Posted August 31, 2009 Share Posted August 31, 2009 Yep..Thanks cokacola. Link to comment
Lordy Posted August 31, 2009 Share Posted August 31, 2009 wth is that? if(theCar) then local x, y, z = getElementVelocity(theCar) .sqrt(x^2 + y^2 + z^2) * 161 local speed = math local.sqrt(x^2 + y^2 + z^ speed =2) * 161 math.sqrt(x^2 + y^2 + z^2) * 161 --its off, so turn it on theCruiseTimer = setTimer(cruiseOn, 50, 0, thePlayer, speed, theCar) else Link to comment
cokacola Posted September 7, 2009 Share Posted September 7, 2009 if you mean .sqrt(x^2 + y^2 + z^2) * 161 local speed = math local.sqrt(x^2 + y^2 + z^ speed =2) * 161 math.sqrt(x^2 + y^2 + z^2) * 161 that, i am guessing its math as long as it works... it just gets the speed in KMH Link to comment
ZodiacNL Posted July 15, 2010 Share Posted July 15, 2010 How can i get this to work? I'm not that good at scripting but i can get most resources to work only this one gives me trouble. Link to comment
ZodiacNL Posted July 16, 2010 Share Posted July 16, 2010 Can someone help me? I copied the script into a text file and called it cruisecontrol.lua, created a meta.xml but it doesnt work. What button do i use to start the cruisecontrol? Isnt it working properly? Link to comment
Lordy Posted July 16, 2010 Share Posted July 16, 2010 The problem that I pointed out is still there.. he's doing .sqrt(blah) local variable = math. which is really weird, as it should be local variable = math.sqrt(blah) 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