Getting Started
On this page: How to install, configure & edit script
Requirements
To install that script, you need to have:
- Framework: ESX 1.2, ESX Legacy or QBCore
- Database: MySQL Async or oxmysql
Installation
- Download script here or clone it from GitHub repo
git clone https://github.com/KPGTB/KFines.git
If you downloaded the script from the button above, you need to extract it from archive
Move script into resources folder
Rename script to
KFines(optional, but recommended)Go to
KFines/fxmanifest.luaand configure your framework and databaseESX 1.2
local framework = 'esx'
local mysql = "mysql-async"ESX Legacy
local framework = 'esx'
local mysql = "oxmysql"QB Core
local framework = 'qb'
local mysql = "oxmysql"
info
After making changes in KFines/fxmanifest.lua you need to refresh your scripts by using command /refresh. After that, you can restart script
- Go to
KFines/shared/config.luaand configure script like you want
Config = {}
Config.Locale = 'en'
Config.TimeToPay = 3 * 24 * 60 * 60 * 1000 -- Milliseconds
Config.NotPaidModifier = 1.25
Config.AllowFakePlayers = false -- Allow cops to create ticket for player that doesn't exist in database (support for Fake ID)
Config.ShowDistance = 20 -- Distance for ticket. At least 1 player (excluding cop) needs to be in that distance to create ticket.
Config.TimeZone = "+02:00" -- It will convert default UTC into your timezone (required by MySQL)
Config.WebhookURL = "" -- Discord webhook with logs
Config.Jobs = {
lspd = { -- Unique name of category
name = "Los Santos Police Department", -- Name displayed in ticket
location = "City of Los Santos", -- City name in ticket
logo = "lspd.png", -- Logo from /web/assets folder
society = "society_police", -- Society account to give money from tickets
allowedJobs = {{ -- table of allowed jobs
job = "police", -- job name
grade = "boss" -- job grade
},{
job = "offpolice",
grade = "boss"
}},
npcs = {{ -- table of npcs where player can pay for ticket from this category
pos = vector3(440.6174, -978.9453, 30.68958),
heading = 180.0,
ped = "s_m_y_cop_01",
distance = 3, -- distance to show message
}}
},
bcso = {
name = "Blaine County Sheriff's Office",
location = "Blaine County",
logo = "bcso.png",
society = "society_sheriff",
allowedJobs = {{
job = "sheriff",
grade = "boss",
},{
job = "offsheriff",
grade = "boss"
}},
npcs = {{
pos = vector3(1852.4,3688.6,34.26),
heading = 210.0,
ped = "s_m_y_sheriff_01",
distance = 3,
}}
}
}
- If you want, you can translate your script into your language. (optional)
- Go to
KFines/localesfolder - Make copy of
en.luaand rename it to your language code - Open renamed file
- Change variable
fileLocaleto your language code - Translate messages
- Go to
KFines/config.luaand changeConfig.Localeto your language code
- Go to
- Register item
traffic_tickets_blockin your framework- ESX - In database, in table
items - QBCore - In file
qb-core/shared/items.lua
- ESX - In database, in table
- Start the server (or script after using
/refreshcommand)
Editing script
The script is fully open source, and it's under Apache 2.0 license. You can edit it like you want. To edit UI, please look at Fivem + ReactJS Tempalte that is used in this script.
danger
I won't fix issues that happened after editing the script!