Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. BUtton code cl_action.lua
  2.  
  3. elseif ( data == "button6" ) then
  4. KneelHU()
  5.  
  6. Function at the bottom of cl_action.lua
  7.  
  8. --kneel handsup
  9.  
  10. function loadAnimDict( dict )
  11. while ( not HasAnimDictLoaded( dict ) ) do
  12. RequestAnimDict( dict )
  13. Citizen.Wait( 5 )
  14. end
  15. end
  16.  
  17. RegisterNetEvent( 'KneelHU' )
  18. AddEventHandler( 'KneelHU', function()
  19. local player = GetPlayerPed( -1 )
  20. if ( DoesEntityExist( player ) and not IsEntityDead( player )) then
  21. loadAnimDict( "random@arrests" )
  22. loadAnimDict( "random@arrests@busted" )
  23. if ( IsEntityPlayingAnim( player, "random@arrests@busted", "idle_a", 3 ) ) then
  24. TaskPlayAnim( player, "random@arrests@busted", "exit", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  25. Wait (3000)
  26. TaskPlayAnim( player, "random@arrests", "kneeling_arrest_get_up", 8.0, 1.0, -1, 128, 0, 0, 0, 0 )
  27. else
  28. TaskPlayAnim( player, "random@arrests", "idle_2_hands_up", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  29. Wait (4000)
  30. TaskPlayAnim( player, "random@arrests", "kneeling_arrest_idle", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  31. Wait (500)
  32. TaskPlayAnim( player, "random@arrests@busted", "enter", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
  33. Wait (1000)
  34. TaskPlayAnim( player, "random@arrests@busted", "idle_a", 8.0, 1.0, -1, 9, 0, 0, 0, 0 )
  35. end
  36. end
  37. end )
  38.  
  39. Citizen.CreateThread(function()
  40. while true do
  41. Citizen.Wait(0)
  42. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@arrests@busted", "idle_a", 3) then
  43. DisableControlAction(1, 140, true)
  44. DisableControlAction(1, 141, true)
  45. DisableControlAction(1, 142, true)
  46. DisableControlAction(0,21,true)
  47. end
  48. end
  49. end)
  50.  
  51. My ui.html for this submenu
  52.  
  53. <div id="civ" data-parent="mainmenu" style="display: none;">
  54. <button class="menuoption" data-action="button5">Hands Up</button>
  55. <button class="menuoption" data-action="button6">Hands Up and Kneel</button>
  56. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement