[Release] Captain's Context menu

About
A Raytrace & Entity based context menu for GTA V FiveM.
Perform actions based off the Entity you are interacting with in the world. Such as Vehicles, ATMs, Phone booths, Trashcans, Doors, Cash registers and all other Entities that the game offers.

The Raycast is shot from the players position to the Cursors position in 3D space which means it doesn’t matter which way the ped if facing to interact with any object.

NOTE: This is a context menu Shell meaning features such as the Police menu are just an Empty menu buttons that do nothing but they are setup in such a way that you can easily add calls to them such as Exports to actual Police related scripts. It’s there as an Example on how you can add your own actions to it. It is a system to be build on and have it work how YOU want it to.

Installation / Guide / How to
Everything needed to know on how to use the menu is in the readme on Github.
Read the “How to Modify” section on the Github readme page also.

Github: https://github.com/captaindarkness/Captains-ContextMenu-FiveM

Video and Screenshots

Direct path to the video Here




Credit

  • Simu, for code related to Screen to world coords.
  • Taso, Frontend assistance with bugs (CSS/JS)
  • VenomXNL, for Object name from Hash -> https://github.com/VenomXNL/ObjectNameFromHash
    (The version of HashToName is a Modified version of VenomXNL’s repo to allow for Exports instead of prints)
29 Likes

It looks really good. Great job :fire:

2 Likes

Thanks :slight_smile: Its my first ever proper FiveM mod.

2 Likes

I think are u lying.

This project finally came out! I’m so happy for you!

1 Like

Great release :slight_smile:

1 Like

Nice work

2 Likes

I also made it to, I like this way of interacting with objects, vehicles, players etc.
I just haven’t released my version yet and will come later with a new framework.
Definitely a nice release, nice to see this kind of projects in FiveM.

My version: https://streamable.com/om0ouj

Video 2: https://streamable.com/ff2xbh

3 Likes

Give me the sign for that lock, so much smoother than a “Locked” / “Unlocked” text x’D

Both nice mods, i’m looking into either building or using a mod like this in the future maybe, but will take time to adjust all commands, functions, systems, etc to it so i’m not in a hurry.

Big thumbs up tho

Locked:

🔒

Unlocked:

🔓
1 Like

Dope idea.

1 Like

really powerfull toy… love it

1 Like

Make it functional for esx please.

Make it functional for esx please.

I sadly don’t know anything about the Framework ESX so it is likely not going to happen sorry : /

Any chance to have this menu like a normal menu open in the middle of the screen with for example F3? I love the design, just amazing…

1 Like

Possible yeah. In the Index.js file you have:

window.addEventListener("contextmenu",function(event){
        event.preventDefault();
        $.post('https://contextmenu/rightclick', JSON.stringify({}));
        contextElement.style.top = event.offsetY + "px";
        contextElement.style.left = event.offsetX + "px";
    });

So instead of the event.offsetY and event.offsetX you just get the Screen height and width divided by 2 which would be the center of the screen.

As far as having it be something like F3 is also possible but the core functionallity is that the RayCast is from your mouse so would have to change it and have it come from either the character or camera.
The reason why its from your mouse is moving your character or camera around to have it hit proper can sometimes be annoying. So Right click adds a bit of freedom.

Thank you so much, I’ll try to do it and if you want I can share in this topic :blush:

1 Like

I love this this so much… I finally can turn on and off the god forsaken radio in my small arse garage operation…

local RadioState = true
function MenuRadio()
    if RadioState then
        SetStaticEmitterEnabled('SE_MP_GARAGE_S_RADIO', false) 
        RadioState = false
        TriggerEvent("burn:chatmsg", "blue", "MENU", "Radio is off")
    else
        SetStaticEmitterEnabled('SE_MP_GARAGE_S_RADIO', true) 
        SetEmitterRadioStation("SE_MP_GARAGE_S_RADIO","RADIO_19_USER")
        RadioState = true
        TriggerEvent("burn:chatmsg", "blue", "MENU", "Radio is on")
    end
end

Making extra sub menu’s would be my next step… [Radio] Sub dir… add SKIP or CHANGE CHANNEL

1 Like

That looks great dude! Glad you like it! I’m assuming you just added the hash of the radio entity in the use CallBack and toggle the boolean of the state there.

Making extra sub menu’s would be my next step… [Radio] Sub dir… add SKIP or CHANGE CHANNEL

I tried to make the process of adding your own submenu as easy as my skills would let me. Let me know how it turns out :+1:

Exactly yeah, that pretty much it… adding hashes to the use callback…
its changing every day but as of right now… im sending the entity.hash to a local function…


The Menu open by pushing the thumbs button on the mouse for quick use in action…
before fixing the export option (i had to add a path, because the entity-data file was not creating itself) i was using your menu examine to identify hashes… something that i had a hard time to do before your tool-script!

Now i use the export! Much better! So far i only use entities.hash, modelName, type and ESX Jobname to filter everything

1 Like