[FREE] Lobby style menu framework

Probably something like “lobbymenu:ButtonSelectionChanged(menuID, oldButtonID, newButtonID)”, but that’s not really something that I would make, because it requires a loop, and I would try to avoid that.

GG ez. lol

Look this:

RegisterCommand('lobbymenu:menuMoveUp', function()
    local last, current = GetPauseMenuSelection()
    print('UP',current)
end)

RegisterCommand('lobbymenu:menuMoveDown', function()
    local last, current = GetPauseMenuSelection()
    print('Down',current)
end)

RegisterKeyMapping('lobbymenu:menuMoveUp', 'Menü nach oben bewegen (Nicht ändern!)', 'keyboard', 'UP')
RegisterKeyMapping('lobbymenu:menuMoveDown', 'Menü nach runter bewegen (Nicht ändern!)', 'keyboard', 'DOWN')

Srry for the german description, but I think it abviously what it should do.
(and some code it missing, but this shows just the theorie behind it) :slight_smile:

Looks good, but it will not work for folks that use the mouse to select buttons.

Damn, I hate these people xD

1 Like

Is there a way to keep the index of the current selected button, when I update the menu? Or is there another way to change the description section without updating the menu?

Never mind, I fixed it by adding an extra event just to update the details scaleform

1 Like

So, for this type of things, I can make a loop in the same script and constantly “get” the info for the selected button, like this:

local _menuID = exports['critLobby']:LobbyMenuGetActiveMenu()
local buttonID, buttonText, buttonParams = exports['critLobby']:LobbyMenuGetSelectedButtonParam() -- first param is the buttonID, same as GetPauseMenuSelection(), second param is the text displayed on the button, third param is the buttonParam that you provided when creating the button, can be anything.

If you constantly check this in a loop, as long as your menu is active, you can, for example, modify the tooltip to show different things for each button.

1 Like

IMPORTANT!!! This method requires at least a Citizen.Wait(250), else the current value is the last button and not the real current one!

1 Like

@CritteR If you’re interrested, look what I created with your awesome script!

(Srry for the weird background music and the task bar, my friend recorded the video :sob:)

1 Like

Hi, have any of you managed to synchronize this menu with all players? My problem is that being all client-side, when a player enters the lobby, he doesn’t see the other players who entered the lobby previously.

Just send an event to every player and reload the menu if it’s opened :thinking:

@Kattrigerkatta how could I do? would you help me?

@Luis_DJ Create a net event that has the entire menu logic (creating the menu, adding buttons, etc), and trigger that event from the server, with all the needed data.

Check this release, for inspiration: GitHub - CritteRo/CritteR-s-Blood-Bowl: GTA San Andreas Blood Bowl minigame working in FiveM.

2 Likes

@CritteR How can I remove a player from the player list?

Does anyone in the community have a script for Team Deathmatch based on the “Lobby style menu framework”?

where can i get it?

Thank you so F*CKING much!
this is insane… <3

2 Likes

Download it from there

คนไทยยยยย♥