βοΈInstallation
Put the plt_lumberjack & plt_lumberjack-streams files in your resource file. Add them to your server.cfg.
Check the config.lua. and configure to script settings how you want.
If you are using ESX or QB-Core frameworks; you don't have to make any changes. it is ready to work. Otherwise check #Framework money & job functions
The script has no requirements. ui and notifications itself. if you want you can use other notification system. check #Notifications system
If you want to do something when vehicle spawns, like giving a key to the player, changing the fuel of the vehicle or something #Arrangement about spawned vehicles
You should set the outfit values according to your own server #Clothing System. The clothes changing system can work standalone. If you want, you can use the qb-clothing or esx_skin system.
Framework money & job functions
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
if ESX then
function PltAddMoney(src,money)
...
end
else
QBCore = exports['qb-core']:GetCoreObject()
function PltAddMoney(src,money)
...
end
end
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(PlayerData)
JobUpdate(PlayerData.job.name,PlayerData.job.grade)
end)
RegisterNetEvent('esx:setJob')
AddEventHandler('esx:setJob', function(job)
JobUpdate(job.name,job.grade)
end)
RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
local QBCore = exports['qb-core']:GetCoreObject()
while QBCore.Functions.GetPlayerData().job == nil do Citizen.Wait(1000) end
local PlayerData = QBCore.Functions.GetPlayerData()
JobUpdate(PlayerData.job.name,PlayerData.job.grade.level)
end)
RegisterNetEvent('QBCore:Client:OnJobUpdate')
AddEventHandler('QBCore:Client:OnJobUpdate', function(JobInfo)
JobUpdate(JobInfo.name,JobInfo.grade.level)
end)
Clothing System
---- Adjust the 'PLT.Clothing' table following according to the job clothes on your server.
PLT.Clothing={
male ={
--[[ Arms ]] ['arms'] = 67,
--[[ Tshirt ]] ['tshirt_1'] = 85, ['tshirt_2'] = 0,
--[[ Torso Parts ]] ['torso_1'] = 177, ['torso_2'] = 11,
..
},
female={..}
}
function ChangeOutfit()
ChangeOutfitStandalone()-- if you want to use the esx_skin or qb-clothing system; Deactivate the this function then Activate the following which you want.
--ChangeOutfitEsx() -- if you want to use the esx_skin system; Deactivate the ChangeOutfitStandalone() function then Activate the this function.
--ChangeOutfitQB() -- if you want to use the qb-clothing system; Deactivate the ChangeOutfitStandalone() function then Activate the this function.
TriggerEvent("plt_lumberjack:ClotheChangeAnim")
end
Notifications system
function Notification(type, message, time)
SendNUIMessage({statu="single", type = type, text = message, duration = time})
--exports['mythic_ notify']:DoCustomHudText(type, message, time)
--exports['okokNotify']:Alert("Lumberjack", message, time, type)
--TriggerEvent('okokNotify:Alert', "Lumberjack", message, time, type)
--TriggerEvent('QBCore:Notify', message, type, time)
end
Arrangement about spawned vehicles
function SpawnedVehicle(vehicle, needGiveKey, vehicleModelName)
if needGiveKey then
TriggerEvent("vehiclekeys:client:SetOwner", string.gsub(GetVehicleNumberPlateText(vehicle), '^%s*(.-)%s*$', '%1'))
TriggerServerEvent('garage:addKeys', GetVehicleNumberPlateText(vehicle))
TriggerServerEvent("plateEveryone",GetVehicleNumberPlateText(vehicle))
if vehicleModelName == PLT.Vehicles.forklift or vehicleModelName == PLT.Vehicles.telehandler then
SetVehicleFuelLevel(vehicle, 99.9) DecorSetFloat(vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(vehicle))
else -- here for trucks
SetVehicleFuelLevel(vehicle, 99.9) DecorSetFloat(vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(vehicle))
end
--next line vehicle max car mod
--SetVehicleMod(vehicle, 11, (GetNumVehicleMods(vehicle, tonumber(modType)) - 1), false) SetVehicleMod(vehicle, 12, (GetNumVehicleMods(vehicle, tonumber(modType)) - 1), false) SetVehicleMod(vehicle, 13, (GetNumVehicleMods(vehicle, tonumber(modType)) - 1), false) SetVehicleMod(vehicle, 15, (GetNumVehicleMods(vehicle, tonumber(modType)) - 1), false) SetVehicleMod(vehicle, 16, (GetNumVehicleMods(vehicle, tonumber(modType)) - 1), false) ToggleVehicleMod(vehicle, 18, true)
end
end
Add new tree
Add new construction
Last updated