Do not use these scripts if you are not comfortable with development. If you have some issues with code, ask the community on the official FiveM's topic.
- Copy and paste
target
folder toresources
- Add
start target
to yourserver.cfg
file - Copy and paste
menu
folder toresources
- Add
start menu
to yourserver.cfg
file
index.html
<ul class="menu menu-user">
<li>
<a class="cheer" href="">
<span class="emoji">👋</span>Cheer
</a>
</li>
<li>
<a class="[PUT FUNCTION RIGHT HERE]" href="">
<span class="emoji">👋</span>Saluer
</a>
</li>
(…)
</ul>
script.js
$('.cheer').on('click', function(e){
e.preventDefault();
$.post('http://menu/cheer', JSON.stringify({
id: idEnt
}));
});
client.lua
(and server.lua if needed)
RegisterNUICallback('cheer', function(data)
playerPed = GetPlayerPed(-1);
if(not IsPedInAnyVehicle(playerPed)) then
if playerPed then
if playing_emote == false then
TaskStartScenarioInPlace(playerPed, 'WORLD_HUMAN_CHEERING', 0, true);
playing_emote = true
end
end
end
end)
To understand the structure, check demos on source files
ui/index.html
file to add new menuui/script.js
file to add new functionui/front.js
JS for HTML interactionui/styles.scss
use this to edit CSS if you are comfortable with CSS pre-processor (must be compiled)
Nicolas Marx (alias Naiko) is the only owner of these scripts. You are free to use and edit the source code as you want for personal or commercial use.