Greetings FiveM Community!
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.
Customize dispatch frequency, fine-tune the system to your server dynamics, and automatically send persistent criminals to jail. The playerβs wanted level resets upon incarceration.
Officers can use the Wanted List to see the citizens Wanted
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.
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
|-------------------------------------|----------------------------|
| Code is accessible | No |
| Subscription-based | No |
| Lines (approximately) | 600 |
| Requirements | ESX / QB |
| Support | Yes/No |