STARTER PACK
Here check the installation guide
Last updated
Here check the installation guide
Last updated
INSTALLATION GUIDE
Download from KEYMASTER and Unzip the forge-starter.pack.zip
and place this folder in your server's resource folder.
Add the resource to your server start config: ensure forge-starter
,the name of the folder must not be changed or the resource will not function correctly.
Install the SQL that comes with the script.
Clear the cache of your server and also of your own FiveM.
Reboot the entire server with the forge script well ensured in your server.cfg.
Do not rename this script, this may cause it to fail when opening the interface.
CONFIG
The following will explain all the settings, one of the most important things that I recommend you spend a few minutes to understand in order to offer your users the best possible experience.
Fill all the CONFIG very carefully.
Config = { }
-- _____ _____ _ _ ______ _____ _____ _ _______ ___ _____ _____ _____ _ _
-- / __ \ _ | \ | || ___|_ _| __ \ | | | ___ \/ _ \_ _|_ _| _ | \ | |
-- | / \/ | | | \| || |_ | | | | \/ | | | |_/ / /_\ \| | | | | | | | \| |
-- | | | | | | . ` || _| | | | | __| | | | /| _ || | | | | | | . ` |
-- | \__/\ \_/ / |\ || | _| |_| |_\ \ |_| | |\ \| | | || | _| |_\ \_/ / |\ |
-- \____/\___/\_| \_/\_| \___/ \____/\___/\_| \_\_| |_/\_/ \___/ \___/\_| \_/
Config.Framework = 'esx' -- Choose between 'esx' or 'qbcore'
Config.SQLWrapper = 'oxmysql' -- Options: 'ghmattimysql', 'mysql-async', 'oxmysql'
Config.UseTarget = false -- If you set it to false, floating text will be displayed
Config.TargetSystem = 'qb-target' -- Choose between 'qb-target' or 'ox_target'
Config.UseStarterPack = true -- Set true to make the button appear in the UI and be usable
Config.UseVehicleStarter = true -- Set true to make the button appear in the UI and be usable
Config.UseGuideBook = true -- Set true to make the button appear in the UI and be usable
Config.UseGuidebookItem = false -- Set to true to enable guidebook as usable item
Config.GuidebookItem = "guidebook" -- Name of the item to use as guidebook
-- Starter Pack Options
Config.StarterPack = {
Items = {
{ Name = 'bread', Quantity = 4 },
{ Name = 'phone', Quantity = 1 }
},
Money = {
cash = 1000,
bank = 1000
}
}
-- Vehicle Starter Options
Config.VehicleStarter = {
VehicleInGarage = false, -- If false, it will be a street vehicle with keys. If true, the player owns the vehicle and it can be stored in the garage
VehicleModels = {
{ Model = "blista", Probability = 0.5 }, -- 50% chance (100% is 1.0)
{ Model = "club", Probability = 0.4 }, -- 40% chance (100% is 1.0)
{ Model = "zentorno", Probability = 0.1 } -- 10% chance (100% is 1.0)
}
}
Config.VehicleSpawn = vector3(-1040.4397, -2727.0789, 19.8712)
Config.VehicleSpawnHeading = 241.3119
-- Guide Book Settings
Config.GuideBook = {
AdminPermissions = { 'god', 'admin' }, -- Users who can access admin mode and add posts in-game
Categories = { -- The categories that will appear in the GuideBook and that admins will be able to select to create posts.
{ name = 'WELCOME' },
{ name = 'TUTORIAL' },
{ name = 'JOBS' }
}
}
Config.GuidebookAnimation = {
enabled = true, -- Use animation when reading the guidebook
dict = "missheistdockssetup1clipboard@base", -- which animation dictionary to use
anim = "base", -- animation name
prop = {
enabled = true, -- Use a prop when reading the guidebook
model = "prop_novel_01", -- prop model
bone = 18905, -- bone id
position = vector3(0.12, 0.008, 0.03), -- prop position
rotation = vector3(0.0, 0.0, 0.0) -- prop rotation
}
}
-- Location Settings
Config.Location = {
position = vector3(-1039.4341, -2731.4712, 20.1695), -- Coordinate to open the UI
interactionDistance = 2.0, -- Distance to interact with the NPC
markerSettings = {
enabled = true, -- Display a marker
type = 21, -- Marker type
colorR = 255, -- Red component of marker color
colorG = 255, -- Green component of marker color
colorB = 255, -- Blue component of marker color
alpha = 200, -- Marker transparency
useCustomHeight = true, -- Activate custom height
heightOffset = 1.0 -- Units to raise the marker
},
blipSettings = {
enabled = true, -- Display a blip on the map
id = 835, -- Blip ID
color = 5, -- Blip color
scale = 0.7, -- Blip scale
display = 2, -- Blip display type
name = 'Starter Help' -- Blip name
},
npcSettings = {
enabled = true, -- Enable or disable NPC presence
heading = 209.1426, -- NPC heading
model = 'a_m_y_business_03', -- NPC model
playAnimation = true, -- Enable or disable NPC animation
animationScenario = 'WORLD_HUMAN_CLIPBOARD' -- Scenario to play
}
}
-- UI Settings
Config.UI = {
colors = { -- Change the colours of the UI
color1 = '#ff0451',
color2 = '#7f0027',
color3 = '#a2353a'
},
translations = { -- Translates UI texts
starterp = 'STARTER PACK',
vehiclep = 'VEHICLE',
guidebookp = 'GUIDEBOOK',
starterp2 = 'STARTER PACK',
starterdesc = 'The <span>City Council</span> offers you, as an incentive to live in the city, a package of essentials to get you started in the city.',
claimitem = 'Claim',
starterveh = 'STARTER VEHICLE',
startervehdesc = 'The <span>Transport Consortium</span> will temporarily lend you a State vehicle to start moving around the city. Remember this vehicle is given to you by the state. Remembered in the voting!',
claimvehicle = 'Claim',
adminbtn = 'Admin Mode',
exitadmin = 'Exit Admin Mode',
addbtn = 'Add a new one',
guidebookt = 'GUIDEBOOK',
gpsmark = 'Gps Mark',
delete = 'Delete',
sure1 = 'Sure?',
yes1 = 'Yes',
no1 = 'No',
save1 = 'Save',
sure2 = 'Sure?',
saveconfirm = 'Yes',
no2 = 'No',
category1 = 'CATEGORY',
gpsmark2 = 'Gps Mark',
yes3 = 'Yes',
no3 = 'No',
content1 = 'Content',
alreadyClaimed = 'Already Claimed'
}
}
-- Translations for Various Messages
Config.Translations = {
openMenuText = 'Press ~INPUT_CONTEXT~ to open Starter menu',
openMenuTarget = 'Open the Starter menu',
itemMissing = 'You don\'t have the needed items',
alreadyClaimed = 'You have already claimed this. It can only be claimed once.',
receivedStarterPack = 'You have received your starter pack. Check your inventory!',
receivedStarterVehicle = 'You have received a car from the State.',
gpsMark = 'A route has been marked on your GPS'
}
-- Functions
Config.Functions = {
DrawText = function(text) -- Customize floating text UI
AddTextEntry('ALERT_MESSAGE', text)
BeginTextCommandDisplayHelp('ALERT_MESSAGE')
EndTextCommandDisplayHelp(0, false, false, -1)
end,
Notify = function(text) -- Notification system based on the framework
if Config.Framework == 'esx' then
ESX.ShowNotification(text)
elseif Config.Framework == 'qbcore' then
QBCore.Functions.Notify(text)
end
end,
-- Add function for vehicle keys for esx and qb
VehicleKeys = function(vehicle)
if Config.Framework == 'esx' then
-- Add ESX vehicle key handling here
elseif Config.Framework == 'qbcore' then
TriggerEvent('vehiclekeys:client:SetOwner', QBCore.Functions.GetPlate(vehicle))
end
end
}
function IsPlateTaken(plate)
local result
-- NOTE: Uncomment the required database check based on your framework
-- WARNING: Only uncomment ONE of these blocks
-- QBCore
--[[
result = SQL.Execute('SELECT plate FROM player_vehicles WHERE plate = ?', { plate })[1]
--]]
-- ESX
result = SQL.Execute('SELECT plate FROM owned_vehicles WHERE plate = ?', { plate })[1]
-- DO NOT COMMENT THIS LINE - Required for both frameworks:
return result
end
StoreVehicleInGarage = function(source)
local plate = GeneratePlate()
-- Vehicle model selection with probability system (DO NOT COMMENT THIS BLOCK)
local vehicleModel = Config.VehicleStarter.VehicleModels[1].Model
if #Config.VehicleStarter.VehicleModels > 1 then
local random = math.random()
table.sort(Config.VehicleStarter.VehicleModels, function(a, b) return a.Probability < b.Probability end)
for _, vehicle in pairs(Config.VehicleStarter.VehicleModels) do
if random < vehicle.Probability then
vehicleModel = vehicle.Model
break
end
end
end
-- NOTE: Keep only ONE implementation uncommented
-- WARNING: Remember to update your database schema accordingly
-- ESX Default (Default implementation - uncomment this block if using ESX Garage Default)
local esxPlayer = ESX.GetPlayerFromId(source)
if not esxPlayer then return end
SQL.Execute('INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)', {
esxPlayer.identifier,
plate,
json.encode({ model = joaat(vehicleModel), plate = plate })
})
-- QBCore Default (uncomment this block if using QBCore Garage Default)
--[[
local qbPlayer = QBCore.Functions.GetPlayer(source)
if not qbPlayer then return end
local vehicleHash = joaat(vehicleModel)
SQL.Execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
qbPlayer.PlayerData.license,
qbPlayer.PlayerData.citizenid,
vehicleModel,
vehicleHash,
json.encode({ model = vehicleHash, plate = plate }),
plate,
'pillboxgarage',
0
})
--]]
-- ESX with JG Advanced Garages (uncomment this block if using JG Advanced Garages with ESX)
--[[
local esxPlayer = ESX.GetPlayerFromId(source)
if not esxPlayer then return end
SQL.Execute('INSERT INTO owned_vehicles (owner, plate, vehicle, in_garage, garage_id) VALUES (?, ?, ?, ?, ?)', {
esxPlayer.identifier,
plate,
json.encode({ model = joaat(vehicleModel), plate = plate }),
1,
'Legion Square'
})
--]]
-- QBCore with JG Advanced Garages (uncomment this block if using JG Advanced Garages with QBCore)
--[[
local qbPlayer = QBCore.Functions.GetPlayer(source)
if not qbPlayer then return end
local citizenid = qbPlayer.PlayerData.citizenid
local license = QBCore.Functions.GetIdentifier(source, 'license')
if not license then return end
local vehicleHash = joaat(vehicleModel)
SQL.Execute('INSERT INTO player_vehicles (citizenid, license, vehicle, hash, plate, mods, in_garage, garage_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
citizenid,
license,
vehicleModel,
vehicleHash,
plate,
json.encode({ model = vehicleHash, plate = plate }),
1,
"Legion Square"
})
--]]
-- DO NOT COMMENT THIS LINE - Required for all implementations
TriggerClientEvent('forge-starter:spawnVehicle', source, plate)
end
CREATE TABLE `starter_claims` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`identifier` LONGTEXT NOT NULL COLLATE 'utf8mb3_general_ci',
`item` INT(11) NOT NULL DEFAULT '0',
`vehicle` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb3_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `starter_posts` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`category` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
`data` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
`text` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb3_general_ci'
ENGINE=InnoDB
ALTER TABLE `users` ADD `starter_item` INT(11) NOT NULL DEFAULT '0' AFTER `group`;
ALTER TABLE `users` ADD `starter_vehicle` INT(11) NOT NULL DEFAULT '0' AFTER `starter_item`;
CREATE TABLE `starter_posts` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`category` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
`data` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
`text` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb3_general_ci'
ENGINE=InnoDB
;
If you want to edit the aesthetics or design. You have the HTML open so you can modify the style and everything as you want.
The script is RESPONSIVE for all resolutions as well.