|  |  | @ -25,7 +25,7 @@ end | 
			
		
	
		
		
			
				
					
					|  |  |  | function doCruise() |  |  |  | function doCruise() | 
			
		
	
		
		
			
				
					
					|  |  |  |     local car = storeCarCharIsInNoSave(playerPed) |  |  |  |     local car = storeCarCharIsInNoSave(playerPed) | 
			
		
	
		
		
			
				
					
					|  |  |  |     if not isCharInAnyCar(playerPed) or not isCarEngineOn(car) then |  |  |  |     if not isCharInAnyCar(playerPed) or not isCarEngineOn(car) then | 
			
		
	
		
		
			
				
					
					|  |  |  |         if cruise then  |  |  |  |         if cruise then | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             cruise = false |  |  |  |             cruise = false | 
			
		
	
		
		
			
				
					
					|  |  |  |             printStringNow('~R~cruise control - OFF', 1500) |  |  |  |             printStringNow('~R~cruise control - OFF', 1500) | 
			
		
	
		
		
			
				
					
					|  |  |  |         end |  |  |  |         end | 
			
		
	
	
		
		
			
				
					|  |  | @ -57,7 +57,7 @@ function check_press_key(table) | 
			
		
	
		
		
			
				
					
					|  |  |  |         if isKeyDown(vkeys[table[i]]) then |  |  |  |         if isKeyDown(vkeys[table[i]]) then | 
			
		
	
		
		
			
				
					
					|  |  |  |             result = true |  |  |  |             result = true | 
			
		
	
		
		
			
				
					
					|  |  |  |             result_key_text = table[i]:gsub("VK_", "") |  |  |  |             result_key_text = table[i]:gsub("VK_", "") | 
			
		
	
		
		
			
				
					
					|  |  |  |             break  |  |  |  |             break | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         end |  |  |  |         end | 
			
		
	
		
		
			
				
					
					|  |  |  |     end |  |  |  |     end | 
			
		
	
		
		
			
				
					
					|  |  |  |     return result, result_key_text |  |  |  |     return result, result_key_text | 
			
		
	
	
		
		
			
				
					|  |  | @ -68,7 +68,7 @@ script_update = { | 
			
		
	
		
		
			
				
					
					|  |  |  |     check_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/version", |  |  |  |     check_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/version", | 
			
		
	
		
		
			
				
					
					|  |  |  |     auto_update = false, |  |  |  |     auto_update = false, | 
			
		
	
		
		
			
				
					
					|  |  |  |     auto_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/easy-cruise.lua", |  |  |  |     auto_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/easy-cruise.lua", | 
			
		
	
		
		
			
				
					
					|  |  |  |     address_ini = "rubin-scripts-updates.ini", |  |  |  |     address_ini = "rubin-mods-updates.ini", | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     main = function() |  |  |  |     main = function() | 
			
		
	
		
		
			
				
					
					|  |  |  |         local name = thisScript().name |  |  |  |         local name = thisScript().name | 
			
		
	
		
		
			
				
					
					|  |  |  |         local ini = inicfg.load({ |  |  |  |         local ini = inicfg.load({ | 
			
		
	
	
		
		
			
				
					|  |  | @ -80,7 +80,7 @@ script_update = { | 
			
		
	
		
		
			
				
					
					|  |  |  |         script_update.check_update = ini[name].check_update |  |  |  |         script_update.check_update = ini[name].check_update | 
			
		
	
		
		
			
				
					
					|  |  |  |         script_update.auto_update = ini[name].auto_update |  |  |  |         script_update.auto_update = ini[name].auto_update | 
			
		
	
		
		
			
				
					
					|  |  |  |         inicfg.save(ini, script_update.address_ini) |  |  |  |         inicfg.save(ini, script_update.address_ini) | 
			
		
	
		
		
			
				
					
					|  |  |  |         if script_update.check_update then |  |  |  |         if script_update.check_update or script_update.auto_update then | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             local fpath = os.tmpname() |  |  |  |             local fpath = os.tmpname() | 
			
		
	
		
		
			
				
					
					|  |  |  |             local text = openURL(script_update.check_update_url, fpath) |  |  |  |             local text = openURL(script_update.check_update_url, fpath) | 
			
		
	
		
		
			
				
					
					|  |  |  |             if text ~= "" and not string.find(text, thisScript().version) then |  |  |  |             if text ~= "" and not string.find(text, thisScript().version) then | 
			
		
	
	
		
		
			
				
					|  |  | @ -144,16 +144,16 @@ script_update = { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 script_update.menu.dialog[#script_update.menu.dialog+1] = function() |  |  |  |                 script_update.menu.dialog[#script_update.menu.dialog+1] = function() | 
			
		
	
		
		
			
				
					
					|  |  |  |                     script_update.menu.show() |  |  |  |                     script_update.menu.show() | 
			
		
	
		
		
			
				
					
					|  |  |  |                 end |  |  |  |                 end | 
			
		
	
		
		
			
				
					
					|  |  |  |                 script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "on" or "off")) |  |  |  |                 script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "{59fc30}ON" or "{ff0000}OFF")) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 script_update.menu.dialog[#script_update.menu.dialog+1] = function() |  |  |  |                 script_update.menu.dialog[#script_update.menu.dialog+1] = function() | 
			
		
	
		
		
			
				
					
					|  |  |  |                     ini[k].check_update = not ini[k].check_update |  |  |  |                     ini[k].auto_update = not ini[k].auto_update | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     inicfg.save(ini, script_update.address_ini) |  |  |  |                     inicfg.save(ini, script_update.address_ini) | 
			
		
	
		
		
			
				
					
					|  |  |  |                     script_update.menu.show() |  |  |  |                     script_update.menu.show() | 
			
		
	
		
		
			
				
					
					|  |  |  |                 end |  |  |  |                 end | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if ini[k].check_update then |  |  |  |                 if not ini[k].auto_update then | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "on" or "off")) |  |  |  |                     script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "{59fc30}ON" or "{ff0000}OFF")) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     script_update.menu.dialog[#script_update.menu.dialog+1] = function() |  |  |  |                     script_update.menu.dialog[#script_update.menu.dialog+1] = function() | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ini[k].auto_update = not ini[k].auto_update |  |  |  |                         ini[k].check_update = not ini[k].check_update | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                         inicfg.save(ini, script_update.address_ini) |  |  |  |                         inicfg.save(ini, script_update.address_ini) | 
			
		
	
		
		
			
				
					
					|  |  |  |                         script_update.menu.show() |  |  |  |                         script_update.menu.show() | 
			
		
	
		
		
			
				
					
					|  |  |  |                     end |  |  |  |                     end | 
			
		
	
	
		
		
			
				
					|  |  | @ -182,8 +182,8 @@ function openURL(url, fpath) | 
			
		
	
		
		
			
				
					
					|  |  |  |         end |  |  |  |         end | 
			
		
	
		
		
			
				
					
					|  |  |  |     end) |  |  |  |     end) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     repeat  |  |  |  |     repeat | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         wait(1000)  |  |  |  |         wait(1000) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     until final_download |  |  |  |     until final_download | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     local text = "" |  |  |  |     local text = "" | 
			
		
	
	
		
		
			
				
					|  |  | @ -191,7 +191,7 @@ function openURL(url, fpath) | 
			
		
	
		
		
			
				
					
					|  |  |  |     if f then |  |  |  |     if f then | 
			
		
	
		
		
			
				
					
					|  |  |  |         text = f:read("*a") |  |  |  |         text = f:read("*a") | 
			
		
	
		
		
			
				
					
					|  |  |  |         io.close(f) |  |  |  |         io.close(f) | 
			
		
	
		
		
			
				
					
					|  |  |  |     end  |  |  |  |     end | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     os.remove(fpath) |  |  |  |     os.remove(fpath) | 
			
		
	
		
		
			
				
					
					|  |  |  |     return text |  |  |  |     return text | 
			
		
	
		
		
			
				
					
					|  |  |  | end |  |  |  | end | 
			
		
	
	
		
		
			
				
					|  |  | 
 |