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.
Delete the ESX and QB-Core function before, add the following function to give money in your own framework.
server/server.lua
functionPltAddMoney(src,money)-- add "money" amount of money to the player whose id is "src", for example;-- local xPlayer = ESX.GetPlayerFromId(src)-- xPlayer.addMoney(money)end
Job information should be updated when the player loaded and player's profession is updated, as in the example following
from any where
--following is when will trigger from CLIENT side.TriggerEvent('plt_lumberjack:JobUpdate',jobName,jobGrade)--following is when will trigger from Server side.TriggerServerEvent('plt_lumberjack:JobUpdate',source,jobName,jobGrade)
I added the event that will be triggered, you don't need to do anything about it.
---- 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={..}}functionChangeOutfit() 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
client/other.lua
functionNotification(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
client/other.lua
functionpermenantNotification(msg,thisFrame,beep,duration) permenantNotificationText = msg --[[ AddTextEntry('pltLumberjackNotify', msg) if thisFrame then DisplayHelpTextThisFrame('pltLumberjackNotify', false) else if beep == nil then beep = true end BeginTextCommandDisplayHelp('pltLumberjackNotify') EndTextCommandDisplayHelp(0, false, beep, duration or -1) end ]]end
Arrangement about spawned vehicles
client/other.lua
functionSpawnedVehicle(vehicle,needGiveKey,vehicleModelName)if needGiveKey thenTriggerEvent("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 thenSetVehicleFuelLevel(vehicle, 99.9) DecorSetFloat(vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(vehicle))else-- here for trucksSetVehicleFuelLevel(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)
endend