Chat Commands to F6 Menu Please help

Hello. sorry for my Bad english i use Google Translator. Im From germany.

I need some help. I have this script.

is it possible that I put commands on the F6 menu? I’ve already looked and I just can’t find the right command. I am currently so far that I know I have to somehow embed executecommand (COMMANDNAME) but unfortunately I don’t know how. Can you possibly help me? Kind regards

EliteTank277

744 - 756 on client/main.lua

			local elements = {
				{label = _U('id_card'),			value = 'identity_card'},
				--{label = _U('search'),			value = 'body_search'},
				{label = _U('handcuff'),		value = 'handcuff'},
				{label = _U('drag'),			value = 'drag'},
				{label = _U('put_in_vehicle'),	value = 'put_in_vehicle'},
				{label = _U('out_the_vehicle'),	value = 'out_the_vehicle'},
				--{label = _U('fine'),			value = 'fine'},
				--{label = _U('jail'),			value = 'jail'},
				--{label = _U('unpaid_bills'),	value = 'unpaid_bills'},
				{label = _U('revive player'),   value = 'revive'},
                {label = "Custom Command",   value = 'custommenu'} -- your new menu line
			}

793 - enter new line and paste

elseif action == 'custommenu' then    -- if selected by menu run this command        
		ExecuteCommand("WhatYouWant") -- sample : ExecuteCommand("me pickup apple on ground") Output : /me pickup apple on ground

Thanks so much. it works. is it possible that the command can only be activated in one of these vehicles? For example. Vehicle model 1 does not work, vehicle model 2 works?

You should be able to do this to the last block of code DkingZs posted then:

elseif action == 'custommenu' then    -- if selected by menu run this command
		if GetVehiclePedIsIn(PlayerPedId(), false) == 'car1' or 'car2' then    -- Check for the vehicle ped is in and proceed if match found    
				ExecuteCommand("WhatYouWant") -- sample : ExecuteCommand("me pickup apple on ground") Output : /me pickup apple on ground
		end

You might want to switch places on the checks depending on how it behaves, I’m not the best with anything UI-related so don’t take my word for it lol

Hey thank you, but I have to disappoint you, it doesn’t work. Still, thank you very much.

Change this to

elseif action == 'custommenu' then 
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped,false)
		if vehicle == 'car1' or vehicle == 'car2' then       
				ExecuteCommand("WhatYouWant")
		end

Hello, sorry for the late response. I’m sorry Doesn’t work for me. but is not bad …

Kind regards