How to execute animations via a LUA Menu (with exemple)

I need a list of the animations and the tuto for execute a Animation when a player click on the name of the Animation :slight_smile:

I have make a code for test…

local applau
local carte

RegisterNUICallback("animation", function(data, cb)

	local action = data.action
	
	if action == "applau" then
	TaskINSTERTANIMATION(GetPlayerPed(-1), 1000, GetPlayerPed(-1), -1, true)
	drawNotification("~g~You Applaud")
	elseif action == "carte" then
	   drawNotification("~g~You Check The Map")
	end
	
	cb("ok")
end)

What is the Animation for Applaud pls ?

Hey Zuqaa :slight_smile:

I follow your work and hope to see that out soon :slight_smile:

Maybe this YT video can help you :slight_smile: :slight_smile:

Thx i have find the animation, its cheering :stuck_out_tongue:

1 Like

Now i try to test the addon for check if its working

Hope that works :slight_smile:

Good Luck Zuqaa, and please share us your script when it’s ok :slight_smile:

Thank you.

Yep np i made a Personal Menu :wink:

1 Like

He doesnt work :confused: my code is bad… u have a good code for execute a animation(the good native if possible) ?

Are you just trying to execute an animation?

Yes i have trying, and it doesnt work

Is what you tried in your original post?

Yes and all commands doesnt work :confused:

pls help me dude :cry:

EN : Have you fix it, i’m a little boring of this me too… ahah

FR : T’as trouvé? Car ça me pète les couilles aussi !!! :stuck_out_tongue:

EDIT : Done ! Sry :stuck_out_tongue:

Citizen.CreateThread(function()
local pid = PlayerPedId()
RequestAnimDict(“friends”)
RequestAnimDict(“friends@frj”)
RequestAnimDict(“friends@frj@ig_1”)
while (not HasAnimDictLoaded(“friends@frj@ig_1”)) do Citizen.Wait(0) end
TaskPlayAnim(pid,“friends@frj@ig_1”,“wave_a”,1.0,-1.0, 5000, 0, 1, true, true, true)
end)

and

Animations List

You just have to replace the actions with those of your choice

emotes = {
	["/smoke"] = { cmd = '/smoke', event = 'playSmokeEmote' },
}

after :

RegisterNetEvent('playSmokeEmote');
playing_emote = false;
AddEventHandler('playSmokeEmote', function()
	ped = GetPlayerPed(-1);
	
	if ped then
		TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SMOKING", 0, true);
		playing_emote = true;
	end
	
	Menu.hidden = true
end)
Menu.addButton("Fumer", "TriggerEvent", emotes["/smoke"].event)

exemple for smock emote in my menu

How to use this function in a menu plz ?

You can also use this:

local playing_emote = false;

(At the beginning of the file)
and:

  	TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SMOKING", 0, true);
  	playing_emote = true;

use like this:

emotes = {
[“/smoke”] = { cmd = ‘/smoke’, event = ‘playSmokeEmote’ },
}
after :

RegisterNetEvent(‘playSmokeEmote’);
playing_emote = false;
AddEventHandler(‘playSmokeEmote’, function()
ped = GetPlayerPed(-1);

if ped then
TaskStartScenarioInPlace(ped, “WORLD_HUMAN_SMOKING”, 0, true);
playing_emote = true;
end

Menu.hidden = true
end)
Menu.addButton(“Fumer”, “TriggerEvent”, emotes[“/smoke”].event)
exemple for smock emote in my menu

As yoan pointed out

Ty for help but i need to use this function

Citizen.CreateThread(function()
local pid = PlayerPedId()
RequestAnimDict(“friends”)
RequestAnimDict(“friends@frj”)
RequestAnimDict(“friends@frj@ig_1”)
while (not HasAnimDictLoaded(“friends@frj@ig_1”)) do Citizen.Wait(0) end
TaskPlayAnim(pid,“friends@frj@ig_1”,“wave_a”,1.0,-1.0, 5000, 0, 1, true, true, true)
end)

I have already the function for the “world_human_…” but i need to use amb@code_human_in_car_mp_actions@dance@bodhi@rds@base this for exemple

with world_human_… i’m limited with 10 - 15 animation while with http://docs.ragepluginhook.net/html/62951c37-a440-478c-b389-c471230ddfc5.htm#amb@world_human_cheering@male_eSection i can see more than 50 animations

thx for help