PoliceLoadoutMenu script[FiveM]

PoliceLoadoutMenu script[FiveM]

$4.95

Add to Basket

Watch the Showcase video here

https://youtu.be/e8qtLwzNB3M

🔹 Is the Script Standalone?  ✅ Yes, for FiveM – It does not rely on other frameworks like ESX or QBCore.  ❌ No, because it requires NativeUI – Servers must have NativeUI for the menu to work.


policeLoadoutmenu Script for FiveM

Author: PS Scripts FiveM


Overview

The PoliceLoadout script is a fully configurable FiveM resource that allows police officers to spawn custom weapon loadouts at designated checkpoint locations. The script integrates directly with Discord's HTTP API (using your own Bot Token and Guild ID) to verify if a player has the required Discord role before granting a loadout.


Features

Discord Integration:


Connects directly to Discord's HTTP API using your Bot Token and Guild ID.

Checks if a player’s linked Discord account has the required role for specific loadouts.

Configurable Loadouts:


Define multiple loadouts in config.lua.

Each loadout can list any number of weapons with configurable ammo.

Optionally require a specific Discord Role ID to access a loadout.

Custom Checkpoint Markers:


Uses a configurable in-game marker (default: marker type 27, "MarkerTypeHorizontalSplitArrowCircle").

Fully configurable marker parameters including scale, color, and position offset.

Adjustable vertical offset so the marker appears slightly above ground.

Map Blips:


Automatically creates a map blip at each checkpoint location.

Blip settings (ID, scale, color, name) are fully configurable.

Key Mapping:


The key used to open the loadout menu is fully configurable via the Config.OpenKey value.

In-game Notifications:


Displays a green pop-up notification when a loadout spawns successfully.

Displays a red notification if the player does not have the required Discord role.


Installation

Place the following files in your resource folder (for example, named "PoliceLoadoutmenu"):


fxmanifest.lua:

Ensure in server.cfg policeLoadoutmenu


Dependencies:


Make sure you have NativeUI installed and started on your server.

The script requires FiveM with the Lua 5.4 runtime enabled.

Discord Setup:


Edit config.lua and replace the Discord Bot Token and Guild ID with your actual values.

Set the required Discord Role IDs for each loadout as needed.

Start the Resource:



Discord Settings:

Update Bot_Token and Guild_ID.


Police Locations:

Add or edit checkpoint coordinates in the Config.PoliceLocations table.


Loadouts:

Define loadout names, required Discord Role IDs (or nil if not required), and weapon lists in Config.Loadouts.


Marker Settings:

Adjust the marker type, scales, colors, and vertical offsets in Config.Marker.

(Example: The marker is drawn using DrawMarker(27, loc.x, loc.y, loc.z + posOffset, ...))


Interaction Settings:

Set Config.CheckpointDrawDistance and Config.InteractDistance for when markers are drawn and when players can interact.


Key Mapping:

Change Config.OpenKey (default is 38 for the "E" key) to remap the key used to open the loadout menu.


Map Blip Settings:

Adjust the blip ID, scale, color, and name in Config.Blip.


Usage

When a player approaches one of the defined police checkpoint locations, a marker (and map blip) will appear.

If the player is within interaction distance, they will see a prompt to press the configured key (default "E") to open the loadout menu.

When a loadout is selected:

If the loadout requires a Discord role, the script checks via Discord’s HTTP API if the player has that role.

If the check passes, the loadout’s weapons are granted and a success notification is displayed.

If the check fails, an error notification is displayed.