Advertisement
Guest User

Untitled

a guest
May 31st, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.02 KB | None | 0 0
  1. Config = {}
  2.  
  3. Config.Framework = 'ESX'
  4. -- 'ESX' | 'QBCore' | undefined
  5.  
  6. -- Translation
  7.  
  8. Config.Translation = {
  9. ['enter_garage'] = 'Press %s to enter the garage', -- %s is the button
  10. ['open_parking'] = 'Press %s to open the parking lot',
  11. ['open_impound'] = 'Press %s to open the impound',
  12.  
  13. ['store_vehicle'] = 'Press %s to store the vehicle',
  14.  
  15. ['not_owner'] = 'You are not the owner of the vehicle',
  16. ['not_afford'] = 'You do not have enough money.',
  17.  
  18. -- UI
  19. ['garage_title'] = '%s Garage', -- %s is the title of the garage
  20. ['parkinglot_title'] = '%s Parking Lot', -- %s is the title of the parking lot
  21. ['refresh'] = 'Refresh',
  22. ['change_view'] = 'Change view',
  23. ['light_mode'] = 'Light mode',
  24. ['dark_mode'] = 'Dark mode',
  25. ['close'] = 'Close',
  26. ['drive_out'] = 'Drive out',
  27.  
  28. ['impound_free'] = 'Spawn vehicle',
  29. ['impound_buy'] = 'Pay %s$ and spawn vehicle',
  30. }
  31.  
  32. -- Vehicle Details
  33.  
  34. Config.VehicleDetails = {
  35. {
  36. label = 'Plate',
  37. type = 'text',
  38. prop = 'plate'
  39. },
  40. {
  41. label = 'Engine health',
  42. type = 'percentage',
  43. max = 1000,
  44. prop = 'engineHealth'
  45. },
  46. {
  47. label = 'Body health',
  48. type = 'percentage',
  49. max = 1000,
  50. prop = 'bodyHealth'
  51. },
  52. {
  53. label = 'Fuel level',
  54. type = 'percentage',
  55. max = 100,
  56. prop = 'fuelLevel'
  57. },
  58. }
  59.  
  60. -- Enter options
  61. -- This is used when you enter the garage and open the impound.
  62.  
  63. Config.EnterKey = {
  64. index = 38,
  65. name = 'INPUT_CONTEXT'
  66. }
  67.  
  68. Config.EnterAnim = {
  69. dict = 'anim@apt_trans@garage',
  70. anim = 'gar_open_1_right',
  71. startTime = 0.24
  72. }
  73.  
  74. Config.EnterDistance = {
  75. on_foot = 2.0,
  76. in_vehicle = 5.0
  77. }
  78.  
  79. -- Interiors
  80. -- This is the background while you are inside a garage.
  81.  
  82. Config.DefaultInterior = 'low';
  83. Config.Interiors = {
  84. ['low'] = {
  85. coords = vector3(177.61, -1007.26, -98.9),
  86. rotation = vector3(0, 0, 45)
  87. },
  88. ['mid'] = {
  89. coords = vector3(191.78, -1001.44, -99.0),
  90. rotation = vector3(0, 0, -90)
  91. },
  92. ['mid2'] = {
  93. coords = vector3(192.0, -1020.26, -98.9),
  94. rotation = vector3(0, 0, -90)
  95. },
  96. ['high'] = {
  97. coords = vector3(228.3, -1003.1, -98.9),
  98. rotation = vector3(0, 0, 0)
  99. },
  100. ['tuner'] = {
  101. coords = vector3(996.6, -2994.4, -38.0),
  102. rotation = vector3(0, 0, 120)
  103. },
  104. ['parking_garage'] = {
  105. coords = vector3(1306.8, 260.4, -48.0),
  106. rotation = vector3(0, 0, 140)
  107. }
  108. }
  109.  
  110. -- Images
  111. -- These images are for the vehicles.
  112.  
  113. -- This is just an example. I can not assure you that the API will work forever, but it worked when I did this.
  114. -- This example does not work for all vehicles. If you have a better API you can easily replace it.
  115. -- Do not touch this if you do not know how it works.
  116.  
  117. Config.ImageAPI = {
  118. url = function(modelHash, modelName, modelLabel)
  119. return ('https://gta.now.sh/api/vehicles/%s'):format(modelLabel:lower())
  120. end,
  121. callback = function(result)
  122. return result.images and result.images['frontQuarter'] or false
  123. end
  124. }
  125.  
  126. Config.Images = { -- Here you can add your images for models.
  127. -- Example
  128. -- ['rmodsupra'] = 'https://libertycity.net/uploads/download/gta5_toyota/fulls/f0b94mbi94gqu2848t03eqaas4/1498320350941_14902102306952_1.jpg'
  129.  
  130. ['baller2'] = 'https://i.imgur.com/twz773F.png',
  131. ['dubsta3'] = 'https://i.imgur.com/gRJeu00.png',
  132. ['elegy2'] = 'https://i.imgur.com/tXAFkee.png'
  133. }
  134.  
  135. -- Vehicle Labels
  136. -- Some of your addons vehicles may not have a label, here you can add your labels. These will also override the default labels.
  137.  
  138. Config.VehicleLabels = {
  139. -- Example
  140. -- ['rmodsupra'] = 'Toyota Supra'
  141. }
  142.  
  143. -- Hide HUD
  144. -- You can add your exports and events here. The boolean will be true when you enter the garage and false when you leave it.
  145.  
  146. Config.HideHUD = function(boolean)
  147. DisplayRadar(not boolean);
  148.  
  149. if Config.Framework == 'ESX' then
  150.  
  151. elseif Config.Framework == 'QBCore' then
  152.  
  153. end
  154.  
  155. TriggerEvent('esx_status:setDisplay', boolean and 0.0 or 0.5)
  156. end
  157.  
  158. -- Check if owner of vehicle
  159. -- You can add other criteria, for example that you need a key for the vehicle instead of being owner.
  160. -- ! This only works for ESX and QBCore !
  161.  
  162. Config.DisableVehicleCheck = true -- If false it will check if you are the owner
  163. Config.VehicleCheck = function(plate, owner, identifier, vehicle, player)
  164. return owner == identifier
  165. end
  166.  
  167. -- Check if player has the job
  168. Config.JobCheck = function(job)
  169. if Config.Framework == 'ESX' then
  170. return ESX.PlayerData.job.name == job
  171. elseif Config.Framework == 'QBCore' then
  172. return QBCore.playerJob.name == job
  173. else
  174. -- standalone
  175.  
  176. return true
  177. end
  178. end
  179.  
  180. Config.ShowBlipForEveryone = false -- If true the blips with required jobs will not be shown for people without the job
  181.  
  182. -- Notification
  183.  
  184. Config.Notification = function(source, text)
  185. if Config.Framework == 'ESX' then
  186. TriggerClientEvent('esx:showNotification', source, text)
  187. elseif Config.Framework == 'QBCore' then
  188. TriggerClientEvent('QBCore:Notify', source, text)
  189. end
  190. end
  191.  
  192. -- Vehicle Props
  193. -- This is only extra props if you are using ESX or QBCore.
  194. -- These props can also be used in Config.VehicleDetails. If you want a specific detail about a vehicle you can save the prop here.
  195.  
  196. Config.GetVehicleProps = function(props, vehicle)
  197. props.wheelHealth = {}
  198. props.tireBurst = {}
  199. props.tireCompletelyBurst = {}
  200. props.smashedWindows = {}
  201. props.brokenDoors = {}
  202.  
  203. props.engineHealth = GetVehicleEngineHealth(vehicle)
  204. props.bodyHealth = GetVehicleBodyHealth(vehicle)
  205. props.fuelLevel = GetVehicleFuelLevel(vehicle)
  206.  
  207. for i = 0, 3 do
  208. props.wheelHealth[i] = GetVehicleWheelHealth(vehicle, i)
  209. end
  210.  
  211. for i = 0, 5 do
  212. props.tireBurst[i] = IsVehicleTyreBurst(vehicle, i, false)
  213. end
  214.  
  215. for i = 0, 5 do
  216. props.tireCompletelyBurst[i] = IsVehicleTyreBurst(vehicle, i, true)
  217. end
  218.  
  219. for i = 0, 7 do
  220. props.smashedWindows[i] = IsVehicleWindowIntact(vehicle, i) ~= 1
  221. end
  222.  
  223. for i = 0, 5 do
  224. props.brokenDoors[i] = IsVehicleDoorDamaged(vehicle, i) == 1
  225. end
  226. end
  227.  
  228. Config.SetVehicleProps = function(props, vehicle)
  229. if Config.Framework == 'QBCore' then
  230. TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(vehicle))
  231. end
  232.  
  233. SetVehicleEngineHealth(vehicle, props.engineHealth and props.engineHealth + 0.0 or 1000.0)
  234. SetVehicleBodyHealth(vehicle, props.bodyHealth and props.bodyHealth + 0.0 or 1000.0)
  235. SetVehicleFuelLevel(vehicle, props.fuelLevel and props.fuelLevel + 0.0 or 100.0)
  236.  
  237. if props.wheelHealth then
  238. for wheelIndex, health in pairs(props.wheelHealth) do
  239. SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
  240. end
  241. end
  242.  
  243. if props.tireBurst then
  244. for wheelIndex, burstState in pairs(props.tireBurst) do
  245. if burstState then
  246. SetVehicleTyreBurst(vehicle, tonumber(wheelIndex), false, 1000.0)
  247. end
  248. end
  249. end
  250.  
  251. if props.tireCompletelyBurst then
  252. for wheelIndex, burstState in pairs(props.tireCompletelyBurst) do
  253. if burstState then
  254. SetVehicleTyreBurst(vehicle, tonumber(wheelIndex), true, 1000.0)
  255. end
  256. end
  257. end
  258.  
  259. if props.smashedWindows then
  260. for windowIndex, smashWindow in pairs(props.smashedWindows) do
  261. if smashWindow then
  262. SmashVehicleWindow(vehicle, tonumber(windowIndex))
  263. end
  264. end
  265. end
  266.  
  267. if props.brokenDoors then
  268. for doorIndex, breakDoor in pairs(props.brokenDoors) do
  269. if breakDoor and GetIsDoorValid(vehicle, tonumber(doorIndex)) then
  270. SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true)
  271. end
  272. end
  273. end
  274. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement