I love Hoz's idea. I put a brick on my gas pedal when I drive across Nevada...
A simple loop using setVelocity should work.
_vehicle = this select 0;
// Get current velocity of vehicle
_vel = velocity _vehicle;
CruiseControl = true;
// Loop until global variable CruiseControl is set to false.
while {CruiseControl and alive _vehicle} do
{
_vehicle setvelocity _vel;
sleep 1;
};
The above is untested, but is probably close to a working solution. You would need an addaction to call the script. The vehicle would then maintain the current speed until the global CruiseControl variable was set to false. You could set it to false via another addAction.
The above would need more work to have it work for more than one vehicle. You could create a global variable array that contained a list of vehicles for which CruiseControl was active. And delete the vehicle from the list when CruiseControl inactive.
Anyway, lots of ways to do this...
Have fun!