[PAID] [ESX/QB] Wanted System ⭐

:star2: Greetings FiveM Community!

:movie_camera: Preview Video
:point_right: Tebex

Introducing a dynamic Cops Count to Stars feature with a unique twist! Players automatically accrue crime stars for illicit activities, fading over time. When a player hits 5 stars, the LSPD receives an instant dispatch with their exact location. :rotating_light:

Customize dispatch frequency, fine-tune the system to your server dynamics, and automatically send persistent criminals to jail. :oncoming_police_car: The player’s wanted level resets upon incarceration.

Officers can use the Wanted List to see the citizens Wanted :firefighter:

Player wanted statuses are securely stored server-side and reactivate seamlessly when checking the combat log.

Customizing icons and adjusting positions is a straightforward process.

:zap: Config:

config = {}

config.framework = 'esx' -- Change this to your 'esx' or 'qbcore'

config.esxobject = function()
    ESX = exports['es_extended']:getSharedObject()
end

config.qbobject = function()
    QBCore = exports['qb-core']:GetCoreObject()
end

config.debugMode = true -- Set to true to enable clear stars and add star commands
config.addStarCommand = 'addWanted' -- Command to add a star
config.clearStarsCommand = 'clearWanted' -- Command to clear stars
config.removeStarCommand = 'removeWanted' -- Command to remove a star
config.listCommand = 'list' -- Command to remove a star

-- White listed jobs
config.jobs = {
    'police',
    'sheriff',
}

-- How many Police Officers are needed for each star
config.firststar = 1
config.secondstar = 2
config.thirdstar = 3
config.fourthstar = 4
config.fifthstar = 6

-- Custom function for jail/prison (if player hits more than 5 stars)
config.prisonFunction = function(playerId)
    -- return -- // if you dont want to use this function
    exports['rcore_prison']:Jail(playerId, 30, 'Du wurdest erwischt!')
end

-- Custom function for dispatch (if player hits 5 stars)
config.dispatchFunction = function()
    local playerData = exports['qs-dispatch']:GetPlayerInfo()
    TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
        job = { 'police', 'lssd' },
        callLocation = playerData.coords,
        callCode = { code = '10-05', snippet = 'Schwer Verbrecher' },
        message = "Schwer Verbrecher",
        flashes = false,
        image = false,
        blip = {
            sprite = 161,
            scale = 1.5,
            colour = 1,
            flashes = true,
            text = 'Schwer Verbrecher',
            time = (20 * 1000),
        }
    })
end

config.dispatchWaitTime = 180000 -- Add a cooldown for dispatch (in ms) till player has 5 stars

config.waitTime = 600000 -- Waiting time till stars get removed (in ms)

config.getstar = function()
    -- ESX.ShowNotification('You have received a star!')
end

config.nofifyclearstars = function()
    -- ESX.ShowNotification('You lost all your Wanted Stars!')
end

config.onlydebug = function()
    -- ESX.ShowNotification('This is only in Debugmode!')
end

config.nojob = function(source)
    --TriggerClientEvent('QBCore:Notify', source, 'You do not have the required job to use this command.', 'error')
    TriggerClientEvent('esx:showNotification', source, 'You do not have the required job to use this command.')
end

-- Example of usage: --

-- TriggerServerEvent('stars:addStar') in a client script to add a star
-- TriggerServerEvent('stars:resetAdditionalStars') in a client script to reset additional stars
-- TriggerEvent('stars:addStar', playerId) in a server script to add a star
-- TriggerEvent('stars:resetAdditionalStars', playerId) in a server script to reset additional stars
-- TriggerEvent('stars:removeStar', playerId) in a server script to remove a star
-- TriggerServerEvent('stars:removeStar', playerId) in a client script to remove a star

:point_right: Tebex

|-------------------------------------|----------------------------|
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | 600 |
| Requirements | ESX / QB |
| Support | Yes/No |

5 Likes

:loudspeaker: Update 1.0.1

  • Added Qbcore Support

  • Added Notify Config

config = {}

config.framework = 'qbcore' -- Change this to your 'esx' or 'qbcore'

config.debugMode = true -- Set to true to enable clear stars and add star commands
config.addStarCommand = 'addWanted' -- Command to add a star
config.clearStarsCommand = 'clearWanted' -- Command to clear stars

-- White listed jobs
config.jobs = {
    'police',
    'sheriff',
}

-- How many Police Officers are needed for each star
config.firststar = 1
config.secondstar = 2
config.thirdstar = 3
config.fourthstar = 4
config.fifthstar = 6

-- Custom function for jail/prison (if player hits more than 5 stars)
config.prisonFunction = function(playerId)
    -- return -- // if you dont want to use this function
    exports['rcore_prison']:Jail(playerId, 30, 'Your Wanted was to high for this Country!')
end

-- Custom function for dispatch (if player hits 5 stars)
config.dispatchFunction = function()
-- Add your Dispatch here
end

config.dispatchWaitTime = 180000 -- Add a cooldown for dispatch (in ms) till player has 5 stars

config.waitTime = 600000 -- Waiting time till stars get removed (in ms)

config.getstar = function()
    -- ESX.ShowNotification('You have received a star!')
end

config.nofifyclearstars = function()
    -- ESX.ShowNotification('You lost all your Wanted Stars!')
end

config.onlydebug = function()
    -- ESX.ShowNotification('This is only in Debugmode!')
end

2 Likes

lol i wanted to ask for a QB update thx <3

1 Like

:+1: :+1: :+1: :+1:

1 Like

Cool :+1:

1 Like

:loudspeaker: Update 1.0.2

  • Added Config Option for Framework (Customer request)
config.esxobject = function()
    ESX = exports['es_extended']:getSharedObject()
end

config.qbobject = function()
    QBCore = exports['qb-core']:GetCoreObject()
end

:loudspeaker: Update 1.0.3

  • Added Command to remove a star (Customer request)
config.removeStarCommand = 'removeWanted' -- Command to remove a star

-- TriggerEvent('stars:removeStar', playerId) in a server script to remove a star
-- TriggerServerEvent('stars:removeStar', playerId) in a client script to remove a star

:loudspeaker: New Version V2

:loudspeaker: New Version V3

β†’ Autowanted Settings
β†’ Seeing Criminals on Minimap / Map
β†’ More Settings to customize your Server

1 Like