Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2019
2,439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.39 KB | None | 0 0
  1. _menuPool = NativeUI.CreatePool()
  2. mainMenu = NativeUI.CreateMenu("SCRP", "Welcome", 1320)
  3. _menuPool:Add(mainMenu)
  4. function Settings()
  5. _menuPool:ControlDisablingEnabled(false)
  6. _menuPool:MouseControlsEnabled(false)
  7. _menuPool:SetBannerRectangle(NativeUI.CreateRectangle(1320, 0, 100, 50, 255, 63, 63, 255))
  8. end
  9. Settings()
  10.  
  11. pedsList = {
  12. 'mp_m_freemode_01',
  13. }
  14.  
  15. menuunlocked = false
  16.  
  17. RegisterNetEvent("unlockmenu")
  18. AddEventHandler("unlockmenu", function()
  19. if menuunlocked == true then
  20. menuunlocked = false
  21. ShowNotification('Police Menu ~r~locked~w~!')
  22. elseif menuunlocked == false then
  23. menuunlocked = true
  24. ShowNotification('Police Menu ~g~unlocked~w~!')
  25.  
  26. end
  27. end)
  28.  
  29. function AddMenuPolice()
  30. PoliceMenu = _menuPool:AddSubMenu(mainMenu, "Police Menu", "",true)
  31. mainMenu.OnMenuChanged = function(menu, newmenu, forward)
  32. if newmenu == PoliceMenu then
  33. if not CheckPedRestriction(GetLocalPed(), pedsList) and menuunlocked == false then
  34. ShowNotification("~r~Do you look like a cop?\nI don't think so!")
  35. PoliceMenu:GoBack()
  36. end
  37. end
  38. end
  39.  
  40. PoliceSpikesMenu = _menuPool:AddSubMenu(PoliceMenu, "Spikes", "",true)
  41. PolicePropsMenu = _menuPool:AddSubMenu(PoliceMenu, "Objects", "",true)
  42. PoliceActionsMenu = _menuPool:AddSubMenu(PoliceMenu, "Actions", "",true)
  43. PoliceEmotesMenu = _menuPool:AddSubMenu(PoliceMenu, "Emotes", "",true)
  44. PoliceGunMenu = _menuPool:AddSubMenu(PoliceMenu, "Loadouts", "",true)
  45. PoliceVehiclesMenu = _menuPool:AddSubMenu(PoliceMenu, "Marked Vehicles", "",true)
  46. PoliceUMVehiclesMenu = _menuPool:AddSubMenu(PoliceMenu, "Unmarked Vehicles", "",true)
  47. local Back = UIMenuItem.New('<<< Back', '')
  48. PoliceMenu:AddItem(Back)
  49. PoliceMenu.OnItemSelect = function(Sender, Item, Index)
  50. if Item == Back then
  51. PoliceMenu:GoBack()
  52. end
  53. end
  54.  
  55. --UM vehicles
  56. local fbi = UIMenuItem.New('Unmarked Dodge Charger', '')
  57. PoliceUMVehiclesMenu:AddItem(fbi)
  58. local fbi2 = UIMenuItem.New('Unmarked Ford Explorer', '')
  59. PoliceUMVehiclesMenu:AddItem(fbi2)
  60. local policeold2 = UIMenuItem.New('Unmarked Ford Tarus', '')
  61. PoliceUMVehiclesMenu:AddItem(policeold2)
  62. local Back = UIMenuItem.New('<<< Back', '')
  63. PoliceUMVehiclesMenu:AddItem(Back)
  64.  
  65. --Unmarked select
  66. PoliceUMVehiclesMenu.OnItemSelect = function(Sender, Item, Index)
  67. if Item == fbi then
  68. SpawnVehicle('fbi')
  69. elseif Item == fbi2 then
  70. SpawnVehicle('fbi2')
  71. elseif Item == policeold2 then
  72. SpawnVehicle('policeold2')
  73. elseif Item == Back then
  74. PoliceUMVehiclesMenu:GoBack()
  75. end
  76. end
  77.  
  78. --Marked vehicles
  79. local police3 = UIMenuItem.New('2009 Dodge Charger (Cadet)', '')
  80. PoliceVehiclesMenu:AddItem(police3)
  81. local police2 = UIMenuItem.New('2018 Dodge Charger', '')
  82. PoliceVehiclesMenu:AddItem(police2)
  83. local tah = UIMenuItem.New('Chevy Tahoe', '')
  84. PoliceVehiclesMenu:AddItem(tah)
  85. local sheriff2 = UIMenuItem.New('Ford Explorer', '')
  86. PoliceVehiclesMenu:AddItem(sheriff2)
  87. local silverado = UIMenuItem.New('Chevy Silverado', '')
  88. PoliceVehiclesMenu:AddItem(silverado)
  89. local Back = UIMenuItem.New('<<< Back', '')
  90. PoliceVehiclesMenu:AddItem(Back)
  91.  
  92. -- Marked select
  93. PoliceVehiclesMenu.OnItemSelect = function(Sender, Item, Index)
  94. if Item == police3 then
  95. SpawnVehicle('police3')
  96. elseif Item == police2 then
  97. SpawnVehicle('police2')
  98. elseif Item == tah then
  99. SpawnVehicle('tah')
  100. elseif Item == sheriff2 then
  101. SpawnVehicle('sheriff2')
  102. elseif Item == silverado then
  103. SpawnVehicle('silverado')
  104. elseif Item == Back then
  105. PoliceVehiclesMenu:GoBack()
  106. end
  107. end
  108.  
  109. --Spikes
  110. local SpawnSpike = UIMenuItem.New('Place Spikes', '')
  111. PoliceSpikesMenu:AddItem(SpawnSpike)
  112. local RemoveSpike = UIMenuItem.New('Remove Spikes', '')
  113. PoliceSpikesMenu:AddItem(RemoveSpike)
  114. local Back = UIMenuItem.New('<<< Back', '')
  115. PoliceSpikesMenu:AddItem(Back)
  116.  
  117. -- Spikes select
  118. PoliceSpikesMenu.OnItemSelect = function(Sender, Item, Index)
  119. if Item == SpawnSpike then
  120. SetSpikesOnGround()
  121. elseif Item == RemoveSpike then
  122. DeleteOBJ('P_ld_stinger_s')
  123. elseif Item == Back then
  124. PoliceSpikesMenu:GoBack()
  125. end
  126. end
  127.  
  128. -- Props:
  129. local PB = UIMenuItem.New('Police Barrier', '')
  130. PolicePropsMenu:AddItem(PB)
  131. local WB = UIMenuItem.New('Red Barrier', '')
  132. PolicePropsMenu:AddItem(WB)
  133. local WBA = UIMenuItem.New('Red Barrier (Arrow)', '')
  134. PolicePropsMenu:AddItem(WBA)
  135. local RC = UIMenuItem.New('Traffic Cone', '')
  136. PolicePropsMenu:AddItem(RC)
  137. local CS = UIMenuItem.New('Coroner Stretcher', '')
  138. PolicePropsMenu:AddItem(CS)
  139. local CD = UIMenuItem.New('Channelizer Drum', '')
  140. PolicePropsMenu:AddItem(CD)
  141. local RO = UIMenuItem.New('Remove close Objects', '')
  142. PolicePropsMenu:AddItem(RO)
  143. local Back = UIMenuItem.New('<<< Back', '')
  144. PolicePropsMenu:AddItem(Back)
  145.  
  146. -- Props select
  147. PolicePropsMenu.OnItemSelect = function(Sender, Item, Index)
  148. if Item == WB then
  149. SpawnObject('prop_mp_barrier_02b')
  150. elseif Item == PB then
  151. SpawnObject('prop_barrier_work05')
  152. elseif Item == WBA then
  153. SpawnObject('prop_mp_arrow_barrier_01')
  154. elseif Item == CD then
  155. SpawnObject('prop_barrier_wat_03a')
  156. elseif Item == RC then
  157. SpawnObject('prop_roadcone01a')
  158. elseif Item == CS then
  159. SpawnObject('prop_ld_binbag_01')
  160. elseif Item == RO then
  161. DeleteOBJ('prop_mp_barrier_02b')
  162. DeleteOBJ('prop_barrier_work05')
  163. DeleteOBJ('prop_mp_arrow_barrier_01')
  164. DeleteOBJ('prop_barrier_wat_03a')
  165. DeleteOBJ('prop_roadcone01a')
  166. DeleteOBJ('prop_ld_binbag_01')
  167. elseif Item == Back then
  168. PolicePropsMenu:GoBack()
  169. end
  170. end
  171.  
  172. -- Actions:
  173. local cuff = UIMenuItem.New('Cuff', '')
  174. PoliceActionsMenu:AddItem(cuff)
  175. local uncuff = UIMenuItem.New('Uncuff', '')
  176. PoliceActionsMenu:AddItem(uncuff)
  177. local grab = UIMenuItem.New('Grab', '')
  178. PoliceActionsMenu:AddItem(grab)
  179. local Back = UIMenuItem.New('<<< Back', '')
  180. PoliceActionsMenu:AddItem(Back)
  181.  
  182. -- Actions select
  183. PoliceActionsMenu.OnItemSelect = function(Sender, Item, Index)
  184. if Item == cuff then
  185. TriggerEvent('cuff')
  186. elseif Item == uncuff then
  187. TriggerEvent('uncuff')
  188. elseif Item == grab then
  189. DragPlayer()
  190. elseif Item == Back then
  191. PoliceActionsMenu:GoBack()
  192. end
  193. end
  194.  
  195. -- Emotes
  196. local traffic = UIMenuItem.New('Traffic Control', '')
  197. PoliceEmotesMenu:AddItem(traffic)
  198. local clip = UIMenuItem.New('Clipboard', '')
  199. PoliceEmotesMenu:AddItem(clip)
  200. local note = UIMenuItem.New('Notepad', '')
  201. PoliceEmotesMenu:AddItem(note)
  202. local stance = UIMenuItem.New('Idle/Stance', '')
  203. PoliceEmotesMenu:AddItem(stance)
  204. local holster = UIMenuItem.New('Hand on holster', '')
  205. PoliceEmotesMenu:AddItem(holster)
  206. local radio = UIMenuItem.New('Hand on Radio', '')
  207. PoliceEmotesMenu:AddItem(radio)
  208. local radiogun = UIMenuItem.New('Hand on radio and point gun', '')
  209. PoliceEmotesMenu:AddItem(radiogun)
  210. local cancel = UIMenuItem.New('Cancel Emote', '')
  211. PoliceEmotesMenu:AddItem(cancel)
  212. local Back = UIMenuItem.New('<<< Back', '')
  213. PoliceEmotesMenu:AddItem(Back)
  214.  
  215. -- Emotes select
  216. PoliceEmotesMenu.OnItemSelect = function(Sender, Item, Index)
  217. if Item == traffic then
  218. TriggerEvent('Traffic')
  219. elseif Item == clip then
  220. TriggerEvent('Notes')
  221. elseif Item == note then
  222. TriggerEvent('Citation')
  223. elseif Item == stance then
  224. TriggerEvent('Stance')
  225. elseif Item == holster then
  226. TriggerEvent('Holster')
  227. elseif Item == radio then
  228. TriggerEvent('Radio')
  229. elseif Item == radiogun then
  230. TriggerEvent('RadioGunPoint')
  231. elseif Item == cancel then
  232. TriggerEvent('cancelEmote')
  233. elseif Item == Back then
  234. PoliceEmotesMenu:GoBack()
  235. end
  236. end
  237.  
  238. -- Gun Menu
  239. local remall = UIMenuItem.New('Clear Weapons', '')
  240. PoliceGunMenu:AddItem(remall)
  241. local sasp = UIMenuItem.New('SASP Loadout', '')
  242. PoliceGunMenu:AddItem(sasp)
  243. local swat = UIMenuItem.New('SWAT Loadout', '')
  244. PoliceGunMenu:AddItem(swat)
  245. local Back = UIMenuItem.New('<<< Back', '')
  246. PoliceGunMenu:AddItem(Back)
  247.  
  248. local myPed = PlayerPedId()
  249. local localPed = PlayerId()
  250.  
  251. -- Gun select
  252. carbine = false
  253. PoliceGunMenu.OnItemSelect = function(Sender, Item, Index)
  254. if Item == remall then
  255. RemoveAllPedWeapons(GetPlayerPed(-1), true)
  256. elseif Item == sasp then
  257. giveWeapon("weapon_combatpistol")
  258. weaponComponent("weapon_combatpistol", "COMPONENET_COMBATPISTOL_CLIP_02")
  259. weaponComponent("weapon_combatpistol", "COMPONENT_AT_PI_FLSH")
  260. giveWeapon("weapon_tazer")
  261. giveWeapon("weapon_carbinerifle")
  262. weaponComponent("weapon_carbinerifle", "COMPONENT_AT_AR_FLSH")
  263. weaponComponent("weapon_carbinerifle", "COMPONENT_AT_AR_AFGRIP")
  264. weaponComponent("weapon_carbinerifle", "COMPONENT_AT_SCOPE_MEDIUM")
  265. weaponComponent("weapon_carbinerifle", "COMPONENT_CARBINERIFLE_CLIP_03")
  266. giveWeapon("weapon_pumpshotgun")
  267. weaponComponent("weapon_pumpshotgun", "COMPONENT_AT_AR_FLSH")
  268. giveWeapon("weapon_stungun")
  269. giveWeapon("weapon_nightstick")
  270. giveWeapon("weapon_flashlight")
  271. elseif Item == swat then
  272. giveWeapon("weapon_combatpistol")
  273. weaponComponent("weapon_combatpistol", "COMPONENET_COMBATPISTOL_CLIP_02")
  274. weaponComponent("weapon_combatpistol", "COMPONENT_AT_PI_FLSH")
  275. giveWeapon("weapon_specialcarbine")
  276. weaponComponent("weapon_specialcarbine", "COMPONENT_SPECIALCARBINE_CLIP_03")
  277. weaponComponent("weapon_specialcarbine", "COMPONENT_AT_AR_FLSH")
  278. weaponComponent("weapon_specialcarbine", "COMPONENT_AT_AR_AFGRIP")
  279. weaponComponent("weapon_specialcarbine", "COMPONENT_AT_SCOPE_MEDIUM")
  280. giveWeapon("weapon_assaultshotgun")
  281. weaponComponent("weapon_assaultshotgun", "COMPONENT_ASSAULTSHOTGUN_CLIP_02")
  282. weaponComponent("weapon_assaultshotgun", "COMPONENT_AT_AR_FLSH")
  283. weaponComponent("weapon_assaultshotgun", "COMPONENT_AT_AR_AFGRIP")
  284. giveWeapon("weapon_flare")
  285. giveWeapon("weapon_pumpshotgun")
  286. weaponComponent("weapon_pumpshotgun", "COMPONENT_AT_AR_FLSH")
  287. giveWeapon("weapon_flashlight")
  288. elseif Item == Back then
  289. PoliceGunMenu:GoBack()
  290. end
  291. end
  292.  
  293. function AddMenuCiv()
  294. CivMenu = _menuPool:AddSubMenu(mainMenu, "Civillian Menu", "",true)
  295. --Sub menus
  296. CivActionsMenu = _menuPool:AddSubMenu(CivMenu, "Actions", "",true)
  297. CivEmotesMenu = _menuPool:AddSubMenu(CivMenu, "Emotes", "",true)
  298. local showID = UIMenuItem.New('Show ID', '')
  299. CivMenu:AddItem(showID)
  300. local Back = UIMenuItem.New('<<< Back', '')
  301. CivMenu:AddItem(Back)
  302. CivMenu.OnItemSelect = function(Sender, Item, Index)
  303. if Item == Back then
  304. CivMenu:GoBack()
  305. end
  306. if Item == showID then
  307. idShow()
  308. end
  309. end
  310.  
  311. -- Civ Actions
  312. local DropWeapon = UIMenuItem.New('Drop Weapon', '')
  313. CivActionsMenu:AddItem(DropWeapon)
  314. local toggcrouch = UIMenuItem.New('Toggle Crouch', '')
  315. CivActionsMenu:AddItem(toggcrouch)
  316. local handsUp = UIMenuItem.New('Put hands up', '')
  317. CivActionsMenu:AddItem(handsUp)
  318. local handsUpk = UIMenuItem.New('Kneel down', '')
  319. CivActionsMenu:AddItem(handsUpk)
  320.  
  321. CivActionsMenu.OnItemSelect = function(Sender, Item, Index)
  322. if Item == DropWeapon then
  323. dropweap()
  324. elseif Item == toggcrouch then
  325. crouchtoggle = true
  326. elseif Item == handsUp then
  327. TriggerEvent('Handsup')
  328. elseif Item == handsUpk then
  329. TriggerEvent('KneelHU')
  330. elseif Item == Back then
  331. CivActionsMenu:GoBack()
  332. end
  333. end
  334.  
  335. -- Civ Emotes
  336. local smoke = UIMenuItem.New('Smoke', '')
  337. CivEmotesMenu:AddItem(smoke)
  338. local Party = UIMenuItem.New('Party', '')
  339. CivEmotesMenu:AddItem(Party)
  340. local Pushups = UIMenuItem.New('Pushups', '')
  341. CivEmotesMenu:AddItem(Pushups)
  342. local Situps = UIMenuItem.New('Situps', '')
  343. CivEmotesMenu:AddItem(Situps)
  344. local Weld = UIMenuItem.New('Weld', '')
  345. CivEmotesMenu:AddItem(Weld)
  346. local Phone = UIMenuItem.New('Phone', '')
  347. CivEmotesMenu:AddItem(Phone)
  348. local Injured = UIMenuItem.New('Injured', '')
  349. CivEmotesMenu:AddItem(Injured)
  350. local Weed = UIMenuItem.New('Weed', '')
  351. CivEmotesMenu:AddItem(Weed)
  352. local Coffee = UIMenuItem.New('Coffee', '')
  353. CivEmotesMenu:AddItem(Coffee)
  354. local Photo = UIMenuItem.New('Photo', '')
  355. CivEmotesMenu:AddItem(Photo)
  356. local Binoculars = UIMenuItem.New('Binoculars', '')
  357. CivEmotesMenu:AddItem(Binoculars)
  358. local Drink = UIMenuItem.New('Drink', '')
  359. CivEmotesMenu:AddItem(Drink)
  360. local Film = UIMenuItem.New('Film', '')
  361. CivEmotesMenu:AddItem(Film)
  362. local Weights = UIMenuItem.New('Weights', '')
  363. CivEmotesMenu:AddItem(Weights)
  364. local Flex = UIMenuItem.New('Flex', '')
  365. CivEmotesMenu:AddItem(Flex)
  366. local cancel = UIMenuItem.New('Cancel Emote', '')
  367. CivEmotesMenu:AddItem(cancel)
  368. local Back = UIMenuItem.New('<<< Back', '')
  369. CivEmotesMenu:AddItem(Back)
  370.  
  371. -- Emotes select
  372. CivEmotesMenu.OnItemSelect = function(Sender, Item, Index)
  373. if Item == smoke then
  374. TriggerEvent('Smoke')
  375. elseif Item == Party then
  376. TriggerEvent('Party')
  377. elseif Item == Pushups then
  378. TriggerEvent('Pushups')
  379. elseif Item == Situps then
  380. TriggerEvent('Situps')
  381. elseif Item == Weld then
  382. TriggerEvent('Weld')
  383. elseif Item == Phone then
  384. TriggerEvent('Phone')
  385. elseif Item == Injured then
  386. TriggerEvent('Injured')
  387. elseif Item == Weed then
  388. TriggerEvent('Weed')
  389. elseif Item == Coffee then
  390. TriggerEvent('Coffee')
  391. elseif Item == Photo then
  392. TriggerEvent('Photo')
  393. elseif Item == Binoculars then
  394. TriggerEvent('Binoculars')
  395. elseif Item == Drink then
  396. TriggerEvent('Drink')
  397. elseif Item == Film then
  398. TriggerEvent('Film')
  399. elseif Item == Weights then
  400. TriggerEvent('Weights')
  401. elseif Item == Flex then
  402. TriggerEvent('Flex')
  403. elseif Item == cancel then
  404. TriggerEvent('cancelEmote')
  405. elseif Item == Back then
  406. CivEmotesMenu:GoBack()
  407. end
  408. end
  409.  
  410.  
  411. AddMenuPolice(mainMenu)
  412. AddMenuCiv()
  413. _menuPool:RefreshIndex()
  414.  
  415. Citizen.CreateThread(function()
  416. handup = false
  417. while true do
  418. Citizen.Wait(0)
  419. _menuPool:ProcessMenus()
  420. if IsControlJustPressed(1, 244) and _menuPool:IsAnyMenuOpen() then
  421. _menuPool:CloseAllMenus()
  422. elseif IsControlJustPressed(1, 244) then
  423. mainMenu:Visible(not mainMenu:Visible())
  424. end
  425. end
  426. end)
  427.  
  428. function idShow()
  429. local TextEntry = 'First and Lastname:'
  430. local MaxStringLenght = 30
  431. CivMenu:Visible(false)
  432.  
  433. AddTextEntry('FMMC_KEY_TIP1', TextEntry) --Sets the Text above the typing field in the black square
  434. DisplayOnscreenKeyboard(1, "FMMC_KEY_TIP1", "", ExampleText, "", "", "", MaxStringLenght) --Actually calls the Keyboard Input
  435. blockinput = true --Blocks new input while typing if **blockinput** is used
  436.  
  437. while UpdateOnscreenKeyboard() ~= 1 and UpdateOnscreenKeyboard() ~= 2 do --While typing is not aborted and not finished, this loop waits
  438. Citizen.Wait(0)
  439. end
  440.  
  441. if UpdateOnscreenKeyboard() ~= 2 then
  442. local result = GetOnscreenKeyboardResult() --Gets the result of the typing
  443. Citizen.Wait(500) --Little Time Delay, so the Keyboard won't open again if you press enter to finish the typing
  444. blockinput = false --This unblocks new Input when typing is done
  445. CivMenu:Visible(true)
  446. TriggerServerEvent('notify', GetPlayerServerId(PlayerId()), result)
  447. else
  448. Citizen.Wait(500)
  449. blockinput = false
  450. end
  451. end
  452.  
  453. -- Civ Emotes Start --
  454.  
  455. RegisterNetEvent('Smoke')
  456. AddEventHandler('Smoke', function()
  457.  
  458. local emotePlaying = IsPedActiveInScenario(GetPlayerPed(-1))
  459. local ped = GetPlayerPed( -1 )
  460. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  461. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_SMOKING", 0, true);
  462. Citizen.Wait(9999999000)
  463. ClearPedTasksImmediately(GetPlayerPed(-1))
  464. end
  465. end )
  466.  
  467. --]]
  468. RegisterNetEvent('Party')
  469. AddEventHandler('Party', function()
  470.  
  471. local ped = GetPlayerPed( -1 )
  472. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  473. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_PARTYING", 0, true);
  474. Citizen.Wait(9999999000)
  475. ClearPedTasksImmediately(GetPlayerPed(-1))
  476. end
  477. end )
  478.  
  479. RegisterNetEvent('Drink')
  480. AddEventHandler('Drink', function()
  481.  
  482. local ped = GetPlayerPed( -1 )
  483. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  484. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_DRINKING", 0, true);
  485. Citizen.Wait(9999999000)
  486. ClearPedTasksImmediately(GetPlayerPed(-1))
  487. end
  488. end )
  489.  
  490. RegisterNetEvent('Pushups')
  491. AddEventHandler('Pushups', function()
  492.  
  493. local ped = GetPlayerPed( -1 )
  494. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  495. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_PUSH_UPS", 0, true);
  496. Citizen.Wait(9999999000)
  497. ClearPedTasksImmediately(GetPlayerPed(-1))
  498. end
  499. end )
  500.  
  501. RegisterNetEvent('Phone')
  502. AddEventHandler('Phone', function()
  503.  
  504. local ped = GetPlayerPed( -1 )
  505. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  506. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_STAND_MOBILE", 0, true);
  507. Citizen.Wait(9999999000)
  508. ClearPedTasksImmediately(GetPlayerPed(-1))
  509. end
  510. end )
  511.  
  512. RegisterNetEvent('Injured')
  513. AddEventHandler('Injured', function()
  514.  
  515. local ped = GetPlayerPed( -1 )
  516. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  517. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_SUNBATHE_BACK", 0, true);
  518. Citizen.Wait(9999999000)
  519. ClearPedTasksImmediately(GetPlayerPed(-1))
  520. end
  521. end )
  522.  
  523. RegisterNetEvent('Weed')
  524. AddEventHandler('Weed', function()
  525.  
  526. local ped = GetPlayerPed( -1 )
  527. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  528. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_SMOKING_POT", 0, true);
  529. Citizen.Wait(9999999000)
  530. ClearPedTasksImmediately(GetPlayerPed(-1))
  531. end
  532. end )
  533.  
  534. RegisterNetEvent('Coffee')
  535. AddEventHandler('Coffee', function()
  536.  
  537. local ped = GetPlayerPed( -1 )
  538. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  539. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_AA_COFFEE", 0, true);
  540. Citizen.Wait(9999999000)
  541. ClearPedTasksImmediately(GetPlayerPed(-1))
  542. end
  543. end )
  544.  
  545. RegisterNetEvent('Photo')
  546. AddEventHandler('Photo', function()
  547.  
  548. local ped = GetPlayerPed( -1 )
  549. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  550. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_PAPARAZZI", 0, true);
  551. Citizen.Wait(9999999000)
  552. ClearPedTasksImmediately(GetPlayerPed(-1))
  553. end
  554. end )
  555.  
  556. RegisterNetEvent('Binoculars')
  557. AddEventHandler('Binoculars', function()
  558.  
  559. local ped = GetPlayerPed( -1 )
  560. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  561. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_BINOCULARS", 0, true);
  562. Citizen.Wait(9999999000)
  563. ClearPedTasksImmediately(GetPlayerPed(-1))
  564. end
  565. end )
  566.  
  567. RegisterNetEvent('Situps')
  568. AddEventHandler('Situps', function()
  569.  
  570. local ped = GetPlayerPed( -1 )
  571. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  572. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_SIT_UPS", 0, true);
  573. Citizen.Wait(9999999000)
  574. ClearPedTasksImmediately(GetPlayerPed(-1))
  575. end
  576. end )
  577.  
  578. RegisterNetEvent('Film')
  579. AddEventHandler('Film', function()
  580.  
  581. local ped = GetPlayerPed( -1 )
  582. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  583. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_MOBILE_FILM_SHOCKING", 0, true);
  584. Citizen.Wait(9999999000)
  585. ClearPedTasksImmediately(GetPlayerPed(-1))
  586. end
  587. end )
  588.  
  589. RegisterNetEvent('Weights')
  590. AddEventHandler('Weights', function()
  591.  
  592. local ped = GetPlayerPed( -1 )
  593. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  594. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_MUSCLE_FREE_WEIGHTS", 0, true);
  595. Citizen.Wait(9999999000)
  596. ClearPedTasksImmediately(GetPlayerPed(-1))
  597. end
  598. end )
  599.  
  600. RegisterNetEvent('Flex')
  601. AddEventHandler('Flex', function()
  602.  
  603. local ped = GetPlayerPed( -1 )
  604. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  605. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_MUSCLE_FLEX", 0, true);
  606. Citizen.Wait(9999999000)
  607. ClearPedTasksImmediately(GetPlayerPed(-1))
  608. end
  609. end )
  610.  
  611. RegisterNetEvent('Weld')
  612. AddEventHandler('Weld', function()
  613.  
  614. local ped = GetPlayerPed( -1 )
  615. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  616. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_WELDING", 0, true);
  617. Citizen.Wait(9999999000)
  618. ClearPedTasksImmediately(GetPlayerPed(-1))
  619. end
  620. end )
  621.  
  622. -- Civ Emotes End --
  623.  
  624. function dropweap()
  625. local ped = PlayerPedId()
  626. local wep = GetSelectedPedWeapon(ped)
  627. SetPedDropsWeaponsWhenDead(ped, true)
  628. RequestAnimDict("mp_weapon_drop")
  629. if DoesEntityExist(ped) and not IsEntityDead(ped) and not IsPedInAnyVehicle(ped, true) and not IsPauseMenuActive() and IsPedArmed(ped, 7) then -- INPUT_DROP_WEAPON (F7)
  630. TaskPlayAnim(ped, "mp_weapon_drop", "drop_bh", 8.0, 2.0, -1, 0, 2.0, 0, 0, 0 )
  631. SetPedDropsInventoryWeapon(ped, wep, 0, 2.0, 0, -1)
  632. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  633. ShowNotification("~w~You dropped your weapon.")
  634. end
  635. end
  636.  
  637. RegisterNetEvent("Handsup")
  638. AddEventHandler("Handsup", function()
  639. local lPed = GetPlayerPed(-1)
  640. if DoesEntityExist(lPed) then
  641. if not IsEntityPlayingAnim(lPed, "mp_arresting", "idle", 3) then
  642. RequestAnimDict("random@mugging3")
  643. while not HasAnimDictLoaded("random@mugging3") do
  644. Citizen.Wait(100)
  645. end
  646.  
  647. if IsEntityPlayingAnim(lPed, "random@mugging3", "handsup_standing_base", 3) then
  648. ClearPedSecondaryTask(lPed)
  649. SetEnableHandcuffs(lPed, false)
  650. SetCurrentPedWeapon(lPed, GetHashKey("WEAPON_UNARMED"), true)
  651. else
  652. TaskPlayAnim(lPed, "random@mugging3", "handsup_standing_base", 8.0, -8, -1, 49, 0, 0, 0, 0)
  653. SetEnableHandcuffs(lPed, true)
  654. SetCurrentPedWeapon(lPed, GetHashKey("WEAPON_UNARMED"), true)
  655. end
  656. end
  657. end
  658. end)
  659.  
  660. RegisterNetEvent("Handsdown")
  661. AddEventHandler("Handsdown", function()
  662. local lPed = GetPlayerPed(-1)
  663. if DoesEntityExist(lPed) then
  664. if IsEntityPlayingAnim(lPed, "mp_arresting", "idle", 3) then
  665. ClearPedSecondaryTask(lPed)
  666. SetEnableHandcuffs(lPed, false)
  667. SetCurrentPedWeapon(lPed, GetHashKey("WEAPON_UNARMED"), true)
  668. handcuff = false
  669. end
  670. end
  671. end)
  672.  
  673.  
  674.  
  675. --------------- Kneel with hands up ----------------
  676.  
  677. function loadAnimDict( dict )
  678. while ( not HasAnimDictLoaded( dict ) ) do
  679. RequestAnimDict( dict )
  680. Citizen.Wait( 5 )
  681. end
  682. end
  683.  
  684. RegisterNetEvent( 'KneelHU' )
  685. AddEventHandler( 'KneelHU', function()
  686. local player = GetPlayerPed( -1 )
  687. if ( DoesEntityExist( player ) and not IsEntityDead( player )) then
  688. loadAnimDict( "random@arrests" )
  689. loadAnimDict( "random@arrests@busted" )
  690. if ( IsEntityPlayingAnim( player, "random@arrests@busted", "idle_a", 3 ) ) then
  691. TaskPlayAnim( player, "random@arrests@busted", "exit", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  692. Wait (3000)
  693. TaskPlayAnim( player, "random@arrests", "kneeling_arrest_get_up", 8.0, 1.0, -1, 128, 0, 0, 0, 0 )
  694. else
  695. TaskPlayAnim( player, "random@arrests", "idle_2_hands_up", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  696. Wait (4000)
  697. TaskPlayAnim( player, "random@arrests", "kneeling_arrest_idle", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  698. Wait (500)
  699. TaskPlayAnim( player, "random@arrests@busted", "enter", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  700. Wait (1000)
  701. TaskPlayAnim( player, "random@arrests@busted", "idle_a", 8.0, 1.0, -1, 9, 0, 0, 0, 0 )
  702. end
  703. end
  704. end )
  705.  
  706. Citizen.CreateThread(function()
  707. while true do
  708. Citizen.Wait(0)
  709. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@arrests@busted", "idle_a", 3) then
  710. DisableControlAction(1, 140, true)
  711. DisableControlAction(1, 141, true)
  712. DisableControlAction(1, 142, true)
  713. DisableControlAction(0,21,true)
  714. end
  715. end
  716. end)
  717.  
  718. Citizen.CreateThread(function()
  719. while true do
  720. Citizen.Wait(0)
  721.  
  722. if ishandcuff and not IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "mp_arresting", "idle", 3) then
  723. Citizen.Wait(3000)
  724. Citizen.Trace("BACKUP CUFFING TRIGGERED")
  725. TaskPlayAnim(GetPlayerPed(PlayerId()), "mp_arresting", "idle", 8.0, -8, -1, 49, 0, 0, 0, 0)
  726. end
  727.  
  728. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "mp_arresting", "idle", 3) then
  729. DisableControlAction(1, 140, true)
  730. DisableControlAction(1, 141, true)
  731. DisableControlAction(1, 142, true)
  732. SetPedPathCanUseLadders(GetPlayerPed(PlayerId()), false)
  733. if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
  734. DisableControlAction(0, 59, true)
  735. end
  736. end
  737.  
  738. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@mugging3", "handsup_standing_base", 3) then
  739. DisableControlAction(1, 140, true)
  740. DisableControlAction(1, 141, true)
  741. DisableControlAction(1, 142, true)
  742. if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
  743. DisableControlAction(0, 59, true)
  744. end
  745. end
  746. end
  747. end)
  748.  
  749. function giveWeapon(weaponHash)
  750. GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(weaponHash), 999, false)
  751. end
  752.  
  753. -- Find at hashes https://wiki.fivem.net/wiki/Weapon_Components
  754. function weaponComponent(weaponHash, component)
  755. if HasPedGotWeapon(PlayerPedId(), GetHashKey(weaponHash), false) then
  756. GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(weaponHash), GetHashKey(component))
  757. end
  758. end
  759.  
  760. function SpawnVehicle(veh)
  761. local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 4.0, 0.5))
  762. if veh == nil then veh = "adder" end
  763. vehiclehash = GetHashKey(veh)
  764. RequestModel(vehiclehash)
  765.  
  766. Citizen.CreateThread(function()
  767. local waiting = 0
  768. while not HasModelLoaded(vehiclehash) do
  769. waiting = waiting + 100
  770. Citizen.Wait(100)
  771. if waiting > 10000 then
  772. ShowNotification("~r~Could not load the vehicle model in time, a crash was prevented.")
  773. break
  774. end
  775. end
  776. CreateVehicle(vehiclehash, x, y, z, GetEntityHeading(PlayerPedId()), 1, 0)
  777. end)
  778. end
  779.  
  780. function SpawnObject(objectname)
  781. local Player = GetPlayerPed(-1)
  782. local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 1.0, 0.5))
  783. local heading = GetEntityHeading(Player)
  784.  
  785. RequestModel(objectname)
  786.  
  787. while not HasModelLoaded(objectname) do
  788. Citizen.Wait(1)
  789. end
  790.  
  791. local obj = CreateObject(GetHashKey(objectname), x, y, z, true, true, true)
  792. PlaceObjectOnGroundProperly(obj)
  793. SetEntityHeading(obj, heading+180)
  794. FreezeEntityPosition(obj, true)
  795.  
  796. end
  797.  
  798. function DeleteOBJ(theobject)
  799. local object = GetHashKey(theobject)
  800. local x, y, z = table.unpack(GetEntityCoords(PlayerPedId(), true))
  801. if DoesObjectOfTypeExistAtCoords(x, y, z, 2.5, object, true) then
  802. local obj = GetClosestObjectOfType(x, y, z, 2.5, object, false, false, false)
  803. DeleteObject(obj)
  804. end
  805. end
  806.  
  807. local crouched = false
  808.  
  809. Citizen.CreateThread( function()
  810. while true do
  811. Citizen.Wait( 1 )
  812.  
  813. local ped = GetPlayerPed( -1 )
  814.  
  815. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  816. DisableControlAction( 0, 36, true ) -- INPUT_DUCK
  817.  
  818. if ( not IsPauseMenuActive() ) then
  819. if ( IsDisabledControlJustPressed( 0, 36 ) or crouchtoggle == true ) then
  820. RequestAnimSet( "move_ped_crouched" )
  821.  
  822. while ( not HasAnimSetLoaded( "move_ped_crouched" ) ) do
  823. Citizen.Wait( 100 )
  824. end
  825.  
  826. if ( crouched == true ) then
  827. ResetPedMovementClipset( ped, 0 )
  828. crouched = false
  829. elseif ( crouched == false ) then
  830. SetPedMovementClipset( ped, "move_ped_crouched", 0.25 )
  831. crouched = true
  832. end
  833. crouchtoggle = false
  834. end
  835. end
  836. end
  837. end
  838. end )
  839.  
  840. function CheckPedRestriction(ped, PedList)
  841. for i = 1, #PedList do
  842. if GetHashKey(PedList[i]) == GetEntityModel(ped) then
  843. return true
  844. end
  845. end
  846. return false
  847. end
  848.  
  849. function GetLocalPed()
  850. return GetPlayerPed(PlayerId())
  851. end
  852.  
  853. function GetPlayers()
  854. local players = {}
  855.  
  856. for i = 0, 31 do
  857. if NetworkIsPlayerActive(i) then
  858. table.insert(players, i)
  859. end
  860. end
  861.  
  862. return players
  863. end
  864.  
  865. function GetClosestPlayer()
  866. local players = GetPlayers()
  867. local closestDistance = -1
  868. local closestPlayer = -1
  869. local ply = GetPlayerPed(-1)
  870. local plyCoords = GetEntityCoords(ply, 0)
  871.  
  872. for index,value in ipairs(players) do
  873. local target = GetPlayerPed(value)
  874. if(target ~= ply) then
  875. local targetCoords = GetEntityCoords(GetPlayerPed(value), 0)
  876. local distance = Vdist(targetCoords["x"], targetCoords["y"], targetCoords["z"], plyCoords["x"], plyCoords["y"], plyCoords["z"])
  877. if(closestDistance == -1 or closestDistance > distance) then
  878. closestPlayer = value
  879. closestDistance = distance
  880. end
  881. end
  882. end
  883.  
  884. return closestPlayer, closestDistance
  885. end
  886.  
  887. local isHandcuffed = false
  888.  
  889. local drag = false
  890. local playerStillDragged = false
  891. local officerDrag = -1
  892.  
  893. RegisterNetEvent('cuff')
  894. AddEventHandler('cuff',function()
  895. local t, distance = GetClosestPlayer()
  896. if(distance ~= -1 and distance < 3) then
  897. TriggerServerEvent("cuffGranted", GetPlayerServerId(t))
  898. else
  899. ShowNotification("There is no nearby player to cuff!")
  900. end
  901. end)
  902.  
  903. RegisterNetEvent('uncuff')
  904. AddEventHandler('uncuff',function()
  905. local t, distance = GetClosestPlayer()
  906. if(distance ~= -1 and distance < 3) then
  907. TriggerServerEvent("uncuffGranted", GetPlayerServerId(t))
  908. else
  909. ShowNotification("There is no nearby player to uncuff!")
  910. end
  911. end)
  912.  
  913. RegisterNetEvent('getCuffed')
  914. AddEventHandler('getCuffed', function()
  915. local ped = GetPlayerPed(-1)
  916. RequestAnimDict('mp_arresting')
  917. while not HasAnimDictLoaded('mp_arresting') do
  918. Citizen.Wait(100)
  919. end
  920.  
  921. TaskPlayAnim(ped, 'mp_arresting', 'idle', 8.0, -8, -1, 49, 0, 0, 0, 0)
  922. SetEnableHandcuffs(ped, true)
  923. SetCurrentPedWeapon(ped, GetHashKey('WEAPON_UNARMED'), true)
  924. DisablePlayerFiring(ped, true)
  925.  
  926. isHandcuffed = true
  927. end)
  928.  
  929. RegisterNetEvent('getUncuffed')
  930. AddEventHandler('getUncuffed', function()
  931. local ped = GetPlayerPed(-1)
  932.  
  933. ClearPedSecondaryTask(ped)
  934. SetEnableHandcuffs(ped, false)
  935. DisablePlayerFiring(ped, false)
  936. SetCurrentPedWeapon(ped, GetHashKey('WEAPON_UNARMED'), true)
  937. FreezeEntityPosition(ped, false)
  938.  
  939. isHandcuffed = false
  940. end)
  941.  
  942. Citizen.CreateThread(function()
  943. while true do
  944. Citizen.Wait(10)
  945.  
  946. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "mp_arresting", "idle", 3) then
  947. DisableControlAction(1, 140, true)
  948. DisableControlAction(1, 141, true)
  949. DisableControlAction(1, 142, true)
  950. if IsPedInAnyVehicle(GetPlayerPed(PlayerId()), false) then
  951. DisableControlAction(0, 59, true)
  952. end
  953. end
  954.  
  955. if drag then
  956. local ped = GetPlayerPed(GetPlayerFromServerId(officerDrag))
  957. local myped = GetPlayerPed(-1)
  958. SetEnableHandcuffs(ped, true)
  959. DisablePlayerFiring(ped, true)
  960. SetCurrentPedWeapon(ped, GetHashKey('WEAPON_UNARMED'), true)
  961. AttachEntityToEntity(myped, ped, 4103, 11816, 0.48, 0.00, 0.0, 0.0, 0.0, 0.0, false, false, false, false, 2, true)
  962. playerStillDragged = true
  963.  
  964. local myPed = PlayerPedId(-1)
  965.  
  966. while(IsPedBeingStunned(myPed, 0)) do
  967. ClearPedTasksImmediately(myPed)
  968. end
  969. else
  970. if(playerStillDragged) then
  971. DetachEntity(GetPlayerPed(-1), true, false)
  972. SetEnableHandcuffs(ped, false)
  973. DisablePlayerFiring(ped, false)
  974. playerStillDragged = false
  975. end
  976. end
  977.  
  978. end
  979. end)
  980.  
  981. function DragPlayer()
  982. local t, distance = GetClosestPlayer()
  983.  
  984. if(distance ~= -1 and distance < 3) then
  985. TriggerServerEvent("dragRequest", GetPlayerServerId(t))
  986. else
  987. ShowNotification("There is no nearby player to drag!")
  988. end
  989. end
  990.  
  991. RegisterNetEvent('toggleDrag')
  992. AddEventHandler('toggleDrag', function(t)
  993.  
  994. drag = not drag
  995. officerDrag = t
  996. end)
  997.  
  998. Citizen.CreateThread(function()
  999. while true do
  1000. if drag then
  1001. local ped = GetPlayerPed(GetPlayerFromServerId(playerPedDragged))
  1002. plyPos = GetEntityCoords(ped, true)
  1003. SetEntityCoords(ped, plyPos.x, plyPos.y, plyPos.z)
  1004. end
  1005. Citizen.Wait(1000)
  1006. end
  1007. end)
  1008.  
  1009. --Spikes
  1010. function SetSpikesOnGround()
  1011. local Player = GetPlayerPed(-1)
  1012. local heading = GetEntityHeading(Player)
  1013. local x,y,z = table.unpack(GetOffsetFromEntityInWorldCoords(PlayerPedId(), 0.0, 2.5, 0.5))
  1014.  
  1015. spike = GetHashKey("P_ld_stinger_s")
  1016.  
  1017. RequestModel(spike)
  1018. while not HasModelLoaded(spike) do
  1019. Citizen.Wait(1)
  1020. end
  1021.  
  1022. local object = CreateObject(spike, x, y, z, true, true, true) -- x+1
  1023. PlaceObjectOnGroundProperly(object)
  1024. SetEntityHeading(object, heading)
  1025. FreezeEntityPosition(object, true)
  1026. end
  1027.  
  1028. Citizen.CreateThread(function()
  1029. while true do
  1030. Citizen.Wait(0)
  1031. local ped = GetPlayerPed(-1)
  1032. local veh = GetVehiclePedIsIn(ped, false)
  1033. local vehCoord = GetEntityCoords(veh)
  1034. if IsPedInAnyVehicle(ped, false) then
  1035. if DoesObjectOfTypeExistAtCoords(vehCoord["x"], vehCoord["y"], vehCoord["z"], 0.9, GetHashKey("P_ld_stinger_s"), true) then
  1036. SetVehicleTyreBurst(veh, 0, true, 1000.0)
  1037. SetVehicleTyreBurst(veh, 1, true, 1000.0)
  1038. SetVehicleTyreBurst(veh, 2, true, 1000.0)
  1039. SetVehicleTyreBurst(veh, 3, true, 1000.0)
  1040. SetVehicleTyreBurst(veh, 4, true, 1000.0)
  1041. SetVehicleTyreBurst(veh, 5, true, 1000.0)
  1042. SetVehicleTyreBurst(veh, 6, true, 1000.0)
  1043. SetVehicleTyreBurst(veh, 7, true, 1000.0)
  1044. RemoveSpike()
  1045. end
  1046. end
  1047. end
  1048. end)
  1049.  
  1050. function RemoveSpike()
  1051. local ped = GetPlayerPed(-1)
  1052. local veh = GetVehiclePedIsIn(ped, false)
  1053. local vehCoord = GetEntityCoords(veh)
  1054. if DoesObjectOfTypeExistAtCoords(vehCoord["x"], vehCoord["y"], vehCoord["z"], 0.9, GetHashKey("P_ld_stinger_s"), true) then
  1055. spike = GetClosestObjectOfType(vehCoord["x"], vehCoord["y"], vehCoord["z"], 0.9, GetHashKey("P_ld_stinger_s"), false, false, false)
  1056. SetEntityAsMissionEntity(spike, true, true)
  1057. DeleteObject(spike)
  1058. end
  1059. end
  1060.  
  1061. --Notifications
  1062. function ShowNotification(text)
  1063. SetNotificationTextEntry("STRING")
  1064. AddTextComponentString(text)
  1065. DrawNotification(false, false)
  1066. end
  1067.  
  1068. -- Emote Cancel Functions
  1069.  
  1070. Citizen.CreateThread(function()
  1071. while true do
  1072. Citizen.Wait(0)
  1073. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_SMOKING") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1074. ClearPedTasks(GetPlayerPed(-1))
  1075. end
  1076. end
  1077. end)
  1078.  
  1079. Citizen.CreateThread(function()
  1080. while true do
  1081. Citizen.Wait(0)
  1082. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_DRINKING") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1083. ClearPedTasks(GetPlayerPed(-1))
  1084. end
  1085. end
  1086. end)
  1087.  
  1088. Citizen.CreateThread(function()
  1089. while true do
  1090. Citizen.Wait(0)
  1091. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_PARTYING") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1092. ClearPedTasks(GetPlayerPed(-1))
  1093. end
  1094. end
  1095. end)
  1096.  
  1097. Citizen.CreateThread(function()
  1098. while true do
  1099. Citizen.Wait(0)
  1100. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_PUSH_UPS") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1101. ClearPedTasks(GetPlayerPed(-1))
  1102. end
  1103. end
  1104. end)
  1105.  
  1106. Citizen.CreateThread(function()
  1107. while true do
  1108. Citizen.Wait(0)
  1109. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_STAND_MOBILE") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1110. ClearPedTasks(GetPlayerPed(-1))
  1111. end
  1112. end
  1113. end)
  1114.  
  1115. Citizen.CreateThread(function()
  1116. while true do
  1117. Citizen.Wait(0)
  1118. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_SUNBATHE_BACK") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1119. ClearPedTasks(GetPlayerPed(-1))
  1120. end
  1121. end
  1122. end)
  1123.  
  1124. Citizen.CreateThread(function()
  1125. while true do
  1126. Citizen.Wait(0)
  1127. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_SMOKING_POT") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1128. ClearPedTasks(GetPlayerPed(-1))
  1129. end
  1130. end
  1131. end)
  1132.  
  1133. Citizen.CreateThread(function()
  1134. while true do
  1135. Citizen.Wait(0)
  1136. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_AA_COFFEE") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1137. ClearPedTasks(GetPlayerPed(-1))
  1138. end
  1139. end
  1140. end)
  1141.  
  1142. Citizen.CreateThread(function()
  1143. while true do
  1144. Citizen.Wait(0)
  1145. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_PAPARAZZI") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1146. ClearPedTasks(GetPlayerPed(-1))
  1147. end
  1148. end
  1149. end)
  1150.  
  1151. Citizen.CreateThread(function()
  1152. while true do
  1153. Citizen.Wait(0)
  1154. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_BINOCULARS") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1155. ClearPedTasks(GetPlayerPed(-1))
  1156. end
  1157. end
  1158. end)
  1159.  
  1160. Citizen.CreateThread(function()
  1161. while true do
  1162. Citizen.Wait(0)
  1163. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_SIT_UPS") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1164. ClearPedTasks(GetPlayerPed(-1))
  1165. end
  1166. end
  1167. end)
  1168.  
  1169. Citizen.CreateThread(function()
  1170. while true do
  1171. Citizen.Wait(0)
  1172. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_MOBILE_FILM_SHOCKING") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1173. ClearPedTasks(GetPlayerPed(-1))
  1174. end
  1175. end
  1176. end)
  1177.  
  1178. Citizen.CreateThread(function()
  1179. while true do
  1180. Citizen.Wait(0)
  1181. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_MUSCLE_FREE_WEIGHTS") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1182. ClearPedTasks(GetPlayerPed(-1))
  1183. end
  1184. end
  1185. end)
  1186.  
  1187. Citizen.CreateThread(function()
  1188. while true do
  1189. Citizen.Wait(0)
  1190. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_MUSCLE_FLEX") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1191. ClearPedTasks(GetPlayerPed(-1))
  1192. end
  1193. end
  1194. end)
  1195.  
  1196. Citizen.CreateThread(function()
  1197. while true do
  1198. Citizen.Wait(0)
  1199. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_COP_IDLES") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1200. ClearPedTasks(GetPlayerPed(-1))
  1201. end
  1202. end
  1203. end)
  1204.  
  1205. Citizen.CreateThread(function()
  1206. while true do
  1207. Citizen.Wait(0)
  1208. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_GUARD_STAND") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1209. ClearPedTasks(GetPlayerPed(-1))
  1210. end
  1211. end
  1212. end)
  1213.  
  1214. Citizen.CreateThread(function()
  1215. while true do
  1216. Citizen.Wait(0)
  1217. if IsPedUsingScenario(GetPlayerPed(-1), "CODE_HUMAN_MEDIC_TIME_OF_DEATH") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1218. ClearPedTasdwks(GetPlayerPed(-1))
  1219. end
  1220. end
  1221. end)
  1222.  
  1223. Citizen.CreateThread(function()
  1224. while true do
  1225. Citizen.Wait(0)
  1226. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_CLIPBOARD") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1227. ClearPedTasks(GetPlayerPed(-1))
  1228. end
  1229. end
  1230. end)
  1231.  
  1232. Citizen.CreateThread(function()
  1233. while true do
  1234. Citizen.Wait(0)
  1235. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_WELDING") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1236. ClearPedTasks(GetPlayerPed(-1))
  1237. end
  1238. end
  1239. end)
  1240.  
  1241. Citizen.CreateThread(function()
  1242. while true do
  1243. Citizen.Wait(0)
  1244. if IsPedUsingScenario(GetPlayerPed(-1), "WORLD_HUMAN_CAR_PARK_ATTENDANT") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1245. ClearPedTasks(GetPlayerPed(-1))
  1246. end
  1247. end
  1248. end)
  1249.  
  1250. Citizen.CreateThread(function()
  1251. while true do
  1252. Citizen.Wait(0)
  1253. if IsPedUsingScenario(GetPlayerPed(-1), "CODE_HUMAN_MEDIC_KNEEL") and (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
  1254. ClearPedTasks(GetPlayerPed(-1))
  1255. end
  1256. end
  1257. end)
  1258.  
  1259. -- Emote Cancel Functions
  1260.  
  1261. --[LEO Animations Start]
  1262.  
  1263. -- Hand on Radio Start
  1264.  
  1265. RegisterNetEvent('Radio')
  1266. AddEventHandler('Radio', function()
  1267.  
  1268. local ped = GetPlayerPed( -1 )
  1269.  
  1270. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1271.  
  1272. Citizen.CreateThread( function()
  1273. RequestAnimDict( "random@arrests" )
  1274. while ( not HasAnimDictLoaded( "random@arrests" ) ) do
  1275. Citizen.Wait( 100 )
  1276. end
  1277. if IsEntityPlayingAnim(ped, "random@arrests", "generic_radio_chatter", 3) then
  1278. ClearPedSecondaryTask(ped)
  1279. SetCurrentPedWeapon(ped, GetHashKey("GENERIC_RADIO_CHATTER"), true)
  1280. else
  1281. TaskPlayAnim(ped, "random@arrests", "generic_radio_chatter", 8.0, 2.5, -1, 49, 0, 0, 0, 0 )
  1282. SetCurrentPedWeapon(ped, GetHashKey("GENERIC_RADIO_CHATTER"), true)
  1283. end
  1284. end )
  1285. end
  1286. end )
  1287.  
  1288. -- Hand on Radio End
  1289.  
  1290. -- Hand on Radio W/ Gun Start
  1291.  
  1292. function loadAnimDict( dict )
  1293. while ( not HasAnimDictLoaded( dict ) ) do
  1294. RequestAnimDict( dict )
  1295. Citizen.Wait( 5 )
  1296. end
  1297. end
  1298.  
  1299. RegisterNetEvent( 'RadioGunPoint' )
  1300. AddEventHandler( 'RadioGunPoint', function()
  1301. local ped = GetPlayerPed( -1 )
  1302. if ( DoesEntityExist( ped ) and not IsEntityDead( ped )) then
  1303. loadAnimDict( "random@arrests" )
  1304. if ( IsEntityPlayingAnim( ped, "random@arrests", "radio_chatter", 3 ) ) then
  1305. ClearPedSecondaryTask(ped)
  1306. SetEnableHandcuffs(ped, false)
  1307. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  1308. else
  1309. TaskPlayAnim(ped, "random@arrests", "radio_chatter", 8.0, 2.5, -1, 49, 0, 0, 0, 0 )
  1310. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_PISTOL"), true)
  1311. end
  1312. end
  1313. end )
  1314.  
  1315. Citizen.CreateThread(function()
  1316. while true do
  1317. Citizen.Wait(0)
  1318. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@arrests", "radio_chatter", 3) then
  1319. DisableControlAction(0, 21, true)
  1320. DisableControlAction(1, 140, true)
  1321. DisableControlAction(1, 141, true)
  1322. DisableControlAction(1, 142, true)
  1323. end
  1324. end
  1325. end)
  1326.  
  1327. -- Hand on Radio W/ Gun End
  1328.  
  1329. -- LEO Stance Start
  1330.  
  1331. RegisterNetEvent('Stance')
  1332. AddEventHandler('Stance', function()
  1333.  
  1334. local ped = GetPlayerPed( -1 )
  1335. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1336. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_COP_IDLES", 0, true);
  1337. Citizen.Wait(15000)
  1338. ClearPedTasksImmediately(GetPlayerPed(-1))
  1339. end
  1340. end )
  1341.  
  1342. -- LEO Stance End
  1343.  
  1344. -- Investigate Start
  1345.  
  1346. RegisterNetEvent('Investigate')
  1347. AddEventHandler('Investigate', function()
  1348.  
  1349. local ped = GetPlayerPed( -1 )
  1350. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1351. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_GUARD_STAND", 0, true);
  1352. Citizen.Wait(15000)
  1353. ClearPedTasksImmediately(GetPlayerPed(-1))
  1354. end
  1355. end )
  1356.  
  1357. -- Investigate End
  1358.  
  1359. -- Holster Start
  1360.  
  1361. RegisterNetEvent( 'Holster' )
  1362. AddEventHandler( 'Holster', function()
  1363. local ped = GetPlayerPed( -1 )
  1364. if ( DoesEntityExist( ped ) and not IsEntityDead( ped )) then
  1365. loadAnimDict( "move_m@intimidation@cop@unarmed" )
  1366. if ( IsEntityPlayingAnim( ped, "move_m@intimidation@cop@unarmed", "idle", 3 ) ) then
  1367. ClearPedSecondaryTask(ped)
  1368. SetEnableHandcuffs(ped, false)
  1369. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  1370. else
  1371. TaskPlayAnim(ped, "move_m@intimidation@cop@unarmed", "idle", 8.0, 2.5, -1, 49, 0, 0, 0, 0 )
  1372. SetEnableHandcuffs(ped, true)
  1373. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  1374. end
  1375. end
  1376. end )
  1377.  
  1378. Citizen.CreateThread(function()
  1379. while true do
  1380. Citizen.Wait(0)
  1381. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "move_m@intimidation@cop@unarmed", "idle", 3) then
  1382. DisableControlAction(0, 21, true)
  1383. DisableControlAction(1, 140, true)
  1384. DisableControlAction(1, 141, true)
  1385. DisableControlAction(1, 142, true)
  1386. end
  1387. end
  1388. end)
  1389.  
  1390. -- Holster End
  1391.  
  1392. -- Citation Start
  1393.  
  1394.  
  1395. RegisterNetEvent('Citation')
  1396. AddEventHandler('Citation', function()
  1397.  
  1398. local ped = GetPlayerPed( -1 )
  1399. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1400. TaskStartScenarioInPlace(PlayerPedId(), "CODE_HUMAN_MEDIC_TIME_OF_DEATH", 0, true);
  1401. Citizen.Wait(9999999000)
  1402. ClearPedTasksImmediately(GetPlayerPed(-1))
  1403. end
  1404. end )
  1405.  
  1406. -- Citation End
  1407.  
  1408. -- Take Notes Start
  1409.  
  1410.  
  1411. RegisterNetEvent('Notes')
  1412. AddEventHandler('Notes', function()
  1413.  
  1414. local ped = GetPlayerPed( -1 )
  1415. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1416. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CLIPBOARD", 0, true);
  1417. Citizen.Wait(9999999000)
  1418. ClearPedTasksImmediately(GetPlayerPed(-1))
  1419. end
  1420. end )
  1421.  
  1422. -- Take Notes End
  1423.  
  1424.  
  1425. RegisterNetEvent( 'cancelEmote' )
  1426. AddEventHandler( 'cancelEmote', function()
  1427. local ped = GetPlayerPed( -1 )
  1428. if ( DoesEntityExist( ped ) and not IsEntityDead( ped )) then
  1429. ClearPedSecondaryTask(ped)
  1430. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  1431. end
  1432. end )
  1433.  
  1434. -- Direct Traffic Start
  1435.  
  1436.  
  1437. RegisterNetEvent('Traffic')
  1438. AddEventHandler('Traffic', function()
  1439.  
  1440. local ped = GetPlayerPed( -1 )
  1441. if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then
  1442. TaskStartScenarioInPlace(PlayerPedId(), "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, true);
  1443. Citizen.Wait(9999999000)
  1444. ClearPedTasksImmediately(GetPlayerPed(-1))
  1445. end
  1446. end )
  1447. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement