Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PJDelivery = PJDelivery or {}
- PJDelivery.Languages = {}
- PJDelivery.Config = {}
- PJDelivery.Config.Derma = {}
- PJDelivery.Config.Language = "en" -- Available languages: fr, en, es, pl, ru, de, dk (default: en)
- PJDelivery.Config.ForAllEnts = true --[[ Is the delivery system needs to be applied on all entities ? true -> yes; false -> no; (default: true)
- If false then you need to add: delivery = true, in your darkrp config entities.
- For exemple:
- DarkRP.createEntity("The best entity ever", {
- ...
- delivery = true, -- THIS LINE needs to be add to be delivered (PJDelivery.Config.WhiteList on true) or not (PJDelivery.Config.WhiteList on false)
- ...
- })
- ]]
- PJDelivery.Config.WhiteList = true -- If not ForAllEnts, add "delivery = true" will be for whitelisted items, or blacklist them. true for whitelist, false for blacklist (default: true)
- PJDelivery.Config.AdminRanks = { -- Which ranks can access to the dropbox tool ?
- "superadmin",
- }
- // Models
- PJDelivery.Config.DropBoxModel = "models/props_street/mail_dropbox.mdl" -- Model for the drop box, if you want to use a custom one (default: "models/props_street/mail_dropbox.mdl")
- PJDelivery.Config.PackageModel = "models/props_junk/cardboard_box001a.mdl" -- Model for the package box (default: "models/props_junk/cardboard_box001a.mdl")
- PJDelivery.Config.TruckRetriverModel = "models/odessa.mdl" -- Model for the delivery truck retriever (default: "models/odessa.mdl")
- PJDelivery.Config.StorageCenterModel = "models/alyx.mdl" -- Model of the storage center, need to be a pnj one (default: "models/alyx.mdl")
- PJDelivery.Config.MarketModel = "models/alyx.mdl" -- Default model of the market PNJ (default: "models/alyx.mdl")
- PJDelivery.Config.MarketModels = { -- All available market models
- -- DEFAULTS:
- "models/alyx.mdl",
- "models/barney.mdl",
- "models/breen.mdl",
- "models/p2_chell.mdl",
- "models/eli.mdl",
- "models/gman_high.mdl",
- "models/kleiner.mdl",
- "models/monk.mdl",
- "models/mossman.mdl",
- "models/mossman_arctic.mdl",
- "models/odessa.mdl",
- "models/magnusson.mdl",
- "models/police.mdl",
- "models/police_fem.mdl",
- "models/combine_soldier.mdl",
- "models/combine_super_soldier.mdl",
- "models/combine_soldier_prisonguard.mdl",
- "models/soldier_stripped.mdl",
- "models/corpse1.mdl",
- "models/charple.mdl",
- "models/skeleton.mdl",
- "models/zombie_classic.mdl",
- "models/zombie_fast.mdl",
- "models/zombie_soldier.mdl",
- "models/Group01/female_01.mdl",
- "models/Group01/female_02.mdl",
- "models/Group01/female_03.mdl",
- "models/Group01/female_04.mdl",
- "models/Group01/female_05.mdl",
- "models/Group01/female_06.mdl",
- "models/Group03/female_01.mdl",
- "models/Group03/female_02.mdl",
- "models/Group03/female_03.mdl",
- "models/Group03/female_04.mdl",
- "models/Group03/female_05.mdl",
- "models/Group03/female_06.mdl",
- "models/Group03m/female_01.mdl",
- "models/Group03m/female_02.mdl",
- "models/Group03m/female_03.mdl",
- "models/Group03m/female_04.mdl",
- "models/Group03m/female_05.mdl",
- "models/Group03m/female_06.mdl",
- "models/Group01/male_01.mdl",
- "models/Group01/male_02.mdl",
- "models/Group01/male_03.mdl",
- "models/Group01/male_04.mdl",
- "models/Group01/male_05.mdl",
- "models/Group01/male_06.mdl",
- "models/Group01/male_07.mdl",
- "models/Group01/male_08.mdl",
- "models/Group01/male_09.mdl",
- "models/Group02/male_02.mdl",
- "models/Group02/male_04.mdl",
- "models/Group02/male_06.mdl",
- "models/Group02/male_08.mdl",
- "models/Group03/male_01.mdl",
- "models/Group03/male_02.mdl",
- "models/Group03/male_03.mdl",
- "models/Group03/male_04.mdl",
- "models/Group03/male_05.mdl",
- "models/Group03/male_06.mdl",
- "models/Group03/male_07.mdl",
- "models/Group03/male_08.mdl",
- "models/Group03/male_09.mdl",
- "models/Group03m/male_01.mdl",
- "models/Group03m/male_02.mdl",
- "models/Group03m/male_03.mdl",
- "models/Group03m/male_04.mdl",
- "models/Group03m/male_05.mdl",
- "models/Group03m/male_06.mdl",
- "models/Group03m/male_07.mdl",
- "models/Group03m/male_08.mdl",
- "models/Group03m/male_09.mdl",
- "models/hostage/hostage_01.mdl",
- "models/hostage/hostage_02.mdl",
- "models/hostage/hostage_03.mdl",
- "models/hostage/hostage_04.mdl",
- "models/arctic.mdl",
- "models/gasmask.mdl",
- "models/guerilla.mdl",
- "models/leet.mdl",
- "models/phoenix.mdl",
- "models/riot.mdl",
- "models/swat.mdl",
- "models/urban.mdl",
- "models/dod_american.mdl",
- "models/dod_german.mdl",
- -- CUSTOMS
- -- "mdl_path/mdl_name.mdl",
- }
- PJDelivery.Config.CanBeSameName = false -- Can be two drop box with the same name ? (default: false)
- PJDelivery.Config.HelpText = 3 /*
- Postion of the HUD:
- 1: top left
- 2: top right
- 3: middle
- 4: bottom left
- 5: bottom right
- */
- PJDelivery.Config.HelpTextsShow = { // Show help text, true to show, false to hide
- ["DepositCarTrunk"] = true,
- ["OpenCarTrunk"] = true,
- ["PickupPackage"] = true,
- ["DropboxPut"] = true,
- ["DropboxGet"] = true,
- }
- // Delivery & packages
- PJDelivery.Config.PayByBank = true -- Can the player pay by his bank account if he doesn't have enough money ? (default: true)
- PJDelivery.Config.PackagePickUpKey = {key = KEY_R, text = "Reload"} -- Key and text to pickup a package, this is also used for car storage
- PJDelivery.Config.TimeToDeliver = 0.15 -- Time for the post man for one meter, for exemple: if set to 1 then 13 meters take 13 seconds to be reached (default: 0.15)
- PJDelivery.Config.MeterPrice = 0.1 -- How much cost one meter for the delivery distance (default: 0.1)
- PJDelivery.Config.DeliveryPrice = false -- How much cost the delivery for a set price, false to let the price be variable (set by the MeterPrice) (default: false)
- PJDelivery.Config.PostmanFixed = false -- Do the postman will get a set reward ? false for the variable reward, true for set reward (default: false)
- PJDelivery.Config.AtHome = false -- Force the player to choose his home dropbox ? true for yes, false for no (default: false)
- PJDelivery.Config.MaxPackages = 5 -- Maximum active packages that a player could have (default: 5)
- PJDelivery.Config.SpawnPackage = "!package" -- Chat comment to spawn a new package, set it to false to disable it (default: "!package")
- PJDelivery.Config.PackageRemoveTime = 5 -- How many seconds for a package to be removed once it's empty ? (default: 300)
- // Market
- PJDelivery.Config.Market = true -- Enable or disable the market system (default: true)
- PJDelivery.Config.MarketOpen = KEY_F5 -- Key to open the market, if yout want a command you can set "!my_marke_command" (default: KEY_F5)
- PJDelivery.Config.MarketPNJ = true -- Use market PNJ ? Can be placed with a tool (default: true)
- PJDelivery.Config.MarketPNJCategory = true -- Need to specify a category for a market PNJ ? Configurable with the tool (default: true)
- PJDelivery.Config.MarketAutoOpen = true -- Automaticaly open the market when the player try to by an ent ? (default: true)
- PJDelivery.Config.MarketMaxItems = 50 -- How many items * quantity can be delivered in one package ? (default: 50)
- PJDelivery.Config.MarketName = "PJ's Market" -- Market name shown on the market frame
- PJDelivery.Config.MarketTypes = { -- Items types (not the category name !) for the market, edit only the true or false
- ["Entities"] = true,
- ["Shipments"] = true,
- ["Weapons"] = true,
- ["Ammo"] = true,
- ["Food"] = true, // If hungermod is enabled
- ["Vehicles"] = false,
- }
- PJDelivery.Config.MarketAllCategories = true // Include all categories by default ? If not, you can edit below (default: true)
- PJDelivery.Config.MarketDefaultCategories = {
- ["entities"] = { // Edit only the tables, not the ["Entities"], ["Shipments"], etc...
- ["Other"] = true,
- },
- ["shipments"] = {
- ["Snipers"] = true,
- ["Rifles"] = false,
- ["Shotguns"] = true,
- ["Other"] = true,
- },
- ["weapons"] = {
- ["Pistols"] = true
- },
- ["ammo"] = {
- ["Other"] = true,
- },
- ["vehicles"] = {
- },
- }
- // Items
- PJDelivery.Config.AutoItemsWeight = true -- Automaticly assigned weight for items (default: true)
- PJDelivery.Config.ItemWeight = { -- If PJDelivery.Config.AutoItemsWeight is to false, then this table will be used
- ["darkrp_tip_jar"] = 5,-- ["ITEM ENT CLASS"] = weight,
- }
- PJDelivery.Config.DefaultItemWeight = 1 -- Default item weight (default: 1)
- // Postman
- PJDelivery.Config.Job = "Postman" -- Post man job's name, false if you don't want it (default: "Postman") -- NOTE: you need to create the job ! -- Not supporting lua refresh !
- PJDelivery.Config.JobAutoCreate = true -- Auto create the postman job ? Editable lower in the file -- "true" for yes, "false" for no (default: true)
- PJDelivery.Config.BecomePostmanByStorageCenter = false -- Do a derma open when a player press use on the storage center pnj ? (default: true)
- PJDelivery.Config.AcceptTime = 60 -- How many time a postman have to accept the delivery order ? (default: 60) -- In seconds
- PJDelivery.Config.MaxLateTime = 3 * 60 -- How many minutes before cancel the delivery (after the delivery time end) (default: 3 * 60) -- TIPS: add *60 to make in minutes
- PJDelivery.Config.PenalityCost = 1 -- How much cost the penality for one second late (default: 1) -- In seconds -- Exemple: 1 minute late is: (the reward price) - 60$
- PJDelivery.Config.AcceptShowTime = 5 -- How many time the request frame stay after accepted the delivery order ? (default: 5) -- In seconds
- PJDelivery.Config.MaxJobs = 5 -- How many delivery orders can have a postman at the same time (default: 5)
- PJDelivery.Config.WantedNoDelivery = true -- Is the player wanted if he doesn't delivered the order, and don't have enough money to pay the order's value ? (default: true)
- PJDelivery.Config.DeliveryVehicles = { -- ["Veh_class"] = {Veh_Skin_1, Veh_Skin_2, etc...}, || Veh_class can be found by right clicking in your vehicles list and copy to clipboard, Veh_skin is by default 0
- ["courier_trucktdm"] = {1}
- }
- // Auto postman job
- PJDelivery.Config.AutoJobs = {min = 20, max = 60} -- An auto job appear when the postman doesn't had a job for x seconds (default: min = 20, max = 20) -- In seconds -- false to disable -- min, max is for a random between these two values
- PJDelivery.Config.AutoItems = { -- Wich items can be auto delivered ? It's needed because we don't want a player to steal a $1.000.000 item, false to make all
- ["Entities"] = {
- ["atm_reader"] = true,-- ["ITEM ENT CLASS"] = true, -- The item class can be found at the ent line of the darkrp ent: 'ent = "darkrp_tip_jar",'
- },
- ["Shipments"] = {
- ["cw_makarov"] = false,
- },
- ["Weapons"] = {
- },
- ["Ammo"] = {
- },
- ["Food"] = {
- },
- ["Vehicles"] = { -- The darkrp vehicle, mostly unused by people
- },
- }
- // Car Trunk
- PJDelivery.Config.CarStorageDefault = 10 -- How many packages in one car by default (default: 10)
- PJDelivery.Config.CarStorage = { -- This is used to define amount of package for specific car, you can get the car class by right clicking on the car in the spawn menu
- ["courier_trucktdm"] = 10, -- ["CAR CLASS"] = AMOUNT OF PACKAGE,
- } -- courier_trucktdm is the default car class for the delivery truck
- PJDelivery.Config.AlwaysShowEntsName = false -- Do the postman can see the entities name during the delivery on the different frames ? (default: false)
- PJDelivery.Config.CarTrunkRestriction = false -- Restrict car trunk to postmans ? (default: false)
- PJDelivery.Config.Derma.FrameTop = Color(38, 38, 38)
- PJDelivery.Config.Derma.FrameBack = Color(23, 23, 23, 200)
- PJDelivery.Config.Derma.Button = Color(48, 48, 48)
- PJDelivery.Config.Derma.ButtonHover = Color(23, 23, 23)
- PJDelivery.Config.Derma.RedButton = Color(231, 76, 60)
- PJDelivery.Config.Derma.RedButtonBack = Color(192, 57, 43)
- if PJDelivery.Config.JobAutoCreate then // Postman job config
- hook.Add("DarkRPFinishedLoading", "PJDelivery:AutoCreateJob", function()
- TEAM_POSTMAN = DarkRP.createJob(PJDelivery.Config.Job, { // Start config here
- color = Color(89, 89, 89, 255),
- model = {"models/Barney.mdl"},
- description = [[Delivery some packages to other players and get rewards !]],
- weapons = {},
- command = "postman",
- max = 0,
- salary = GM.Config.normalsalary,
- admin = 0,
- vote = false,
- hasLicense = false, // End here, don't forget to make sure you have some commas at the end of each lines
- })
- end)
- end
- -- DON'T TOUCH BELOW THIS !!!
- -- DON'T TOUCH BELOW THIS !!!
- -- DON'T TOUCH BELOW THIS !!!
- -- DON'T TOUCH BELOW THIS !!!
- -- DON'T TOUCH BELOW THIS !!!
- if SERVER then resource.AddWorkshop("1873947237") end
- IncludeCS("pjdelivery/languages/en.lua")
- IncludeCS("pjdelivery/languages/"..PJDelivery.Config.Language..".lua")
- function PJDelivery.GetPhrase(name)
- return PJDelivery.Languages[PJDelivery.Config.Language] != nil and PJDelivery.Languages[PJDelivery.Config.Language][name] or PJDelivery.Languages["en"][name]
- end
- function PJDelivery.FormatDistance(pos1, pos2)
- return math.Round(pos1:Distance(pos2) / 10)
- end
- function PJDelivery.GetDeliveryCenter()
- local r = ents.FindByClass("pj_pnj_storage_center")
- return (!r or table.IsEmpty(r)) and false or r
- end
- function PJDelivery.RandomVariable(length)
- //math.randomseed(FrameTime())
- local r = ""
- for i = 1, length do
- r = r .. string.char(math.random(97, 122))
- end
- return r
- end
- function PJDelivery.GetPostMan()
- local r = {}
- for k,v in pairs(player.GetAll()) do
- if PJDelivery.Config.Job != team.GetName(v:Team()) then continue end
- table.insert(r, v)
- end
- return r
- end
- local meta = FindMetaTable("Player")
- function meta:GetCloserCenter()
- local centers = PJDelivery.GetDeliveryCenter()
- if !centers then return false end
- local min = -1
- local ent = nil
- for k,v in pairs(centers) do
- local dist = PJDelivery.FormatDistance(v:GetPos(), self:GetPos())
- if dist < min or min == -1 then ent = v min = dist end
- end
- return ent, min
- end
- hook.Add("loadCustomDarkRPItems", "PJDelivery:ListAutoItems", function()
- if !PJDelivery.Config.AutoJobs then return end
- PJDelivery.AutoItemsList = {}
- for k,v in pairs(DarkRPEntities) do
- if PJDelivery.Config.AutoItems.Entities[v.ent] or !PJDelivery.Config.AutoItems then local ins = table.Copy(v) ins.Type = "entity" PJDelivery.AutoItemsList[k] = ins end
- end
- for k,v in pairs(CustomShipments) do
- if PJDelivery.Config.AutoItems.Shipments[v.entity] or !PJDelivery.Config.AutoItems then local ins = table.Copy(v) if ins.separate then ins.Type = "pistol" else ins.Type = "shipment" end PJDelivery.AutoItemsList[k] = ins end
- end
- for k,v in pairs(GAMEMODE.AmmoTypes) do
- if PJDelivery.Config.AutoItems.Ammo[v.ent] or !PJDelivery.Config.AutoItems then local ins = table.Copy(v) ins.Type = "ammo" PJDelivery.AutoItemsList[k] = ins end
- end
- if !DarkRP.disabledDefaults["modules"]["hungermod"] then
- for k,v in pairs(FoodItems) do
- if PJDelivery.Config.AutoItems.Food[v.ent] or !PJDelivery.Config.AutoItems then local ins = table.Copy(v) ins.Type = "Food" PJDelivery.AutoItemsList[k] = ins end
- end
- end
- for k,v in pairs(CustomVehicles) do
- if PJDelivery.Config.AutoItems.Vehicles[v.ent] or !PJDelivery.Config.AutoItems then local ins = table.Copy(v) ins.Type = "vehicle" PJDelivery.AutoItemsList[k] = ins end
- end
- end)
- PJDelivery.Version = "1.1.5" -- Just for support
- if BATM then
- function PJDelivery.BATM_Accounts()
- return CBLib.LoadModule("batm/bm_accounts.lua", false)
- end
- end
- if SERVER then
- AddCSLuaFile("pjdelivery/cl_utils.lua")
- AddCSLuaFile("pjdelivery/cl_init.lua")
- AddCSLuaFile("pjdelivery/cl_hud.lua")
- AddCSLuaFile("pjdelivery/cl_panels.lua")
- include("pjdelivery/sv_init.lua")
- include("pjdelivery/sv_delivery.lua")
- include("pjdelivery/sv_hooks.lua")
- include("pjdelivery/sv_nets.lua")
- elseif CLIENT then
- include("pjdelivery/cl_utils.lua")
- include("pjdelivery/cl_init.lua")
- include("pjdelivery/cl_hud.lua")
- include("pjdelivery/cl_panels.lua")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement