Advertisement
Guest User

client.lua

a guest
Apr 11th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.38 KB | None | 0 0
  1. --[[
  2. FiveM Scripts
  3. Copyright C 2018 Sighmir
  4.  
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU Affero General Public License as published
  7. by the Free Software Foundation, either version 3 of the License, or
  8. at your option any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU Affero General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Affero General Public License
  16. along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ]]
  18.  
  19.  
  20. vRP = Proxy.getInterface("vRP")
  21. vRPg = Proxy.getInterface("vRP_garages")
  22.  
  23. function deleteVehiclePedIsIn()
  24. local v = GetVehiclePedIsIn(GetPlayerPed(-1),false)
  25. SetVehicleHasBeenOwnedByPlayer(v,false)
  26. Citizen.InvokeNative(0xAD738C3085FE7E11, v, false, true) -- set not as mission entity
  27. SetVehicleAsNoLongerNeeded(Citizen.PointerValueIntInitialized(v))
  28. Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(v))
  29. end
  30.  
  31. local vehshop = {
  32. opened = false,
  33. title = "Simeon Showroom",
  34. currentmenu = "main",
  35. lastmenu = nil,
  36. currentpos = nil,
  37. selectedbutton = 0,
  38. marker = { r = 0, g = 155, b = 255, a = 200, type = 1 },
  39. menu = {
  40. x = 0.1,
  41. y = 0.08,
  42. width = 0.2,
  43. height = 0.04,
  44. buttons = 10,
  45. from = 1,
  46. to = 10,
  47. scale = 0.4,
  48. font = 0,
  49. ["main"] = {
  50. title = "CATEGORIES",
  51. name = "main",
  52. buttons = {
  53. {name = "mercedes-benz", description = ''},
  54. {name = "bmw", description = ''},
  55. {name = "lamborghini", description = ''},
  56. {name = "audi", description = ''},
  57. {name = "porsche", description = ''},
  58. {name = "andet", description = ''},
  59. }
  60. },
  61. ["mercedes-benz"] = {
  62. title = "mercedes-benz",
  63. name = "mercedes-benz",
  64. buttons = {
  65. {name = "Mercedes-Benz G65 AMG", costs = 3000000, description = {}, model = "g65amg"},
  66. {name = "Mercedes-Benz CLS63S", costs = 2500000, description = {}, model = "CLS63S"},
  67. }
  68. },
  69. ["bmw"] = {
  70. title = "bmw",
  71. name = "bmw",
  72. buttons = {
  73. {name = "BMW i8", costs = 10000000, description = {}, model = "i8"},
  74. {name = "BMW M5 2019 Competiotion", costs = 4500000, description {}, model = "2019M5",
  75. }
  76. },
  77. ["lamborghini"] = {
  78. title = "lamborghini",
  79. name = "lamborghini",
  80. buttons = {
  81. {name = "Lamborghini Huracan Performante", costs = 5000000, description = {}, model = "18performante"},
  82. {name = "Lamborghini Urus", costs = 6500000, description = {}, model = "urus"},
  83. }
  84. },
  85. ["audi"] = {
  86. title = "audi",
  87. name = "audi",
  88. buttons = {
  89. {name = "Audi S5", costs = 2500000, description = {}, model = "sentinel"},
  90. {name = "Audi C7 RS6", costs = 3000000, description = {}, model = "rs6"},
  91. {name = "Audi R8", costs = 4500000, description = {}, model = "r8v10"},
  92. }
  93. },
  94. ["porsche"] = {
  95. title = "porsche",
  96. name = "porsche",
  97. buttons = {
  98. {name = "Porsche Cayenne", costs = 3500000, description = {}, model = "pct18"},
  99. {name = "Porsche Panamera", costs = 3500000, description = {}, model = "panamera18"},
  100. }
  101. },
  102. ["andet"] = {
  103. title = "andet",
  104. name = "andet",
  105. buttons = {
  106. {name = "Bugatti Veyron Limited Version", costs = 30000000, description = {}, model = "supersport"},
  107. {name = "Jeep Demon Hawk", costs = 2500000, description = {}, model = "demonhawk",
  108. {name = "Ferrari LaFerrari", costs = 1500000, description = {}, model = "aperta",
  109. {name = "Lamborghini ????", costs = 30000000, description = {}, model = "lamtmc",
  110. {name = "Peugeot RCZ 2016", costs = 500000, description {}, model = "rcz16",
  111. {name = "Range Rover ????", costs = 3000000, description {}, model = "rrst",
  112. {name = "Rolls Royce ????", costs = 5000000, description {}, model = "rculi",
  113. {name = "Rolls Royce CP", costs = 5500000, description {}, model = "RollsRoyceCP",
  114. {name = "Toyota Camry 2018", costs = 1000000, description {}, model = "camry18",
  115. {name = "Ferrari Spyder 250", costs = 30000000, description {}, model = "cali57",
  116. {name = "Ford ????", costs 1500000, description {}, model = "00f350dually",
  117. }
  118. },
  119. }
  120. }
  121. local fakecar = {model = '', car = nil}
  122. local vehshop_locations = {
  123. {entering = {-33.803,-1102.322,25.422}, inside = {-46.56327,-1097.382,25.99875, 120.1953}, outside = {-31.849,-1090.648,25.998,322.345}},
  124. }
  125.  
  126. local vehshop_blips ={}
  127. local inrangeofvehshop = false
  128. local currentlocation = nil
  129. local boughtcar = false
  130.  
  131. function vehSR_drawTxt(text,font,centre,x,y,scale,r,g,b,a)
  132. SetTextFont(font)
  133. SetTextProportional(0)
  134. SetTextScale(scale, scale)
  135. SetTextColour(r, g, b, a)
  136. SetTextDropShadow(0, 0, 0, 0,255)
  137. SetTextEdge(1, 0, 0, 0, 255)
  138. SetTextDropShadow()
  139. SetTextOutline()
  140. SetTextCentre(centre)
  141. SetTextEntry("STRING")
  142. AddTextComponentString(text)
  143. DrawText(x , y)
  144. end
  145.  
  146. function vehSR_IsPlayerInRangeOfVehshop()
  147. return inrangeofvehshop
  148. end
  149.  
  150. local firstspawn = 0
  151. AddEventHandler('playerSpawned', function(spawn)
  152. if firstspawn == 0 then
  153. --326 car blip 227 225
  154. vehSR_ShowVehshopBlips(true)
  155. firstspawn = 1
  156. end
  157. end)
  158.  
  159. function vehSR_ShowVehshopBlips(bool)
  160. if bool and #vehshop_blips == 0 then
  161. for station,pos in pairs(vehshop_locations) do
  162. local loc = pos
  163. pos = pos.entering
  164. local blip = AddBlipForCoord(pos[1],pos[2],pos[3])
  165. -- 60 58 137
  166. SetBlipSprite(blip,326)
  167. BeginTextCommandSetBlipName("STRING")
  168. AddTextComponentString("Simeon Showroom")
  169. EndTextCommandSetBlipName(blip)
  170. SetBlipAsShortRange(blip,true)
  171. SetBlipAsMissionCreatorBlip(blip,true)
  172. table.insert(vehshop_blips, {blip = blip, pos = loc})
  173. end
  174. Citizen.CreateThread(function()
  175. while #vehshop_blips > 0 do
  176. Citizen.Wait(0)
  177. local inrange = false
  178. for i,b in ipairs(vehshop_blips) do
  179. if IsPlayerWantedLevelGreater(GetPlayerIndex(),0) == false and vehshop.opened == false and IsPedInAnyVehicle(vehSR_LocalPed(), true) == false and GetDistanceBetweenCoords(b.pos.entering[1],b.pos.entering[2],b.pos.entering[3],GetEntityCoords(vehSR_LocalPed())) < 5 then
  180. DrawMarker(1,b.pos.entering[1],b.pos.entering[2],b.pos.entering[3],0,0,0,0,0,0,2.001,2.0001,0.5001,0,155,255,200,0,0,0,0)
  181. vehSR_drawTxt("Tryk ~g~ENTER~s~ for at købe et ~b~køretøj",0,1,0.5,0.8,0.6,255,255,255,255)
  182. currentlocation = b
  183. inrange = true
  184. end
  185. end
  186. inrangeofvehshop = inrange
  187. end
  188. end)
  189. elseif bool == false and #vehshop_blips > 0 then
  190. for i,b in ipairs(vehshop_blips) do
  191. if DoesBlipExist(b.blip) then
  192. SetBlipAsMissionCreatorBlip(b.blip,false)
  193. Citizen.InvokeNative(0x86A652570E5F25DD, Citizen.PointerValueIntInitialized(b.blip))
  194. end
  195. end
  196. vehshop_blips = {}
  197. end
  198. end
  199.  
  200. function vehSR_f(n)
  201. return n + 0.0001
  202. end
  203.  
  204. function vehSR_LocalPed()
  205. return GetPlayerPed(-1)
  206. end
  207.  
  208. function vehSR_try(f, catch_f)
  209. local status, exception = pcall(f)
  210. if not status then
  211. catch_f(exception)
  212. end
  213. end
  214. function vehSR_firstToUpper(str)
  215. return (str:gsub("^%l", string.upper))
  216. end
  217. --local veh = nil
  218. function vehSR_OpenCreator()
  219. boughtcar = false
  220. local ped = vehSR_LocalPed()
  221. local pos = currentlocation.pos.inside
  222. FreezeEntityPosition(ped,true)
  223. SetEntityVisible(ped,false)
  224. local g = Citizen.InvokeNative(0xC906A7DAB05C8D2B,pos[1],pos[2],pos[3],Citizen.PointerValueFloat(),0)
  225. SetEntityCoords(ped,pos[1],pos[2],g)
  226. SetEntityHeading(ped,pos[4])
  227. vehshop.currentmenu = "main"
  228. vehshop.opened = true
  229. vehshop.selectedbutton = 0
  230. end
  231. local vehicle_price = 0
  232. function vehSR_CloseCreator(vehicle,veh_type)
  233. Citizen.CreateThread(function()
  234. local ped = vehSR_LocalPed()
  235. if not boughtcar then
  236. local pos = currentlocation.pos.entering
  237. SetEntityCoords(ped,pos[1],pos[2],pos[3])
  238. FreezeEntityPosition(ped,false)
  239. SetEntityVisible(ped,true)
  240. else
  241. deleteVehiclePedIsIn()
  242. vRP.teleport({-44.21378326416,-1079.1402587891,26.67050743103})
  243. vRPg.spawnBoughtVehicle({veh_type, vehicle})
  244. SetEntityVisible(ped,true)
  245. FreezeEntityPosition(ped,false)
  246. end
  247. vehshop.opened = false
  248. vehshop.menu.from = 1
  249. vehshop.menu.to = 10
  250. end)
  251. end
  252.  
  253. function vehSR_drawMenuButton(button,x,y,selected)
  254. local menu = vehshop.menu
  255. SetTextFont(menu.font)
  256. SetTextProportional(0)
  257. SetTextScale(menu.scale, menu.scale)
  258. if selected then
  259. SetTextColour(0, 0, 0, 255)
  260. else
  261. SetTextColour(255, 255, 255, 255)
  262. end
  263. SetTextCentre(0)
  264. SetTextEntry("STRING")
  265. AddTextComponentString(button.name)
  266. if selected then
  267. DrawRect(x,y,menu.width,menu.height,255,255,255,255)
  268. else
  269. DrawRect(x,y,menu.width,menu.height,0,0,0,150)
  270. end
  271. DrawText(x - menu.width/2 + 0.005, y - menu.height/2 + 0.0028)
  272. end
  273.  
  274. function vehSR_drawMenuTitle(txt,x,y)
  275. local menu = vehshop.menu
  276. SetTextFont(2)
  277. SetTextProportional(0)
  278. SetTextScale(0.5, 0.5)
  279. SetTextColour(255, 255, 255, 255)
  280. SetTextEntry("STRING")
  281. AddTextComponentString(txt)
  282. DrawRect(x,y,menu.width,menu.height,0,0,0,150)
  283. DrawText(x - menu.width/2 + 0.005, y - menu.height/2 + 0.0028)
  284. end
  285. function vehSR_tablelength(T)
  286. local count = 0
  287. for _ in pairs(T) do count = count + 1 end
  288. return count
  289. end
  290. function vehSR_Notify(text)
  291. SetNotificationTextEntry('STRING')
  292. AddTextComponentString(text)
  293. DrawNotification(false, false)
  294. end
  295.  
  296. function vehSR_drawMenuRight(txt,x,y,selected)
  297. local menu = vehshop.menu
  298. SetTextFont(menu.font)
  299. SetTextProportional(0)
  300. SetTextScale(menu.scale, menu.scale)
  301. if selected then
  302. SetTextColour(0, 0, 0, 255)
  303. else
  304. SetTextColour(255, 255, 255, 255)
  305. end
  306. SetTextCentre(0)
  307. SetTextEntry("STRING")
  308. AddTextComponentString(txt)
  309. DrawText(x + menu.width/2 - 0.06, y - menu.height/2 + 0.0028)
  310. end
  311. local backlock = false
  312. Citizen.CreateThread(function()
  313. local last_dir
  314. while true do
  315. Citizen.Wait(0)
  316. if IsControlJustPressed(1,201) and vehSR_IsPlayerInRangeOfVehshop() then
  317. if vehshop.opened then
  318. vehSR_CloseCreator("","")
  319. else
  320. vehSR_OpenCreator()
  321. end
  322. end
  323. if vehshop.opened then
  324. local ped = vehSR_LocalPed()
  325. local menu = vehshop.menu[vehshop.currentmenu]
  326. vehSR_drawTxt(vehshop.title,1,1,vehshop.menu.x,vehshop.menu.y,1.0, 255,255,255,255)
  327. vehSR_drawMenuTitle(menu.title, vehshop.menu.x,vehshop.menu.y + 0.08)
  328. vehSR_drawTxt(vehshop.selectedbutton.."/"..vehSR_tablelength(menu.buttons),0,0,vehshop.menu.x + vehshop.menu.width/2 - 0.0385,vehshop.menu.y + 0.067,0.4, 255,255,255,255)
  329. local y = vehshop.menu.y + 0.12
  330. buttoncount = vehSR_tablelength(menu.buttons)
  331. local selected = false
  332.  
  333. for i,button in pairs(menu.buttons) do
  334. if i >= vehshop.menu.from and i <= vehshop.menu.to then
  335.  
  336. if i == vehshop.selectedbutton then
  337. selected = true
  338. else
  339. selected = false
  340. end
  341. vehSR_drawMenuButton(button,vehshop.menu.x,y,selected)
  342. if button.costs ~= nil then
  343. if vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" or vehshop.currentmenu == "mercedes-benz" or vehshop.currentmenu == "bmw" or vehshop.currentmenu == "lamborghini" or vehshop.currentmenu == "audi" or vehshop.currentmenu == "porsche" or vehshop.currentmenu == "andet" then
  344. vehSR_drawMenuRight(button.costs.."$",vehshop.menu.x,y,selected)
  345. else
  346. vehSR_drawMenuButton(button,vehshop.menu.x,y,selected)
  347. end
  348. end
  349. y = y + 0.04
  350. if vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" or vehshop.currentmenu == "mercedes-benz" or vehshop.currentmenu == "bmw" or vehshop.currentmenu == "lamborghini" or vehshop.currentmenu == "audi" or vehshop.currentmenu == "porsche" or vehshop.currentmenu == "andet" then
  351. if selected then
  352. if fakecar.model ~= button.model then
  353. if DoesEntityExist(fakecar.car) then
  354. Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
  355. end
  356. local pos = currentlocation.pos.inside
  357. local hash = GetHashKey(button.model)
  358. RequestModel(hash)
  359. local timer = 0
  360. while not HasModelLoaded(hash) and timer < 255 do
  361. Citizen.Wait(1)
  362. vehSR_drawTxt("Loader...",0,1,0.5,0.5,1.5,255,255-timer,255-timer,255)
  363. RequestModel(hash)
  364. timer = timer + 1
  365. end
  366. if timer < 255 then
  367. local veh = CreateVehicle(hash,pos[1],pos[2],pos[3],pos[4],false,false)
  368. while not DoesEntityExist(veh) do
  369. Citizen.Wait(1)
  370. vehSR_drawTxt("Loader...",0,1,0.5,0.5,1.5,255,255-timer,255-timer,255)
  371. end
  372. FreezeEntityPosition(veh,true)
  373. SetEntityInvincible(veh,true)
  374. SetVehicleDoorsLocked(veh,4)
  375. --SetEntityCollision(veh,false,false)
  376. TaskWarpPedIntoVehicle(vehSR_LocalPed(),veh,-1)
  377. for i = 0,24 do
  378. SetVehicleModKit(veh,0)
  379. RemoveVehicleMod(veh,i)
  380. end
  381. fakecar = { model = button.model, car = veh}
  382. else
  383. timer = 0
  384. while timer < 50 do
  385. Citizen.Wait(1)
  386. vehSR_drawTxt("Failed!",0,1,0.5,0.5,1.5,255,0,0,255)
  387. timer = timer + 1
  388. end
  389. if last_dir then
  390. if vehshop.selectedbutton < buttoncount then
  391. vehshop.selectedbutton = vehshop.selectedbutton +1
  392. if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
  393. vehshop.menu.to = vehshop.menu.to + 1
  394. vehshop.menu.from = vehshop.menu.from + 1
  395. end
  396. else
  397. last_dir = false
  398. vehshop.selectedbutton = vehshop.selectedbutton -1
  399. if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
  400. vehshop.menu.from = vehshop.menu.from -1
  401. vehshop.menu.to = vehshop.menu.to - 1
  402. end
  403. end
  404. else
  405. if vehshop.selectedbutton > 1 then
  406. vehshop.selectedbutton = vehshop.selectedbutton -1
  407. if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
  408. vehshop.menu.from = vehshop.menu.from -1
  409. vehshop.menu.to = vehshop.menu.to - 1
  410. end
  411. else
  412. last_dir = true
  413. vehshop.selectedbutton = vehshop.selectedbutton +1
  414. if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
  415. vehshop.menu.to = vehshop.menu.to + 1
  416. vehshop.menu.from = vehshop.menu.from + 1
  417. end
  418. end
  419. end
  420. end
  421. end
  422. end
  423. end
  424. if selected and IsControlJustPressed(1,201) then
  425. vehSR_ButtonSelected(button)
  426. end
  427. end
  428. end
  429. if IsControlJustPressed(1,202) then
  430. vehSR_Back()
  431. end
  432. if IsControlJustReleased(1,202) then
  433. backlock = false
  434. end
  435. if IsControlJustPressed(1,188) then
  436. last_dir = false
  437. if vehshop.selectedbutton > 1 then
  438. vehshop.selectedbutton = vehshop.selectedbutton -1
  439. if buttoncount > 10 and vehshop.selectedbutton < vehshop.menu.from then
  440. vehshop.menu.from = vehshop.menu.from -1
  441. vehshop.menu.to = vehshop.menu.to - 1
  442. end
  443. end
  444. end
  445. if IsControlJustPressed(1,187)then
  446. last_dir = true
  447. if vehshop.selectedbutton < buttoncount then
  448. vehshop.selectedbutton = vehshop.selectedbutton +1
  449. if buttoncount > 10 and vehshop.selectedbutton > vehshop.menu.to then
  450. vehshop.menu.to = vehshop.menu.to + 1
  451. vehshop.menu.from = vehshop.menu.from + 1
  452. end
  453. end
  454. end
  455. end
  456.  
  457. end
  458. end)
  459.  
  460.  
  461. function vehSR_round(num, idp)
  462. if idp and idp>0 then
  463. local mult = 10^idp
  464. return math.floor(num * mult + 0.5) / mult
  465. end
  466. return math.floor(num + 0.5)
  467. end
  468. function vehSR_ButtonSelected(button)
  469. local ped = GetPlayerPed(-1)
  470. local this = vehshop.currentmenu
  471. local btn = button.name
  472. if this == "main" then
  473. if btn == "mercedes-benz" then
  474. vehSR_OpenMenu('mercedes-benz')
  475. elseif btn == "bmw" then
  476. vehSR_OpenMenu('bmw')
  477. elseif btn == "lamborghini" then
  478. vehSR_OpenMenu('lamborghini')
  479. elseif btn == "audi" then
  480. vehSR_OpenMenu('audi')
  481. elseif btn == "porsche" then
  482. vehSR_OpenMenu('porsche')
  483. elseif btn == "andet" then
  484. vehSR_OpenMenu('andet')
  485. end
  486. elseif this == "compacts" or this == "coupes" or this == "sedans" or this == "sports" or this == "sportsclassics" or this == "supers" or this == "muscle" or this == "offroad" or this == "suvs" or this == "vans" or this == "industrial" or this == "mercedes-benz" or this == "bmw" or this == "lamborghini" or this == "audi" or this "porsche" or this "andet" then
  487. TriggerServerEvent('veh_SR:CheckMoneyForVeh',button.model,button.costs, "car")
  488. elseif this == "cycles" or this == "motorcycles" then
  489. TriggerServerEvent('veh_SR:CheckMoneyForVeh',button.model,button.costs, "bike")
  490. end
  491. end
  492.  
  493. RegisterNetEvent('veh_SR:CloseMenu')
  494. AddEventHandler('veh_SR:CloseMenu', function(vehicle, veh_type)
  495. boughtcar = true
  496. vehSR_CloseCreator(vehicle,veh_type)
  497. end)
  498.  
  499. function vehSR_OpenMenu(menu)
  500. fakecar = {model = '', car = nil}
  501. vehshop.lastmenu = vehshop.currentmenu
  502. if menu == "vehicles" then
  503. vehshop.lastmenu = "main"
  504. elseif menu == "bikes" then
  505. vehshop.lastmenu = "main"
  506. elseif menu == 'race_create_objects' then
  507. vehshop.lastmenu = "main"
  508. elseif menu == "race_create_objects_spawn" then
  509. vehshop.lastmenu = "race_create_objects"
  510. end
  511. vehshop.menu.from = 1
  512. vehshop.menu.to = 10
  513. vehshop.selectedbutton = 0
  514. vehshop.currentmenu = menu
  515. end
  516.  
  517.  
  518. function vehSR_Back()
  519. if backlock then
  520. return
  521. end
  522. backlock = true
  523. if vehshop.currentmenu == "main" then
  524. vehSR_CloseCreator("","")
  525. elseif vehshop.currentmenu == "compacts" or vehshop.currentmenu == "coupes" or vehshop.currentmenu == "sedans" or vehshop.currentmenu == "sports" or vehshop.currentmenu == "sportsclassics" or vehshop.currentmenu == "supers" or vehshop.currentmenu == "muscle" or vehshop.currentmenu == "offroad" or vehshop.currentmenu == "suvs" or vehshop.currentmenu == "vans" or vehshop.currentmenu == "industrial" or vehshop.currentmenu == "cycles" or vehshop.currentmenu == "motorcycles" or vehshop.currentmenu == "mercedes-benz" or vehshop.currentmenu == "bmw" or vehshop.currentmenu == "lamborghini" or vehshop.currentmenu == "audi" or vehshop.currentmenu == "porsche" or vehshop.currentmenu == "andet" then
  526. if DoesEntityExist(fakecar.car) then
  527. Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(fakecar.car))
  528. end
  529. fakecar = {model = '', car = nil}
  530. vehSR_OpenMenu(vehshop.lastmenu)
  531. else
  532. vehSR_OpenMenu(vehshop.lastmenu)
  533. end
  534.  
  535. end
  536.  
  537. function vehSR_stringstarts(String,Start)
  538. return string.sub(String,1,string.len(Start))==Start
  539. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement