[Release] ActionMenu [1.0.1] (Updated April 2018)

how would i add a load out script to this?

is there a way i can toggle your radar gui with this action menu script?

Hey can you paste bin me the kneel and HU?

Use the example for handsup and then just make your own animations.

mine still doesn’t work can you pastebin me your handsup kneel files. cl_action.lua nui.html

would anyone happend to have a function for toggling on and off a gun?

for anyone wanting gun holster just released by @Deziel0495 here is the code!

your cl_action button code:

    elseif ( data == "gh" ) then 
        TriggerEvent( 'gunHolster' )

bottom of cl_action.lua:

--GunHolster start

RegisterNetEvent('gunHolster')
AddEventHandler('gunHolster', function()

local ped = GetPlayerPed( -1 )
    
if ( DoesEntityExist( ped ) and not IsEntityDead( ped ) ) then 

Citizen.CreateThread( function()
	RequestAnimDict( "move_m@intimidation@cop@unarmed" )
	   while ( not HasAnimDictLoaded( "move_m@intimidation@cop@unarmed" ) ) do 
                Citizen.Wait( 100 )
            end
				if IsEntityPlayingAnim(ped, "move_m@intimidation@cop@unarmed", "idle", 3) then
				ClearPedSecondaryTask(ped)
				SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
				else
				TaskPlayAnim(ped, "move_m@intimidation@cop@unarmed", "idle", 8.0, 2.5, -1, 49, 0, 0, 0, 0 )
				SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
            end 
        end )
    end 
end )

--GunHolster End

nui.html:

<button class="menuoption" data-action="gh">Hold onto your gun holster</button>
1 Like

for the people wanting radar or asking how to get radar,engine,trunk,Handsup,KneelHU or even the holster by @Deziel0495 here mine work if anyone gets the windows or doors please let me know!

here are my menu files: menu-V2.zip (6.5 KB)

NOTICE: ANY COPYRIGHT TEXT WAS NOT MODIFIED OR DELETED UNLESS I COPIED A SCRIPT AND PASTED OVER THE COPYRIGHT/CREDITS TEXT Please Let me Know if you found the credits list messed up thanks :wink:

@rhys19 When I downloaded yours and put it in my folder and added it to server.cfg now it says could not load resource “menu” could you explain why this is happening and/or how to fix it.

is there a certain error code?

i will look over my code and see

@WolfKnight179 may i re-release this with some additions to it but give the propper credits?

@JSRPOwner i may have fixed the menu you can try the download again this time its named menu-v2.zip so you will have to rename it to menu and add it then open up the menu/ui.js and change:

// Send data to lua for processing.
function sendData( name, data ) {
    $.post( "http://m-menu/" + name, JSON.stringify( data ), function( datab ) {
        if ( datab != "ok" ) {
            console.log( datab );
        }            
    } );
}

to

// Send data to lua for processing.
function sendData( name, data ) {
    $.post( "http://menu/" + name, JSON.stringify( data ), function( datab ) {
        if ( datab != "ok" ) {
            console.log( datab );
        }            
    } );
}

Yep no problem, just make sure the credits of all the script authors are there.

ok and im not messing with the credits inside your files i will just add modified by rhys19 in there and keep the rest of your credits in the files :wink:

@WolfKnight179 here is the modified version: [Rewritten][Release]NativeUI M-menu [3.1]

How do i stop it from closing after selecting an option?

Comment the second to last line here: I added a comment in the line.

RegisterNUICallback( "ButtonClick", function( data, cb ) 
	if ( data == "button1" ) then 
		chatPrint( "Button 1 pressed!" )
	elseif ( data == "button2" ) then 
		chatPrint( "Button 2 pressed!" )
	elseif ( data == "button3" ) then 
		chatPrint( "Button 3 pressed!" )
	elseif ( data == "button4" ) then 
		chatPrint( "Button 4 pressed!" )
	elseif ( data == "exit" ) then 
		-- We toggle the ActionMenu and return here, otherwise the function 
		-- call below would be executed too, which would just open the menu again 
		ToggleActionMenu()
		return 
	end 

	-- This will only be called if any button other than the exit button is pressed
	ToggleActionMenu() --***Commenting this line will leave the menu open after button is pressed
end )

Works perfect thanks again decon.

How can I change the name of the resource just wondering?

Refer to @rhys19’s post above for changing the resource name.

1 Like