fork(3) download
  1. --[[------------------------------------------------------------------------
  2.  
  3. ActionMenu
  4. Created by WolfKnight
  5. Additional help from lowheartrate, TheStonedTurtle, and Briglair.
  6.  
  7. Modified by Christopher for VisionaryRP
  8.  
  9. ------------------------------------------------------------------------]]--
  10.  
  11. -- Define the variable used to open/close the menu
  12. local menuEnabled = false
  13. local togShot = false
  14. local togAr = false
  15. local togWin = false
  16.  
  17. local vd0 = false
  18. local vd1 = false
  19. local vd2 = false
  20. local vd3 = false
  21. local vd4 = false
  22. local vd5 = false
  23. local vd6 = false
  24. local vd7 = false
  25.  
  26.  
  27. local SpawnedSpikes = {}
  28. local SpikesSpawned = false
  29.  
  30. local SpikeConfig = {}
  31. local SpikeConfig = setmetatable(SpikeConfig, {})
  32.  
  33. SpikeConfig.MaxSpikes = 3
  34.  
  35. SpikeConfig.PedRestriction = true
  36. SpikeConfig.PedsList = {
  37. "s_m_y_cop_01",
  38. "s_f_y_cop_01",
  39. "s_m_y_hwaycop_01",
  40. "s_m_y_sheriff_01",
  41. "s_f_y_sheriff_01",
  42. "s_m_y_swat_01",
  43. "s_m_y_ranger_01",
  44. "s_f_y_ranger_01",
  45. "s_m_m_ciasec_01",
  46. "u_m_m_doa_01",
  47. "s_m_m_fibsec_01"
  48. }
  49.  
  50.  
  51. local gear = {
  52. {"WEAPON_COMBATPISTOL"},
  53. {"WEAPON_NIGHTSTICK"},
  54. {"WEAPON_STUNGUN"},
  55. {"WEAPON_FLASHLIGHT"},
  56. }
  57.  
  58. --[[------------------------------------------------------------------------
  59. ActionMenu Toggle
  60. Calling this function will open or close the ActionMenu.
  61. ------------------------------------------------------------------------]]--
  62. function ToggleActionMenu()
  63. -- Make the menuEnabled variable not itself
  64. -- e.g. not true = false, not false = true
  65. menuEnabled = not menuEnabled
  66.  
  67. if ( menuEnabled ) then
  68. -- Focuses on the NUI, the second parameter toggles the
  69. -- onscreen mouse cursor.
  70. SetNuiFocus( true, true )
  71.  
  72. -- Sends a message to the JavaScript side, telling it to
  73. -- open the menu.
  74. SendNUIMessage({
  75. showmenu = true
  76. })
  77. else
  78. -- Bring the focus back to the game
  79. SetNuiFocus( false )
  80.  
  81. -- Sends a message to the JavaScript side, telling it to
  82. -- close the menu.
  83. SendNUIMessage({
  84. hidemenu = true
  85. })
  86. end
  87. end
  88.  
  89. --[[------------------------------------------------------------------------
  90. ActionMenu HTML Callbacks
  91. This will be called every single time the JavaScript side uses the
  92. sendData function. The name of the data-action is passed as the parameter
  93. variable data.
  94. ------------------------------------------------------------------------]]--
  95. RegisterNUICallback( "ButtonClick", function( data, cb )
  96. if ( data == "shotgun" ) then
  97. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  98. if ( togShot ) then
  99. Citizen.CreateThread(function()
  100. RemoveAllPedWeapons(GetPlayerPed(-1),true)
  101. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 1000, false)
  102. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 1000, false)
  103. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 1000, false)
  104. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 1000, false)
  105. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  106. SetCurrentPedWeapon(GetPlayerPed(-1), "WEAPON_UNARMED", true)
  107. chatPrint( "You put your Shotgun away" )
  108. dontWant()
  109. togShot = false
  110. end)
  111. else
  112. Citizen.CreateThread(function()
  113. RemoveAllPedWeapons(GetPlayerPed(-1),true)
  114. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 1000, false)
  115. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 1000, false)
  116. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 1000, false)
  117. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 1000, false)
  118. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), 1000, false)
  119. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  120. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
  121. SetCurrentPedWeapon(GetPlayerPed(-1), "WEAPON_PUMPSHOTGUN", true)
  122. chatPrint( "You unlock your Shotgun" )
  123. want("0x1D073A89")
  124. togShot = true
  125. end)
  126. end
  127. else
  128. chatPrint( "I can't pull a Shotgun out of thin air..." )
  129. end
  130. elseif ( data == "ar15" ) then
  131. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  132. if ( togAr ) then
  133. Citizen.CreateThread(function()
  134. RemoveAllPedWeapons(GetPlayerPed(-1),true)
  135. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 1000, false)
  136. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 1000, false)
  137. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 1000, false)
  138. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 1000, false)
  139. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  140. SetCurrentPedWeapon(GetPlayerPed(-1), "WEAPON_UNARMED", true)
  141. chatPrint( "You put your AR-15 away" )
  142. dontWant()
  143. togAr = false
  144. end)
  145. else
  146. Citizen.CreateThread(function()
  147. RemoveAllPedWeapons(GetPlayerPed(-1),true)
  148. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), 1000, false)
  149. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_STUNGUN"), 1000, false)
  150. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_FLASHLIGHT"), 1000, false)
  151. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_NIGHTSTICK"), 1000, false)
  152. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), 1000, false)
  153. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  154. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_AT_AR_AFGRIP"))
  155. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_CARBINERIFLE"), GetHashKey("COMPONENT_AT_AR_FLSH"))
  156. SetCurrentPedWeapon(GetPlayerPed(-1), "WEAPON_CARBINERIFLE", true)
  157. chatPrint( "You unlock your AR-15" )
  158. want("0x83BF0278")
  159. togAr = true
  160. end)
  161. end
  162. else
  163. chatPrint( "I can't pull an AR15 out of thin air..." )
  164. end
  165. elseif ( data == "gear" ) then
  166. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  167. RequestModel("s_m_y_hwaycop_01")
  168. while not HasModelLoaded("s_m_y_hwaycop_01") do
  169. Citizen.Wait(0)
  170. end
  171. SetPlayerModel(PlayerId(), GetHashKey("s_m_y_hwaycop_01"))
  172. for k, w in pairs(gear) do
  173. GiveWeaponToPed(GetPlayerPed(-1), w[1], 1000, false, false)
  174. end
  175. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH"))
  176. GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_PUMPSHOTGUN"), GetHashKey("COMPONENT_AT_AR_FLSH"))
  177. else
  178. chatPrint( "I can't pull my Gear out of thin air..." )
  179. end
  180. elseif ( data == "d1" ) then
  181. ss(1)
  182. elseif ( data == "d2" ) then
  183. ss(2)
  184. elseif ( data == "d3" ) then
  185. ss(3)
  186. elseif ( data == "ds" ) then
  187. ds()
  188. elseif ( data == "togRadar" ) then
  189. if IsPedInAnyVehicle(GetPlayerPed(-1)) then
  190. togRadar()
  191. else
  192. chatPrint( "I can't pull a Radar out of thin air..." )
  193. end
  194. elseif ( data == "cuff" ) then
  195. Citizen.CreateThread( function()
  196. AddTextEntry('FMMC_KEY_TIP1', "Enter the Civilian's ID")
  197. DisplayOnscreenKeyboard( false, "FMMC_KEY_TIP1", "", "", "", "", "", 4 )
  198. while true do
  199. if ( UpdateOnscreenKeyboard() == 1 ) then
  200. local cuffStr = GetOnscreenKeyboardResult()
  201. if ( string.len( cuffStr ) > 0 ) then
  202. local cuff = tonumber( cuffStr )
  203.  
  204. if ( cuff < 999 and cuff >= 1 ) then
  205. local tPID = cuffStr
  206. TriggerEvent("Handcuff", tPID)
  207. end
  208.  
  209. break
  210. else
  211. DisplayOnscreenKeyboard( false, "", "", "", "", "", "", 4 )
  212. end
  213. elseif ( UpdateOnscreenKeyboard() == 2 ) then
  214. break
  215. end
  216.  
  217. Citizen.Wait( 0 )
  218. end
  219. end )
  220. elseif ( data == "vd0" ) then
  221. if ( vd0 ) then
  222. closeDoor(0)
  223. vd0 = false
  224. else
  225. openDoor(0)
  226. vd0 = true
  227. end
  228. elseif ( data == "vd1" ) then
  229. if ( vd1 ) then
  230. closeDoor(1)
  231. vd1 = false
  232. else
  233. openDoor(1)
  234. vd1 = true
  235. end
  236. elseif ( data == "vd2" ) then
  237. if ( vd2 ) then
  238. closeDoor(2)
  239. vd2 = false
  240. else
  241. openDoor(2)
  242. vd2 = true
  243. end
  244. elseif ( data == "vd3" ) then
  245. if ( vd3 ) then
  246. closeDoor(3)
  247. vd3 = false
  248. else
  249. openDoor(3)
  250. vd3 = true
  251. end
  252. elseif ( data == "vd4" ) then
  253. if ( vd4 ) then
  254. closeDoor(4)
  255. vd5 = false
  256. else
  257. openDoor(4)
  258. vd4 = true
  259. end
  260. elseif ( data == "vd5" ) then
  261. if ( vd5 ) then
  262. closeDoor(5)
  263. vd5 = false
  264. else
  265. openDoor(5)
  266. vd5 = true
  267. end
  268. elseif ( data == "vd6" ) then
  269. if ( vd6 ) then
  270. closeDoor(6)
  271. vd6 = false
  272. else
  273. openDoor(6)
  274. vd6 = true
  275. end
  276. elseif ( data == "vd7" ) then
  277. if ( vd7) then
  278. closeDoor(7)
  279. vd7 = false
  280. else
  281. openDoor(7)
  282. vd7 = true
  283. end
  284. elseif ( data == "vdc" ) then
  285. closeAllDoors()
  286. elseif ( data == "engine" ) then
  287. toggleEngine()
  288. elseif ( data == "windows" ) then
  289. toggleWindows()
  290. elseif ( data == "exit" ) then
  291. -- We toggle the ActionMenu and return here, otherwise the function
  292. -- call below would be executed too, which would just open the menu again
  293. ToggleActionMenu()
  294. return
  295. end
  296.  
  297. -- This will only be called if any button other than the exit button is pressed
  298. ToggleActionMenu()
  299. end )
  300.  
  301.  
  302. --[[------------------------------------------------------------------------
  303. ActionMenu Control and Input Blocking
  304. This is the main while loop that opens the ActionMenu on keypress. It
  305. uses the input blocking found in the ES Banking resource, credits to
  306. the authors.
  307. ------------------------------------------------------------------------]]--
  308. Citizen.CreateThread( function()
  309. -- This is just in case the resources restarted whilst the NUI is focused.
  310. SetNuiFocus( false )
  311.  
  312. while true do
  313. -- Control ID 20 is the 'Z' key by default
  314. -- Use https://w...content-available-to-author-only...m.net/wiki/Controls to find a different key
  315. -- Now set to M
  316. if ( IsControlJustPressed( 1, 244 ) ) then
  317. ToggleActionMenu()
  318. end
  319.  
  320. if ( menuEnabled ) then
  321. local ped = GetPlayerPed( -1 )
  322.  
  323. DisableControlAction( 0, 1, true ) -- LookLeftRight
  324. DisableControlAction( 0, 2, true ) -- LookUpDown
  325. DisableControlAction( 0, 24, true ) -- Attack
  326. DisablePlayerFiring( ped, true ) -- Disable weapon firing
  327. DisableControlAction( 0, 142, true ) -- MeleeAttackAlternate
  328. DisableControlAction( 0, 106, true ) -- VehicleMouseControlOverride
  329. end
  330.  
  331. Citizen.Wait( 0 )
  332. end
  333. end )
  334.  
  335. function chatPrint( msg )
  336. TriggerEvent( 'chatMessage', "VisionaryRP", { 255, 255, 255 }, msg )
  337. end
  338.  
  339. function ss( num )
  340. TriggerEvent( 'Spikestrips:SpawnSpikes', {isRestricted = SpikeConfig.PedRestriction, pedList = SpikeConfig.PedsList,}, num )
  341. end
  342.  
  343. function ds()
  344. TriggerEvent( 'Spikestrips:RemoveSpikes')
  345. end
  346.  
  347. function togRadar()
  348. TriggerEvent( 'wk:radarRC')
  349. end
  350.  
  351. function want(wea)
  352. TriggerEvent( 'PoliceVehicleWeaponDeleter:gettingAGun', wea)
  353. end
  354.  
  355. function dontWant(wea)
  356. TriggerEvent( 'PoliceVehicleWeaponDeleter:notGettingAGun')
  357. end
  358.  
  359. function openDoor(vd)
  360. local Veh = GetVehiclePedIsUsing(GetPlayerPed(-1))
  361. SetVehicleDoorOpen(Veh, vd, false, false)
  362. end
  363.  
  364. function closeDoor(vd)
  365. local Veh = GetVehiclePedIsUsing(GetPlayerPed(-1))
  366. SetVehicleDoorShut(Veh, vd, false)
  367. end
  368.  
  369. function closeAllDoors()
  370. local Veh = GetVehiclePedIsUsing(GetPlayerPed(-1))
  371. SetVehicleDoorShut(Veh, 0, false)
  372. SetVehicleDoorShut(Veh, 1, false)
  373. SetVehicleDoorShut(Veh, 2, false)
  374. SetVehicleDoorShut(Veh, 3, false)
  375. SetVehicleDoorShut(Veh, 4, false)
  376. SetVehicleDoorShut(Veh, 5, false)
  377. SetVehicleDoorShut(Veh, 6, false)
  378. SetVehicleDoorShut(Veh, 7, false)
  379. end
  380.  
  381. function toggleEngine()
  382. local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
  383. if vehicle ~= nil and vehicle ~= 0 and GetPedInVehicleSeat(vehicle, 0) then
  384. SetVehicleEngineOn(vehicle, (not GetIsVehicleEngineRunning(vehicle)), false, true)
  385. end
  386. end
  387.  
  388. function toggleWindows()
  389. if ( togWin ) then
  390. RoleUpWindow(playerCar, 0)
  391. RoleUpWindow(playerCar, 1)
  392. RoleUpWindow(playerCar, 2)
  393. RoleUpWindow(playerCar, 3)
  394. togWin false
  395. else
  396. local playerCar = GetVehiclePedIsIn(playerPed, false)
  397. RollDownWindows(playerCar)
  398. togWin true
  399. end
  400. end
  401.  
  402. function tablelength(T)
  403. local count = 0
  404. for _ in pairs(T) do count = count + 1 end
  405. return count
  406. end
  407.  
  408. --[[ Looped Thread ]]--
  409. Citizen.CreateThread(function()
  410. while true do
  411. Citizen.Wait(0)
  412.  
  413. if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
  414. local vehicle = GetVehiclePedIsIn(GetPlayerPed(PlayerId()), false)
  415. local vehiclePos = GetEntityCoords(vehicle, false)
  416. local spikes = GetClosestObjectOfType(vehiclePos.x, vehiclePos.y, vehiclePos.z, 75.0, GetHashKey("P_ld_stinger_s"), false, 1, 1)
  417. local spikesCoords = GetEntityCoords(spikes, false)
  418. local distance = Vdist(vehiclePos.x, vehiclePos.y, vehiclePos.z, spikesCoords.x, spikesCoords.y, spikesCoords.z)
  419. if distance <= 75.0 then
  420. CheckDistanceToStrips()
  421. end
  422. end
  423. end
  424. end)
  425.  
  426. RegisterCommand("spawn", function(source, args, string)
  427. SpawnSpikes()
  428. end, false)
  429.  
  430. RegisterNetEvent("Spikestrips:SpawnSpikes")
  431. AddEventHandler("Spikestrips:SpawnSpikes", function(config, amount)
  432. if config.isRestricted then
  433. if CheckPedRestriction(GetPlayerPed(PlayerId()), config.pedList) then
  434. for a = 1, amount do
  435. local plyCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()), 0.0, 3.0 * a + 0.5, 0.0)
  436. local plyHead = GetEntityHeading(GetPlayerPed(PlayerId()))
  437. local spike = CreateObject(GetHashKey("P_ld_stinger_s"), plyCoords.x, plyCoords.y, plyCoords.z, true, 1, true)
  438. local spikeHeight = GetEntityHeightAboveGround(spike)
  439. SetEntityCoords(spike, plyCoords.x, plyCoords.y, plyCoords.z - spikeHeight + 0.05, 0.0, 0.0, 0.0, 0.0)
  440. SetEntityHeading(spike, plyHead)
  441. SetEntityAsMissionEntity(spike, 1, 1)
  442. table.insert(SpawnedSpikes, spike)
  443. SpikesSpawned = true
  444. end
  445. else
  446. chatPrint( "Where the hell am I meant to get Spike Strips from?!" )
  447. end
  448. else
  449. for b = 1, amount do
  450. local plyCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()), 0.0, 3.0 * b + 0.5, 0.0)
  451. local plyHead = GetEntityHeading(GetPlayerPed(PlayerId()))
  452. local spike = CreateObject(GetHashKey("P_ld_stinger_s"), plyCoords.x, plyCoords.y, plyCoords.z, true, 1, true)
  453. local spikeHeight = GetEntityHeightAboveGround(spike)
  454. SetEntityCoords(spike, plyCoords.x, plyCoords.y, plyCoords.z - spikeHeight + 0.05, 0.0, 0.0, 0.0, 0.0)
  455. SetEntityHeading(spike, plyHead)
  456. SetEntityAsMissionEntity(spike, 1, 1)
  457. SetEntityCollision(spike, false, false)
  458. table.insert(SpawnedSpikes, spike)
  459. SpikesSpawned = true
  460. end
  461. end
  462. end)
  463.  
  464. RegisterNetEvent("Spikestrips:RemoveSpikes")
  465. AddEventHandler("Spikestrips:RemoveSpikes", function()
  466. if SpikesSpawned then
  467. for i = 1, #SpawnedSpikes do
  468. DeleteEntity(SpawnedSpikes[i])
  469. SpawnedSpikes[i] = nil
  470. SpikesSpawned = false
  471. end
  472. end
  473. end)
  474.  
  475. function CheckDistanceToStrips()
  476. local vehicle = GetVehiclePedIsIn(GetPlayerPed(PlayerId()), false)
  477. FrontLeftTire(vehicle)
  478. FrontRightTire(vehicle)
  479. BackLeftTire(vehicle)
  480. BackRightTire(vehicle)
  481. end
  482.  
  483. function FrontLeftTire(vehicle)
  484. local tirePosition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, "wheel_lf"))
  485. local spikestrip = GetClosestObjectOfType(tirePosition.x, tirePosition.y, tirePosition.z, 15.0, GetHashKey("P_ld_stinger_s"), false, 1, 1)
  486. local spikeCoords = GetEntityCoords(spikestrip, false)
  487. local distance = Vdist(tirePosition.x, tirePosition.y, tirePosition.z, spikeCoords.x, spikeCoords.y, spikeCoords.z)
  488.  
  489. if distance < 1.8 then
  490. if not IsVehicleTyreBurst(vehicle, 0, false) and not IsVehicleTyreBurst(vehicle, 0, true) then
  491. SetVehicleTyreBurst(vehicle, 0, false, 1000.0)
  492. end
  493. end
  494. end
  495.  
  496. function FrontRightTire(vehicle)
  497. local tirePosition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, "wheel_rf"))
  498. local spikestrip = GetClosestObjectOfType(tirePosition.x, tirePosition.y, tirePosition.z, 15.0, GetHashKey("P_ld_stinger_s"), false, 1, 1)
  499. local spikeCoords = GetEntityCoords(spikestrip, false)
  500. local distance = Vdist(tirePosition.x, tirePosition.y, tirePosition.z, spikeCoords.x, spikeCoords.y, spikeCoords.z)
  501.  
  502. if distance < 1.8 then
  503. if not IsVehicleTyreBurst(vehicle, 1, false) and not IsVehicleTyreBurst(vehicle, 1, true) then
  504. SetVehicleTyreBurst(vehicle, 1, false, 1000.0)
  505. end
  506. end
  507. end
  508.  
  509. function BackLeftTire(vehicle)
  510. local tirePosition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, "wheel_lr"))
  511. local spikestrip = GetClosestObjectOfType(tirePosition.x, tirePosition.y, tirePosition.z, 15.0, GetHashKey("P_ld_stinger_s"), false, 1, 1)
  512. local spikeCoords = GetEntityCoords(spikestrip, false)
  513. local distance = Vdist(tirePosition.x, tirePosition.y, tirePosition.z, spikeCoords.x, spikeCoords.y, spikeCoords.z)
  514.  
  515. if distance < 1.8 then
  516. if not IsVehicleTyreBurst(vehicle, 4, false) and not IsVehicleTyreBurst(vehicle, 4, true) then
  517. SetVehicleTyreBurst(vehicle, 4, false, 1000.0)
  518. SetVehicleTyreBurst(vehicle , 2, false, 1000.0)
  519. end
  520. end
  521. end
  522.  
  523. function BackRightTire(vehicle)
  524. local tirePosition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, "wheel_rr"))
  525. local spikestrip = GetClosestObjectOfType(tirePosition.x, tirePosition.y, tirePosition.z, 15.0, GetHashKey("P_ld_stinger_s"), false, 1, 1)
  526. local spikeCoords = GetEntityCoords(spikestrip, false)
  527. local distance = Vdist(tirePosition.x, tirePosition.y, tirePosition.z, spikeCoords.x, spikeCoords.y, spikeCoords.z)
  528.  
  529. if distance < 1.8 then
  530. if not IsVehicleTyreBurst(vehicle, 5, false) and not IsVehicleTyreBurst(vehicle, 5, true) then
  531. SetVehicleTyreBurst(vehicle, 5, false, 1000.0)
  532. SetVehicleTyreBurst(vehicle , 3, false, 1000.0)
  533. end
  534. end
  535. end
  536.  
  537. function CheckPedRestriction(ped, PedList)
  538. for i = 1, #PedList do
  539. print(tostring(GetHashKey(PedList[i])))
  540. if GetHashKey(PedList[i]) == GetEntityModel(ped) then
  541. return true
  542. end
  543. end
  544. return false
  545. end
  546.  
  547. Citizen.CreateThread(function()
  548. while true do
  549. Citizen.Wait(0)
  550. if SpikesSpawned then
  551. for i = 1, #SpawnedSpikes do
  552. FreezeEntityPosition(SpawnedSpikes[i], true)
  553. end
  554. end
  555. end
  556. end)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
luac5.3: prog.lua:394: syntax error near 'false'
stdout
Standard output is empty