[RELEASE] Addon Vehicle Spawn Menu | With Template

Information

  • Upon my journey into FiveM development / learning lua ive created a menu to spawn in addon cars / any cars. Make sure you have nativeUI installed! You can change the open menu button by gong to FiveM Game Reference Docs make sure its a valid INDEX. read the README.MD file! has everything you need to know in depth.

Requirements

Download

How To Change Index

  • Index open menu key change ,
    IsControlJustPressed(1, 10) to if
    IsControlJustPressed(1, CustomIndex).

Images

10 Likes

Good job. Looks great. Reminds me of this one a bit.

oh, i didnt even know that was a thing

Its ok. Good job on the code either way.

im pretty sure this is already a thing

This Script is already a thing he just made a better version of it

Good job, but this already exists eitherway cheers for the release hun

damn people the dude knows it already a thing relax

great effort bro wont be using it as I think those kind of menus suck for realistic servers but that’s just me …. but like I said good effort

thanks buddy, appreciate it

I won’t be using this, never the less I checked it out and your code seems very Nice, congrats on making this, there You go, take a like.

cheers

1 Like

So the second item won’ show up for me. I tried to copy and paste some stuff or find any reason why it wouldn’t work. Maybe you can tell me how I can get the Second and maybe a third Menu Item to work.

any errors in console and can u show an image of what you mean?

So just to make sure i didn’t do anything wrong with me adding cars I reinstalled the resource. So its just plain downloaded from here and put in the folder, when pressing PageUp in game it opens the menu and only shows the first Item (in that case of your example is only TRUCKS) It never shows the second item. So your “SUVS” Item never shows.

This screenshot is right after installing the resource without changing anything in the files provided. Even though the code shows that there should be a second Menu option there is not.

Ok so where it says

FirstItem(mainMenu)
_menuPool:RefreshIndex()
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        _menuPool:ProcessMenus()
        --[[ The "e" button will activate the menu ]]
        if IsControlJustPressed(1, 10) then
            mainMenu:Visible(not mainMenu:Visible())
        end
    end
end)

on line 75 you need to call the function of the suv’s which would be

FirstItem(mainMenu)
SecondItem(mainMenu)
_menuPool:RefreshIndex()
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        _menuPool:ProcessMenus()
        --[[ The "e" button will activate the menu ]]
        if IsControlJustPressed(1, 10) then
            mainMenu:Visible(not mainMenu:Visible())
        end
    end
end)

This should fix this problem

1 Like

Yeah thanks, thats fixed it. And I checked the readme again… it even says in there :smiley:

Is it possible to add submenus or will you make the option to ?

Like :
Main Menu = Car/Bike/Truck
SubMenuCar = Audi/BMW/Cadillac
And in those submenus then the cars to spawn

1 Like

yes its very possible

Hey how do i make the menu delete the old car when a person spawns a new one?

hi there what is the defult button to open the menu

1 Like