Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BUtton code cl_action.lua
- elseif ( data == "button6" ) then
- KneelHU()
- Function at the bottom of cl_action.lua
- --kneel handsup
- function loadAnimDict( dict )
- while ( not HasAnimDictLoaded( dict ) ) do
- RequestAnimDict( dict )
- Citizen.Wait( 5 )
- end
- end
- RegisterNetEvent( 'KneelHU' )
- AddEventHandler( 'KneelHU', function()
- local player = GetPlayerPed( -1 )
- if ( DoesEntityExist( player ) and not IsEntityDead( player )) then
- loadAnimDict( "random@arrests" )
- loadAnimDict( "random@arrests@busted" )
- if ( IsEntityPlayingAnim( player, "random@arrests@busted", "idle_a", 3 ) ) then
- TaskPlayAnim( player, "random@arrests@busted", "exit", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
- Wait (3000)
- TaskPlayAnim( player, "random@arrests", "kneeling_arrest_get_up", 8.0, 1.0, -1, 128, 0, 0, 0, 0 )
- else
- TaskPlayAnim( player, "random@arrests", "idle_2_hands_up", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
- Wait (4000)
- TaskPlayAnim( player, "random@arrests", "kneeling_arrest_idle", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
- Wait (500)
- TaskPlayAnim( player, "random@arrests@busted", "enter", 8.0, 1.0, -1, 2, 0, 0, 0, 0 )
- Wait (1000)
- TaskPlayAnim( player, "random@arrests@busted", "idle_a", 8.0, 1.0, -1, 9, 0, 0, 0, 0 )
- end
- end
- end )
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "random@arrests@busted", "idle_a", 3) then
- DisableControlAction(1, 140, true)
- DisableControlAction(1, 141, true)
- DisableControlAction(1, 142, true)
- DisableControlAction(0,21,true)
- end
- end
- end)
- My ui.html for this submenu
- <div id="civ" data-parent="mainmenu" style="display: none;">
- <button class="menuoption" data-action="button5">Hands Up</button>
- <button class="menuoption" data-action="button6">Hands Up and Kneel</button>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement