Configuration
This configuration file allows you to customize various aspects of the Trucker Job script. Below is a detailed explanation of each setting and how to use them.
General Settings
JJ = {}
JJ.Language = "en" -- Set the default locale here
- Language: Defines the language for the script. Modify it as needed.
NPC Configuration
JJ.NPC = {
model = "s_m_m_trucker_01",
coords = vector4(1198.9395, -3109.6438, 6.0280, 358.9099)
}
- model: Defines the NPC model that gives out trucker jobs.
- coords: Sets the spawn location of the NPC.
Key System
JJ.UseKeys = false
JJ.GiveKeys = function (source, plate)
if JJ.UseKeys then
--exports.mVehicle:ItemCarKeysClient("add", plate)
end
end
JJ.RemoveKeys = function (plate)
if JJ.UseKeys then
--exports.mVehicle:ItemCarKeysClient("delete", plate)
end
end
- UseKeys: If set to
true
, vehicles will require keys. - GiveKeys: Function to give keys to the player.
- RemoveKeys: Function to remove keys from the player.
Notification System
JJ.Notify = function(title, msg, type)
--exports['JJ-Notify']:Alert(title, msg, 2500, type)
exports['okokNotify']:Alert(title, msg, 2500, type, true)
end
- Notify: Defines the notification system. The default is
okokNotify
, but you can replace it with another.
Fuel Management
JJ.SetFuel = function (vehicleId, fuelAmount)
Entity(vehicleId).state.fuel = fuelAmount
end
- SetFuel: Function to set the fuel level of a vehicle.
Truck Spawn & Return Position
JJ.TruckSpawnCoords = vector4(1204.4467, -3095.0828, 5.7965, 280.2215)
JJ.GiveBackTruck = vector4(1204.4467, -3095.0828, 5.7965, 280.2215)
- TruckSpawnCoords: The location where trucks spawn.
- GiveBackTruck: The location where trucks should be returned.
Job Settings
JJ.RequestJob = false
JJ.JobName = "trucker"
- RequestJob: If
true
, only players with the specified job can start a trucker mission. - JobName: Specifies the required job name.
Available Jobs
JJ.Jobs = {
{
label = "Delivery of goods to supermarket",
truck = "phantom",
trailer = "trailers",
destinations = {
vector3(179.5100, -1476.9514, 29.1433),
},
minpay = 2000,
maxpay = 2500,
damagevehiclemin = 100,
damagevehiclemax = 110
},
{
label = "Hazardous material to chemical factory",
truck = "packer",
trailer = "tanker",
destinations = {
vector3(374.832, -3110.525, 5.815),
vector3(-1184.249, -1714.324, 3.473)
},
minpay = 3000,
maxpay = 3500,
damagevehiclemin = 103,
damagevehiclemax = 130
},
{
label = "Express delivery of electronics",
truck = "hauler",
trailer = "trailers2",
destinations = {
vector3(679.582, -2103.421, 28.441),
vector3(-320.123, -1094.532, 23.212)
},
minpay = 3500,
maxpay = 4000,
damagevehiclemin = 105,
damagevehiclemax = 140
}
}
- label: The job name.
- truck: The truck model used for the job.
- trailer: The type of trailer attached to the truck.
- destinations: List of vector coordinates where deliveries must be made.
- minpay / maxpay: Payment range for completing the job.
- damagevehiclemin / damagevehiclemax: Damage thresholds that affect the final payout.
Webhook Configuration
The following settings are used for Discord logging in server_config.lua
.
JJ = {}
JJ.WebhookComplete = "YOUR_WEBHOOK_HERE"
JJ.WebhookTrailerDelivered = "YOUR_WEBHOOK_HERE"
JJ.WebhookCancel = "YOUR_WEBHOOK_HERE"
- WebhookComplete: Logs when a delivery is successfully completed.
- WebhookTrailerDelivered: Logs when a trailer is delivered.
- WebhookCancel: Logs when a job is canceled.
Note: Replace YOUR_WEBHOOK_HERE
with your actual Discord webhook URL.