Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.14 KB | None | 0 0
  1. -- ################################### --
  2. -- --
  3. -- C O N F I G --
  4. -- --
  5. -- ################################### --
  6.  
  7. -- Cruise Control and Engine Code wrote by TheMrDeivid(https://forum.fivem.net/u/David_Carneiro)
  8. -- RPM and Gears code wrote by Cheleber(https://forum.fivem.net/u/Cheleber) and TheMrDeivid(https://forum.fivem.net/u/David_Carneiro)
  9. -- Race Mode Wrote by TheMrDeivid(https://forum.fivem.net/u/David_Carneiro) and thanks for the 2 lines of code that saved me Ezy(https://forum.fivem.net/u/ezy/)
  10. -- Race Mode 2 Wrote by TheMrDeivid(https://forum.fivem.net/u/David_Carneiro)
  11. -- NOTE: The Cruise Control script it self its not here only the text fuction
  12.  
  13. -- show/hide compoent
  14. local HUD = {
  15.  
  16. Speed = 'kmh', -- kmh or mph
  17.  
  18. DamageSystem = false,
  19.  
  20. SpeedIndicator = true,
  21.  
  22. ParkIndicator = false,
  23.  
  24. Top = true, -- ALL TOP PANAL ( oil, dsc, plate, fluid, ac )
  25.  
  26. Plate = true, -- only if Top is false and you want to keep Plate Number
  27.  
  28. Engine = true, -- Engine Status off/on
  29.  
  30. Cruise = false, -- Enables/Disables The CRUISE Control status (default key F9)
  31.  
  32. CarRPM = false, -- Enables/Disables The RPM status of the car
  33.  
  34. CarGears = true, -- Enables/Disables The status of the gears of the car
  35.  
  36. RaceMode = false, -- Enables/Disable The Race Mode HUD (NEW)
  37.  
  38. RaceMode2 = false, -- Enables/Disables the Race Mode HUD 2, only if the Racde Mode is false (NEW)
  39.  
  40. }
  41.  
  42. -- Move the entire UI
  43. local UI = {
  44.  
  45. x = 0.820 , -- Base Screen Coords + x
  46. y = -0.101 , -- Base Screen Coords + -y
  47.  
  48. }
  49.  
  50. -- Move the entire Race Mode
  51. local RM = {
  52.  
  53. x = 0.000 , -- Base Screen Coords + x
  54. y = -0.001 , -- Base Screen Coords + -y
  55.  
  56. }
  57.  
  58. -- Change this if you want
  59. local cruisekey = 56 -- F9
  60. local EngineHpBroken = 110
  61. local EngineHpAlmostBroken = 370
  62.  
  63. -- Don't touch this
  64. local cruisecolor = false
  65. local carspeed = nil
  66.  
  67.  
  68. -- ################################### --
  69. -- --
  70. -- C O D E --
  71. -- --
  72. -- ################################### --
  73.  
  74.  
  75.  
  76. Citizen.CreateThread(function()
  77. while true do Citizen.Wait(1)
  78.  
  79.  
  80. local MyPed = GetPlayerPed(-1)
  81.  
  82. if(IsPedInAnyVehicle(MyPed, false))then
  83.  
  84. local MyPedVeh = GetVehiclePedIsIn(GetPlayerPed(-1),false)
  85. local PlateVeh = GetVehicleNumberPlateText(MyPedVeh)
  86. local VehStopped = IsVehicleStopped(MyPedVeh)
  87. local VehEngineHP = GetVehicleEngineHealth(MyPedVeh)
  88. local VehBodyHP = GetVehicleBodyHealth(MyPedVeh)
  89. local VehBurnout = IsVehicleInBurnout(MyPedVeh)
  90. -- #### EDITED IN #### --
  91. local PedHeli = IsPedInAnyHeli(MyPed) -- Checks if the PED is in any Heli
  92. local PedPlane = IsPedInAnyPlane(MyPed) -- Checks if the PEd is in any Plane
  93. local PedBoat = IsPedInAnyBoat(MyPed) -- Checks if the PED is in any Boat
  94. local PedBike = IsPedOnAnyBike(MyPed) -- Checks if the PED is in any Bike or Bicycle
  95. local Gear = GetVehicleCurrentGear(MyPedVeh) -- Check the current gear of the vehicle
  96. local RPM = GetVehicleCurrentRpm(MyPedVeh) -- Check the rpm of the vehicle
  97. local model = GetVehicleClass(MyPedVeh) -- Check the vehicle class/model
  98. local driverseat = IsVehicleSeatFree(MyPedVeh) -- Driver Seat
  99. local _,llightson,lhighbeams = GetVehicleLightsState(MyPedVeh, 0) -- Left Beams
  100. local _,rlightson,rhighbeams = GetVehicleLightsState(MyPedVeh, 1) -- Right Beams
  101. local Passenger1 = GetVehicleNumberOfPassengers(MyPedVeh, 0) -- Seat Right Front
  102. local Passenger2 = GetVehicleNumberOfPassengers(MyPedVeh, 1) -- Seat Left Back
  103. local Passenger3 = GetVehicleNumberOfPassengers(MyPedVeh, 2) -- Seat Right Back
  104. local DoorDamagef1 = IsVehicleDoorDamaged(MyPedVeh, 0) -- Front Left Door
  105. local DoorDamagef2 = IsVehicleDoorDamaged(MyPedVeh, 1) -- Front Right Door
  106. local DoorDamagef3 = IsVehicleDoorDamaged(MyPedVeh, 2) -- Back Left Door
  107. local DoorDamagef4 = IsVehicleDoorDamaged(MyPedVeh, 3) -- Back Right Door
  108. local HoodDamagef = IsVehicleDoorDamaged(MyPedVeh, 4) -- Hood
  109. local TrunkDamagef = IsVehicleDoorDamaged(MyPedVeh, 5) -- Trunk
  110. local WindowDamage1 = IsVehicleWindowIntact(MyPedVeh, 0) -- Front Left Window
  111. local WindowDamage2 = IsVehicleWindowIntact(MyPedVeh, 1) -- Front Right Window
  112. local WindowDamage3 = IsVehicleWindowIntact(MyPedVeh, 2) -- Back Left Window
  113. local WindowDamage4 = IsVehicleWindowIntact(MyPedVeh, 3) -- Back Right Window
  114. local WindowDamage5 = IsVehicleWindowIntact(MyPedVeh, 6) -- Windshield
  115. local WindowDamage6 = IsVehicleWindowIntact(MyPedVeh, 7) -- Back Window
  116. local TyreBurst1 = IsVehicleTyreBurst(MyPedVeh, 0) -- Front Left Tyre
  117. local TyreBurst2 = IsVehicleTyreBurst(MyPedVeh, 1) -- Front Right Tyre
  118. local TyreBurst3 = IsVehicleTyreBurst(MyPedVeh, 4) -- Back Left Tyre
  119. local TyreBurst4 = IsVehicleTyreBurst(MyPedVeh, 5) -- Back Right Tyre
  120. local Bumper1 = IsVehicleBumperBrokenOff(MyPedVeh, 0) -- Back Broken Bumper
  121. local Bumper2 = IsVehicleBumperBrokenOff(MyPedVeh, 1) -- Front Broken Bumper
  122. local Hangingbumper1 = Citizen.InvokeNative(0x27B926779DEB502D,MyPedVeh, 0) -- Back Hanging Bumper
  123. local Hangingbumper2 = Citizen.InvokeNative(0x27B926779DEB502D,MyPedVeh, 1) -- Front Hanging Bumper
  124. local LHeadlight = Citizen.InvokeNative(0x5EF77C9ADD3B11A3,MyPedVeh) -- Left HeadLight
  125. local RHeadlight = Citizen.InvokeNative(0xA7ECB73355EB2F20,MyPedVeh) -- Right HeadLight
  126. local EngineRunning = Citizen.InvokeNative(0xAE31E7DF9B5B132E,MyPedVeh) -- Check if the engine is running
  127. local get_collision_veh = Citizen.InvokeNative(0x8BAD02F0368D9E14,MyPedVeh) -- Check if the vehicle hit something
  128.  
  129. -- #### SOME STUFF THAT YOU CAN'T CHANGE #### --
  130. if RPM > 0.99 then
  131. RPM = RPM*100
  132. RPM = RPM+math.random(-2,2)
  133. RPM = RPM/100
  134. end
  135. if carspeed == nil and cruisecolor == true then
  136. carspeed = Speed
  137. end
  138. if HUD.Engine then
  139. drawRct(RM.x + 0.860, RM.y + 0.772, 0.118,0.062, 0, 0, 0, 150)
  140. end
  141. if HUD.Engine then
  142. drawRct(RM.x + 0.860, RM.y + 0.835, 0.118,0.025, 0, 0, 0, 150)
  143. end
  144. -- #### DON'T TOUCH THIS #### --
  145. if HUD.RaceMode and HUD.RaceMode2 == false and PedHeli == false and PedPlane == false and PedBoat == false and PedBike == false then
  146. drawRct(RM.x + 0.24, RM.y + 0.805, 0.003,0.025, 0, 0, 0, 150) -- Front Right Brake Disc
  147. -- #### ENGINE BLOCK DAMAGE #### --
  148. if (VehEngineHP > 0) and (VehEngineHP < EngineHpBroken) then
  149. drawRct(RM.x + 0.225, RM.y + 0.777, 0.017,0.024, 255, 0, 0, 100)
  150. drawRct(RM.x + 0.205, RM.y + 0.776, 0.009,0.024, 255, 0, 0, 100)
  151. drawRct(RM.x + 0.199, RM.y + 0.780, 0.0068,0.015, 255, 0, 0, 100)
  152. drawRct(RM.x + 0.214, RM.y + 0.778, 0.011,0.003, 255, 0, 0, 100)
  153. drawRct(RM.x + 0.214, RM.y + 0.782, 0.011,0.003, 255, 0, 0, 100)
  154. drawRct(RM.x + 0.214, RM.y + 0.786, 0.011,0.003, 255, 0, 0, 100)
  155. drawRct(RM.x + 0.214, RM.y + 0.790, 0.011,0.003, 255, 0, 0, 100)
  156. drawRct(RM.x + 0.214, RM.y + 0.794, 0.011,0.003, 255, 0, 0, 100)
  157. drawRct(RM.x + 0.218, RM.y + 0.769, 0.015,0.008, 255, 0, 0, 100)
  158. drawRct(RM.x + 0.23, RM.y + 0.801, 0.007,0.007, 255, 0, 0, 100)
  159. drawRct(RM.x + 0.21, RM.y + 0.802, 0.020,0.003, 255, 0, 0, 100)
  160. drawRct(RM.x + 0.21, RM.y + 0.800, 0.003,0.002, 255, 0, 0, 100)
  161. elseif (VehEngineHP > 111) and (VehEngineHP < EngineHpAlmostBroken) then
  162. drawRct(RM.x + 0.225, RM.y + 0.777, 0.017,0.024, 255, 255, 0, 100)
  163. drawRct(RM.x + 0.205, RM.y + 0.776, 0.009,0.024, 255, 255, 0, 100)
  164. drawRct(RM.x + 0.199, RM.y + 0.780, 0.0068,0.015, 255, 255, 0, 100)
  165. drawRct(RM.x + 0.214, RM.y + 0.778, 0.011,0.003, 255, 255, 0, 100)
  166. drawRct(RM.x + 0.214, RM.y + 0.782, 0.011,0.003, 255, 255, 0, 100)
  167. drawRct(RM.x + 0.214, RM.y + 0.786, 0.011,0.003, 255, 255, 0, 100)
  168. drawRct(RM.x + 0.214, RM.y + 0.790, 0.011,0.003, 255, 255, 0, 100)
  169. drawRct(RM.x + 0.214, RM.y + 0.794, 0.011,0.003, 255, 255, 0, 100)
  170. drawRct(RM.x + 0.218, RM.y + 0.769, 0.015,0.008, 255, 255, 0, 100)
  171. drawRct(RM.x + 0.23, RM.y + 0.801, 0.007,0.007, 255, 255, 0, 100)
  172. drawRct(RM.x + 0.21, RM.y + 0.802, 0.020,0.003, 255, 255, 0, 100)
  173. drawRct(RM.x + 0.21, RM.y + 0.800, 0.003,0.002, 255, 255, 0, 100)
  174. else
  175. drawRct(RM.x + 0.225, RM.y + 0.777, 0.017,0.024, 0, 0, 0, 150)
  176. drawRct(RM.x + 0.205, RM.y + 0.776, 0.009,0.024, 0, 0, 0, 150)
  177. drawRct(RM.x + 0.199, RM.y + 0.780, 0.0068,0.015, 0, 0, 0, 150)
  178. drawRct(RM.x + 0.214, RM.y + 0.778, 0.011,0.003, 0, 0, 0, 150)
  179. drawRct(RM.x + 0.214, RM.y + 0.782, 0.011,0.003, 0, 0, 0, 150)
  180. drawRct(RM.x + 0.214, RM.y + 0.786, 0.011,0.003, 0, 0, 0, 150)
  181. drawRct(RM.x + 0.214, RM.y + 0.790, 0.011,0.003, 0, 0, 0, 150)
  182. drawRct(RM.x + 0.214, RM.y + 0.794, 0.011,0.003, 0, 0, 0, 150)
  183. drawRct(RM.x + 0.218, RM.y + 0.769, 0.015,0.008, 0, 0, 0, 150)
  184. drawRct(RM.x + 0.23, RM.y + 0.801, 0.007,0.007, 0, 0, 0, 150)
  185. drawRct(RM.x + 0.21, RM.y + 0.802, 0.020,0.003, 0, 0, 0, 150)
  186. drawRct(RM.x + 0.21, RM.y + 0.800, 0.003,0.002, 0, 0, 0, 150)
  187. end
  188. -- #### TRANSMISSION DAMAGE #### --
  189. if (VehEngineHP > 0) and (VehEngineHP < EngineHpBroken) then
  190. drawRct(RM.x + 0.2165, RM.y + 0.807, 0.011,0.020, 255, 0, 0, 100)
  191. drawRct(RM.x + 0.214, RM.y + 0.912, 0.016,0.020, 255, 0, 0, 100)
  192. drawRct(RM.x + 0.22, RM.y + 0.827, 0.004,0.040, 255, 0, 0, 100)
  193. drawRct(RM.x + 0.219, RM.y + 0.867, 0.006,0.025, 255, 0, 0, 100)
  194. drawRct(RM.x + 0.2175, RM.y + 0.892, 0.009,0.0215, 255, 0, 0, 100)
  195. elseif (VehEngineHP > 111) and (VehEngineHP < 560) then
  196. drawRct(RM.x + 0.2165, RM.y + 0.807, 0.011,0.020, 255, 255, 0, 100)
  197. drawRct(RM.x + 0.214, RM.y + 0.912, 0.016,0.020, 255, 255, 0, 100)
  198. drawRct(RM.x + 0.22, RM.y + 0.827, 0.004,0.040, 255, 255, 0, 100)
  199. drawRct(RM.x + 0.219, RM.y + 0.867, 0.006,0.025, 255, 255, 0, 100)
  200. drawRct(RM.x + 0.2175, RM.y + 0.892, 0.009,0.0215, 255, 255, 0, 100)
  201. else
  202. drawRct(RM.x + 0.2165, RM.y + 0.807, 0.011,0.020, 0, 0, 0, 150)
  203. drawRct(RM.x + 0.214, RM.y + 0.912, 0.016,0.020, 0, 0, 0, 150)
  204. drawRct(RM.x + 0.22, RM.y + 0.827, 0.004,0.040, 0, 0, 0, 150)
  205. drawRct(RM.x + 0.219, RM.y + 0.867, 0.006,0.025, 0, 0, 0, 150)
  206. drawRct(RM.x + 0.2175, RM.y + 0.892, 0.009,0.0215, 0, 0, 0, 150)
  207. end
  208. -- #### FRONT DAMAGE #### --
  209. if Bumper2 then
  210. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 255, 0, 0, 100)
  211. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.020, 255, 0, 0, 100)
  212. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.020, 255, 0, 0, 100)
  213. elseif Hangingbumper2 then
  214. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 255, 255, 0, 100)
  215. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.020, 255, 255, 0, 100)
  216. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.020, 255, 255, 0, 100)
  217. else
  218. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 0, 0, 0, 150)
  219. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.020, 0, 0, 0, 150)
  220. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.020, 0, 0, 0, 150)
  221. end
  222. if TyreBurst1 then
  223. drawRct(RM.x + 0.185, RM.y + 0.798, 0.015,0.040, 255, 0, 0, 100)
  224. else
  225. drawRct(RM.x + 0.185, RM.y + 0.798, 0.015,0.040, 0, 0, 0, 150)
  226. end
  227. if TyreBurst2 then
  228. drawRct(RM.x + 0.245, RM.y + 0.798, 0.015,0.040, 255, 0, 0, 100)
  229. else
  230. drawRct(RM.x + 0.245, RM.y + 0.798, 0.015,0.040, 0, 0, 0, 150)
  231. end
  232.  
  233. if lhighbeams == 1 and not LHeadlight then
  234. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 0, 153, 255, 100)
  235. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  236. elseif llightson == 1 and lhighbeams == 0 and not LHeadlight then
  237. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 102, 255, 51, 100)
  238. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  239. elseif LHeadlight then
  240. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 255, 0, 0, 100)
  241. if lhighbeams == 1 then
  242. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  243. elseif llightson == 1 and lhighbeams == 0 then
  244. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  245. else
  246. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  247. end
  248. else
  249. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 0, 0, 0, 150)
  250. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  251. end
  252. if rhighbeams == 1 and not RHeadlight then
  253. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 0, 153, 255, 100)
  254. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  255. elseif rlightson == 1 and rhighbeams == 0 and not RHeadlight then
  256. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 102, 255, 51, 100)
  257. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  258. elseif RHeadlight then
  259. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 255, 0, 0, 100)
  260. if rhighbeams == 1 then
  261. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  262. elseif rlightson == 1 and rhighbeams == 0 then
  263. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  264. else
  265. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  266. end
  267. else
  268. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 0, 0, 0, 150)
  269. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  270. end
  271. -- #### MIDDLE DAMAGE #### --
  272. if DoorDamagef1 then
  273. drawRct(RM.x + 0.185, RM.y + 0.839, 0.006,0.030, 255, 0, 0, 100)
  274. elseif WindowDamage1 then
  275. drawRct(RM.x + 0.185, RM.y + 0.839, 0.006,0.030, 0, 0, 0, 150)
  276. else
  277. drawRct(RM.x + 0.185, RM.y + 0.839, 0.006,0.030, 255, 255, 0, 100)
  278. end
  279. if DoorDamagef2 then
  280. drawRct(RM.x + 0.254, RM.y + 0.839, 0.006,0.030, 255, 0, 0, 100)
  281. elseif WindowDamage2 then
  282. drawRct(RM.x + 0.254, RM.y + 0.839, 0.006,0.030, 0, 0, 0, 150)
  283. else
  284. drawRct(RM.x + 0.254, RM.y + 0.839, 0.006,0.030, 255, 255, 0, 100)
  285. end
  286. if DoorDamagef3 then
  287. drawRct(RM.x + 0.185, RM.y + 0.869, 0.006,0.030, 255, 0, 0, 100)
  288. elseif WindowDamage3 then
  289. drawRct(RM.x + 0.185, RM.y + 0.869, 0.006,0.030, 0, 0, 0, 150)
  290. else
  291. drawRct(RM.x + 0.185, RM.y + 0.869, 0.006,0.030, 255, 255, 0, 100)
  292. end
  293. if DoorDamagef4 then
  294. drawRct(RM.x + 0.254, RM.y + 0.869, 0.006,0.030, 255, 0, 0, 100)
  295. elseif WindowDamage4 then
  296. drawRct(RM.x + 0.254, RM.y + 0.869, 0.006,0.030, 0, 0, 0, 150)
  297. else
  298. drawRct(RM.x + 0.254, RM.y + 0.869, 0.006,0.030, 255, 255, 0, 100)
  299. end
  300. if driverseat then
  301. drawRct(RM.x + 0.199, RM.y + 0.843, 0.011,0.020, 0, 255, 0, 050)
  302. elseif Passenger1 then
  303. drawRct(RM.x + 0.237, RM.y + 0.843, 0.011,0.020, 0, 255, 0, 050)
  304. elseif Passenger2 then
  305. drawRct(RM.x + 0.199, RM.y + 0.875, 0.011,0.020, 0, 255, 0, 050)
  306. elseif Passenger3 then
  307. drawRct(RM.x + 0.237, RM.y + 0.875, 0.011,0.020, 0, 255, 0, 050)
  308. end
  309. -- #### BACK DAMAGE #### --
  310. if Bumper1 then
  311. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 255, 0, 0, 100)
  312. drawRct(RM.x + 0.185, RM.y + 0.941, 0.006,0.020, 255, 0, 0, 100)
  313. drawRct(RM.x + 0.254, RM.y + 0.941, 0.006,0.020, 255, 0, 0, 100)
  314. elseif Hangingbumper1 then
  315. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 255, 255, 0, 100)
  316. drawRct(RM.x + 0.185, RM.y + 0.941, 0.006,0.020, 255, 255, 0, 100)
  317. drawRct(RM.x + 0.254, RM.y + 0.941, 0.006,0.020, 255, 255, 0, 100)
  318. else
  319. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 0, 0, 0, 150)
  320. drawRct(RM.x + 0.185, RM.y + 0.941, 0.006,0.020, 0, 0, 0, 150)
  321. drawRct(RM.x + 0.254, RM.y + 0.941, 0.006,0.020, 0, 0, 0, 150)
  322. end
  323. if TyreBurst3 then
  324. drawRct(RM.x + 0.185, RM.y + 0.900, 0.015,0.040, 255, 0, 0, 100)
  325. else
  326. drawRct(RM.x + 0.185, RM.y + 0.900, 0.015,0.040, 0, 0, 0, 150)
  327. end
  328. if TyreBurst4 then
  329. drawRct(RM.x + 0.245, RM.y + 0.900, 0.015,0.040, 255, 0, 0, 100)
  330. else
  331. drawRct(RM.x + 0.245, RM.y + 0.900, 0.015,0.040, 0, 0, 0, 150)
  332. end
  333. end
  334. -- #### END OF RACE MODE #### --
  335. -- #### DON'T TOUCH THIS #### --
  336. if HUD.RaceMode2 and HUD.RaceMode == false and PedHeli == false and PedPlane == false and PedBoat == false and PedBike == false then
  337. -- Roof
  338. -- #### ENGINE BLOCK DAMAGE #### --
  339. if (VehEngineHP > 0) and (VehEngineHP < EngineHpBroken) then
  340. drawRct(RM.x + 0.225, RM.y + 0.777, 0.017,0.024, 255, 0, 0, 150)
  341. drawRct(RM.x + 0.205, RM.y + 0.776, 0.009,0.024, 255, 0, 0, 150)
  342. drawRct(RM.x + 0.199, RM.y + 0.780, 0.0068,0.015, 255, 0, 0, 150)
  343. drawRct(RM.x + 0.214, RM.y + 0.778, 0.011,0.003, 255, 0, 0, 150)
  344. drawRct(RM.x + 0.214, RM.y + 0.782, 0.011,0.003, 255, 0, 0, 150)
  345. drawRct(RM.x + 0.214, RM.y + 0.786, 0.011,0.003, 255, 0, 0, 150)
  346. drawRct(RM.x + 0.214, RM.y + 0.790, 0.011,0.003, 255, 0, 0, 150)
  347. drawRct(RM.x + 0.214, RM.y + 0.794, 0.011,0.003, 255, 0, 0, 150)
  348. drawRct(RM.x + 0.218, RM.y + 0.769, 0.015,0.008, 255, 0, 0, 150)
  349. drawRct(RM.x + 0.23, RM.y + 0.801, 0.007,0.007, 255, 0, 0, 150)
  350. drawRct(RM.x + 0.21, RM.y + 0.802, 0.020,0.003, 255, 0, 0, 150)
  351. drawRct(RM.x + 0.21, RM.y + 0.800, 0.003,0.002, 255, 0, 0, 150)
  352. elseif (VehEngineHP > 111) and (VehEngineHP < EngineHpAlmostBroken) then
  353. drawRct(RM.x + 0.225, RM.y + 0.777, 0.017,0.024, 255, 255, 0, 150)
  354. drawRct(RM.x + 0.205, RM.y + 0.776, 0.009,0.024, 255, 255, 0, 150)
  355. drawRct(RM.x + 0.199, RM.y + 0.780, 0.0068,0.015, 255, 255, 0, 150)
  356. drawRct(RM.x + 0.214, RM.y + 0.778, 0.011,0.003, 255, 255, 0, 150)
  357. drawRct(RM.x + 0.214, RM.y + 0.782, 0.011,0.003, 255, 255, 0, 150)
  358. drawRct(RM.x + 0.214, RM.y + 0.786, 0.011,0.003, 255, 255, 0, 150)
  359. drawRct(RM.x + 0.214, RM.y + 0.790, 0.011,0.003, 255, 255, 0, 150)
  360. drawRct(RM.x + 0.214, RM.y + 0.794, 0.011,0.003, 255, 255, 0, 150)
  361. drawRct(RM.x + 0.218, RM.y + 0.769, 0.015,0.008, 255, 255, 0, 150)
  362. drawRct(RM.x + 0.23, RM.y + 0.801, 0.007,0.007, 255, 255, 0, 150)
  363. drawRct(RM.x + 0.21, RM.y + 0.802, 0.020,0.003, 255, 255, 0, 150)
  364. drawRct(RM.x + 0.21, RM.y + 0.800, 0.003,0.002, 255, 255, 0, 150)
  365. end
  366. -- #### FRONT DAMAGE #### --
  367. if Bumper2 then
  368. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 255, 0, 0, 100)
  369. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.040, 255, 0, 0, 100)
  370. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.040, 255, 0, 0, 100)
  371. elseif Hangingbumper2 then
  372. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 255, 255, 0, 100)
  373. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.040, 255, 255, 0, 100)
  374. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.040, 255, 255, 0, 100)
  375. else
  376. drawRct(RM.x + 0.20, RM.y + 0.755, 0.045,0.01, 0, 0, 0, 150)
  377. drawRct(RM.x + 0.254, RM.y + 0.777, 0.006,0.040, 0, 0, 0, 150)
  378. drawRct(RM.x + 0.185, RM.y + 0.777, 0.006,0.040, 0, 0, 0, 150)
  379. end
  380. if HoodDamagef then
  381. drawRct(RM.x + 0.206, RM.y + 0.766, 0.033,0.011, 255, 0, 0, 100)
  382. drawRct(RM.x + 0.192, RM.y + 0.777, 0.061,0.036, 255, 0, 0, 100)
  383. drawRct(RM.x + 0.192, RM.y + 0.813, 0.020,0.006, 255, 0, 0, 100)
  384. drawRct(RM.x + 0.233, RM.y + 0.813, 0.020,0.006, 255, 0, 0, 100)
  385. else
  386. drawRct(RM.x + 0.206, RM.y + 0.766, 0.033,0.011, 0, 0, 0, 150)
  387. drawRct(RM.x + 0.192, RM.y + 0.777, 0.061,0.036, 0, 0, 0, 150)
  388. drawRct(RM.x + 0.192, RM.y + 0.813, 0.020,0.006, 0, 0, 0, 150)
  389. drawRct(RM.x + 0.233, RM.y + 0.813, 0.020,0.006, 0, 0, 0, 150)
  390. end
  391. if lhighbeams == 1 and not LHeadlight then
  392. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 0, 153, 255, 100)
  393. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  394. elseif llightson == 1 and lhighbeams == 0 and not LHeadlight then
  395. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 102, 255, 51, 100)
  396. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  397. elseif LHeadlight then
  398. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 255, 0, 0, 100)
  399. if lhighbeams == 1 then
  400. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  401. elseif llightson == 1 and lhighbeams == 0 then
  402. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  403. else
  404. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  405. end
  406. else
  407. drawRct(RM.x + 0.185, RM.y + 0.766, 0.020,0.01, 0, 0, 0, 150)
  408. drawRct(RM.x + 0.185, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  409. end
  410. if rhighbeams == 1 and not RHeadlight then
  411. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 0, 153, 255, 100)
  412. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  413. elseif rlightson == 1 and rhighbeams == 0 and not RHeadlight then
  414. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 102, 255, 51, 100)
  415. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  416. elseif RHeadlight then
  417. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 255, 0, 0, 100)
  418. if rhighbeams == 1 then
  419. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  420. elseif rlightson == 1 and rhighbeams == 0 then
  421. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 242, 94, 13, 150)
  422. else
  423. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  424. end
  425. else
  426. drawRct(RM.x + 0.24, RM.y + 0.766, 0.020,0.01, 0, 0, 0, 150)
  427. drawRct(RM.x + 0.25, RM.y + 0.962, 0.01,0.01, 0, 0, 0, 150)
  428. end
  429. -- #### MIDDLE DAMAGE #### --
  430. if WindowDamage1 then
  431. drawRct(RM.x + 0.192, RM.y + 0.823, 0.0045,0.042, 179, 230, 255, 150)
  432. drawRct(RM.x + 0.1965, RM.y + 0.830, 0.0037,0.035, 179, 230, 255, 150)
  433. else
  434. drawRct(RM.x + 0.192, RM.y + 0.823, 0.0045,0.042, 255, 255, 0, 100)
  435. drawRct(RM.x + 0.1965, RM.y + 0.830, 0.0037,0.035, 255, 255, 0, 100)
  436. end
  437. if WindowDamage2 then
  438. drawRct(RM.x + 0.2485, RM.y + 0.823, 0.0045,0.042, 179, 230, 255, 150)
  439. drawRct(RM.x + 0.2445, RM.y + 0.830, 0.0039,0.035, 179, 230, 255, 150)
  440. else
  441. drawRct(RM.x + 0.2485, RM.y + 0.823, 0.0045,0.042, 255, 255, 0, 100)
  442. drawRct(RM.x + 0.2445, RM.y + 0.830, 0.0039,0.035, 255, 255, 0, 100)
  443. end
  444. if WindowDamage3 then
  445. drawRct(RM.x + 0.192, RM.y + 0.875, 0.0045,0.044, 179, 230, 255, 150)
  446. drawRct(RM.x + 0.1965, RM.y + 0.875, 0.0037,0.035, 179, 230, 255, 150)
  447. else
  448. drawRct(RM.x + 0.192, RM.y + 0.875, 0.0045,0.044, 255, 255, 0, 100)
  449. drawRct(RM.x + 0.1965, RM.y + 0.875, 0.0037,0.035, 255, 255, 0, 100)
  450. end
  451. if WindowDamage4 then
  452. drawRct(RM.x + 0.2485, RM.y + 0.875, 0.0045,0.044, 179, 230, 255, 150)
  453. drawRct(RM.x + 0.2445, RM.y + 0.875, 0.0039,0.035, 179, 230, 255, 150)
  454. else
  455. drawRct(RM.x + 0.2485, RM.y + 0.875, 0.0045,0.044, 255, 255, 0, 100)
  456. drawRct(RM.x + 0.2445, RM.y + 0.875, 0.0039,0.035, 255, 255, 0, 100)
  457. end
  458. if WindowDamage5 then
  459. drawRct(RM.x + 0.2120, RM.y + 0.813, 0.021,0.006, 179, 230, 255, 150)
  460. drawRct(RM.x + 0.197, RM.y + 0.8185, 0.051,0.0046, 179, 230, 255, 150)
  461. drawRct(RM.x + 0.201, RM.y + 0.823, 0.0425,0.0065, 179, 230, 255, 150)
  462. else
  463. drawRct(RM.x + 0.2120, RM.y + 0.813, 0.021,0.006, 255, 255, 0, 100)
  464. drawRct(RM.x + 0.197, RM.y + 0.8185, 0.051,0.0046, 255, 255, 0, 100)
  465. drawRct(RM.x + 0.201, RM.y + 0.823, 0.0425,0.0065, 255, 255, 0, 100)
  466. end
  467. if WindowDamage6 then
  468. drawRct(RM.x + 0.197, RM.y + 0.919, 0.051,0.010, 179, 230, 255, 150)
  469. drawRct(RM.x + 0.201, RM.y + 0.909, 0.043,0.010, 179, 230, 255, 150)
  470. else
  471. drawRct(RM.x + 0.197, RM.y + 0.919, 0.051,0.010, 255, 255, 0, 100)
  472. drawRct(RM.x + 0.201, RM.y + 0.909, 0.043,0.010, 255, 255, 0, 100)
  473. end
  474. if DoorDamagef1 then
  475. drawRct(RM.x + 0.185, RM.y + 0.819, 0.006,0.050, 255, 0, 0, 100)
  476. else
  477. drawRct(RM.x + 0.185, RM.y + 0.819, 0.006,0.050, 0, 0, 0, 150)
  478. end
  479. if DoorDamagef2 then
  480. drawRct(RM.x + 0.254, RM.y + 0.819, 0.006,0.050, 255, 0, 0, 100)
  481. else
  482. drawRct(RM.x + 0.254, RM.y + 0.819, 0.006,0.050, 0, 0, 0, 150)
  483. end
  484. if DoorDamagef3 then
  485. drawRct(RM.x + 0.185, RM.y + 0.870, 0.006,0.050, 255, 0, 0, 100)
  486. else
  487. drawRct(RM.x + 0.185, RM.y + 0.870, 0.006,0.050, 0, 0, 0, 150)
  488. end
  489. if DoorDamagef4 then
  490. drawRct(RM.x + 0.254, RM.y + 0.870, 0.006,0.050, 255, 0, 0, 100)
  491. else
  492. drawRct(RM.x + 0.254, RM.y + 0.870, 0.006,0.050, 0, 0, 0, 150)
  493. end
  494. -- #### BACK DAMAGE #### --
  495. if TrunkDamagef then
  496. drawRct(RM.x + 0.192, RM.y + 0.929, 0.061,0.031, 255, 0, 0, 100)
  497. else
  498. drawRct(RM.x + 0.192, RM.y + 0.929, 0.061,0.031, 0, 0, 0, 150)
  499. end
  500. if Bumper1 then
  501. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 255, 0, 0, 100)
  502. drawRct(RM.x + 0.185, RM.y + 0.921, 0.006,0.040, 255, 0, 0, 100)
  503. drawRct(RM.x + 0.254, RM.y + 0.921, 0.006,0.040, 255, 0, 0, 100)
  504. elseif Hangingbumper1 then
  505. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 255, 255, 0, 100)
  506. drawRct(RM.x + 0.185, RM.y + 0.921, 0.006,0.040, 255, 255, 0, 100)
  507. drawRct(RM.x + 0.254, RM.y + 0.921, 0.006,0.040, 255, 255, 0, 100)
  508. else
  509. drawRct(RM.x + 0.196, RM.y + 0.962, 0.053,0.01, 0, 0, 0, 150)
  510. drawRct(RM.x + 0.185, RM.y + 0.921, 0.006,0.040, 0, 0, 0, 150)
  511. drawRct(RM.x + 0.254, RM.y + 0.921, 0.006,0.040, 0, 0, 0, 150)
  512. end
  513. end
  514. -- #### END OF RACE MODE2 #### --
  515. if HUD.CarRPM and (model ~= 13) then
  516. drawRct(UI.x + 0.11, UI.y + 0.903, 0.046,0.03,0,0,0,150)
  517. drawTxt(UI.x + 0.61, UI.y + 1.37, 1.0,1.0,0.64 , "~w~" .. math.ceil(round(RPM, 2)*10000), 255, 255, 255, 255)
  518. drawTxt(UI.x + 0.636, UI.y + 1.402, 1.0,1.0,0.4, "~w~ RPM", 255, 255, 255, 255)
  519. end
  520.  
  521. if HUD.CarGears then
  522. if VehStopped and (Speed == 0) then
  523. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~N", 255, 0, 0, 255)
  524. elseif Gear < 1 then
  525. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~R", 255, 255, 255, 255)
  526. elseif Gear == 1 then
  527. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~1", 255, 255, 255, 255)
  528. elseif Gear == 2 then
  529. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~2", 255, 255, 255, 255)
  530. elseif Gear == 3 then
  531. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~3", 255, 255, 255, 255)
  532. elseif Gear == 4 then
  533. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~4", 255, 255, 255, 255)
  534. elseif Gear == 5 then
  535. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~5", 255, 255, 255, 255)
  536. elseif Gear == 6 then
  537. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~6", 255, 255, 255, 255)
  538. elseif Gear == 7 then
  539. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~7", 255, 255, 255, 255)
  540. elseif Gear == 8 then
  541. drawTxt2(UI.x + 0.628, UI.y + 1.430, 1.0,1.0,0.30, "~w~Bieg:~s~~g~8", 255, 255, 255, 255)
  542. end
  543. end
  544. if HUD.Engine then
  545.  
  546. pasy1 = "Silnik:"
  547.  
  548. SetTextFont(0)
  549. SetTextProportional(1)
  550. SetTextScale(0.90, 0.30)
  551. SetTextColour(255, 255, 255, 255)
  552. SetTextDropshadow(0, 0, 0, 0, 255)
  553. SetTextEdge(1, 0, 0, 0, 255)
  554. SetTextDropShadow()
  555. SetTextOutline()
  556. SetTextRightJustify(true)
  557. SetTextWrap(0.11,0.890) ----szerokosc
  558. SetTextEntry("STRING")
  559.  
  560. AddTextComponentString(pasy1)
  561. DrawText(0.01, 0.745) --- #wysokosc
  562.  
  563. end
  564. if HUD.Engine then
  565.  
  566. pasy = "Paliwo:"
  567.  
  568. SetTextFont(0)
  569. SetTextProportional(1)
  570. SetTextScale(0.90, 0.30)
  571. SetTextColour(255, 255, 255, 255)
  572. SetTextDropshadow(0, 0, 0, 0, 255)
  573. SetTextEdge(1, 0, 0, 0, 255)
  574. SetTextDropShadow()
  575. SetTextOutline()
  576. SetTextRightJustify(true)
  577. SetTextWrap(0.11,0.895)
  578. SetTextEntry("STRING")
  579.  
  580. AddTextComponentString(pasy)
  581. DrawText(0.19, 0.8339)
  582.  
  583. end
  584.  
  585. if HUD.Speed == 'kmh' then
  586. Speed = GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false)) * 3.6
  587. elseif HUD.Speed == 'mph' then
  588. Speed = GetEntitySpeed(GetVehiclePedIsIn(GetPlayerPed(-1), false)) * 2.236936
  589. else
  590. Speed = 0.0
  591. end
  592.  
  593. if HUD.Cruise then
  594. if cruisecolor == false then
  595. drawTxt(UI.x + 0.514, UI.y + 1.245, 1.0,1.0,0.45, "CRUISE", 255, 0, 0,200) -- Red
  596. else
  597. drawTxt(UI.x + 0.514, UI.y + 1.245, 1.0,1.0,0.45, "CRUISE", 0, 255, 0,200) -- Green
  598. end
  599. if IsControlJustPressed(0, cruisekey) and (Speed > 11) then -- F9
  600. cruisecolor = true
  601. elseif IsControlJustPressed( 0, 8) then -- S
  602. cruisecolor = false
  603. --elseif IsControlJustPressed( 0, 22) then -- SpaceBar
  604. --cruisecolor = false
  605. elseif (Speed > 0.0) and (Speed < 10) then -- Speed between 0 and 10 stays red
  606. cruisecolor = false
  607. elseif (VehEngineHP < 90) and (VehEngineHP > 101) then -- If the car is broken stays red
  608. cruisecolor = false
  609. elseif get_collision_veh then
  610. cruisecolor = false
  611. elseif carspeed ~= nil and (Speed < carspeed) then -- If you lose speed turns red, sometimes takes a little bit to detect
  612. cruisecolor = false
  613. end
  614. end
  615.  
  616. if HUD.Top then
  617. drawTxt(UI.x + 0.619, UI.y + 1.245, 1.0,1.0,0.45, "", 0, 255, 0,200)
  618.  
  619. if VehBurnout then
  620. drawTxt(UI.x + 0.660, UI.y + 1.166, 1.0,1.0,0.44, "", 255, 0, 0, 200)
  621. else
  622. drawTxt(UI.x + 0.660, UI.y + 1.166, 1.0,1.0,0.44, "", 255, 255, 255, 150)
  623. end
  624.  
  625. if (VehEngineHP > 0) and (VehEngineHP < EngineHpBroken) then
  626. drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 0, 0, 200) -- red
  627. drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 0, 0, 200)
  628. drawTxt(UI.x + 0.655, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 0, 0, 200)
  629. drawTxt(UI.x + 0.619, UI.y + 1.245, 1.0,1.0,0.45, "", 255, 0, 0, 200)
  630. elseif (VehEngineHP > 111) and (VehEngineHP < EngineHpAlmostBroken) then
  631. drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 0,200) -- yellow
  632. drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 0,200)
  633. drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 0,200)
  634. drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 0,200)
  635. drawTxt(UI.x + 0.619, UI.y + 1.245, 1.0,1.0,0.45, "", 255, 255, 0,200)
  636. else
  637. drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 255, 200)
  638. drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 255, 200)
  639. drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "", 255, 255, 255, 200)
  640. drawTxt(UI.x + 0.619, UI.y + 1.245, 1.0,1.0,0.45, "", 0, 255, 0,200)
  641. end
  642. if HUD.ParkIndicator then
  643. if VehStopped then
  644. drawTxt(UI.x + 0.6605, UI.y + 1.262, 1.0,1.0,0.6, "~r~P", 255, 255, 255, 200)
  645. else
  646. drawTxt(UI.x + 0.6605, UI.y + 1.262, 1.0,1.0,0.6, "P", 255, 255, 255, 150)
  647. end
  648. end
  649. else
  650. if HUD.Plate then
  651. drawTxt(UI.x + 0.61, UI.y + 1.385, 1.0,1.0,0.55, "~w~" .. PlateVeh, 255, 255, 255, 255)
  652. end
  653. if HUD.ParkIndicator then
  654.  
  655. if VehStopped then
  656. drawTxt(UI.x + 0.643, UI.y + 1.34, 1.0,1.0,0.6, "~r~P", 255, 255, 255, 200)
  657. else
  658. drawTxt(UI.x + 0.643, UI.y + 1.34, 1.0,1.0,0.6, "P", 255, 255, 255, 150)
  659. end
  660. end
  661. end
  662.  
  663. if HUD.Engine then
  664. if EngineRunning then
  665. drawTxt2(UI.x + 0.568, UI.y + 1.341, 1.0,1.0,0.30, "~g~Wł.", 255, 255, 255, 255) -- ENG green
  666. drawRct(RM.x + 0.860, RM.y + 0.746, 0.118,0.025, 0, 0, 0, 150)
  667. else
  668. drawTxt2(UI.x + 0.568, UI.y + 1.341, 1.0,1.0,0.30, "~r~Wył.", 255, 255, 255, 255)
  669. drawRct(RM.x + 0.860, RM.y + 0.746, 0.118,0.025, 0, 0, 0, 150)
  670. RPM = 0
  671. end
  672. end
  673.  
  674. if HUD.SpeedIndicator then
  675. drawRct(UI.x + 0.11, UI.y + 0.932, 0.046,0.03,0,0,0,0) -- Speed panel
  676. if HUD.Speed == 'kmh' then
  677. drawTxt(UI.x + 0.54, UI.y + 1.365, 1.0,1.0,0.90 , "~w~" .. math.ceil(Speed), 255, 255, 255, 255)
  678. drawTxt(UI.x + 0.580, UI.y + 1.365, 1.0,1.0,0.90, "~g~ km/h", 255, 255, 255, 255)
  679. elseif HUD.Speed == 'mph' then
  680. drawTxt(UI.x + 0.61, UI.y + 1.42, 1.0,1.0,0.64 , "~w~" .. math.ceil(Speed), 255, 255, 255, 255)
  681. drawTxt(UI.x + 0.633, UI.y + 1.432, 1.0,1.0,0.4, "~w~ mph", 255, 255, 255, 255)
  682. else
  683. drawTxt(UI.x + 0.81, UI.y + 1.42, 1.0,1.0,0.64 , [[Carhud ~r~ERROR~w~ ~c~in ~w~HUD Speed~c~ config (something else than ~y~'kmh'~c~ or ~y~'mph'~c~)]], 255, 255, 255, 255)
  684. end
  685. end
  686.  
  687. if HUD.DamageSystem then
  688. drawRct(UI.x + 0.189, UI.y + 0.809, 0.005,0.173,0,0,0,100)
  689. drawRct(UI.x + 0.1661, UI.y + 0.809, 0.005,0.173,0,0,0,100)
  690. drawRct(UI.x + 0.1661, UI.y + 0.809, 0.005,VehBodyHP/5800,0,0,0,100)
  691. drawRct(UI.x + 0.159, UI.y + 0.809, 0.005, VehEngineHP / 5800,0,0,0,100)
  692. end
  693.  
  694.  
  695. end
  696. end
  697. end)
  698.  
  699. --local function tyrebusrthud
  700. --local numWheels = GetVehicleNumberOfWheels(MyPedVeh)
  701. --local tyreBurst = GetVehicleTyresCanBurst(MyPedVeh)
  702. --end
  703.  
  704. function round(num, numDecimalPlaces)
  705. local mult = 10^(numDecimalPlaces or 0)
  706. return math.floor(num * mult + 0.5) / mult
  707. end
  708.  
  709. function drawTxt(x,y ,width,height,scale, text, r,g,b,a)
  710. SetTextFont(0)
  711. SetTextProportional()
  712. SetTextScale(scale, scale)
  713. SetTextColour(r, g, b, a)
  714. SetTextDropShadow(0, 0, 0, 0,255)
  715. SetTextEdge(2, 0, 0, 0, 255)
  716. SetTextDropShadow()
  717. SetTextOutline()
  718. SetTextEntry("STRING")
  719. AddTextComponentString(text)
  720. DrawText(x - width/2, y - height/2 + 0.005)
  721. end
  722. function drawTxt2(x,y ,width,height,scale, text, r,g,b,a)
  723. SetTextFont(0)
  724. SetTextProportional()
  725. SetTextScale(scale, scale)
  726. SetTextColour(r, g, b, a)
  727. SetTextDropShadow(0, 0, 0, 0,255)
  728. SetTextEdge(2, 0, 0, 0, 255)
  729. SetTextDropShadow()
  730. SetTextOutline()
  731. SetTextEntry("STRING")
  732. AddTextComponentString(text)
  733. DrawText(x - width/2, y - height/2 + 0.005)
  734. end
  735.  
  736. function drawRct(x,y,width,height,r,g,b,a)
  737. DrawRect(x + width/2, y + height/2, width, height, r, g, b, a)
  738. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement