SHARE
TWEET

Untitled

a guest Feb 14th, 2020 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. --[[
  3. Should now grant new loadout upon promotions
  4.  
  5. Configs changes:
  6. Prefix Separator added
  7. ]]
  8. JobRanksConfig = JobRanksConfig or {}
  9.  
  10. //Who can access admin commands,menus etc
  11. JobRanksConfig.AdminAccessCustomCheck = function(Player) return Player:IsSuperAdmin() end
  12. //How often should it update and save?
  13. JobRanksConfig.UpdateTimer = 30
  14. //Players Required to be able to earns playtime through timer
  15. JobRanksConfig.PlayersRequired = 0
  16. //Should it give SALARY*Bonus instead of SALARY+Bonus?
  17. //NOTE: This calculates BaseSalary + (BaseSalary/100*Bonus)
  18. //So if you set BonusSalary to 15 it will be 15% of the original salary
  19. JobRanksConfig.BonusSalaryPercent = false
  20. //Disables progression if player is AFK
  21. JobRanksConfig.DisableAFKProgress = true
  22. //NOTE: These uses DarkRPs chatcommand system, which means it will always use / before the command so by default it would be -> /rpromote NICK REASON
  23. //Chatcommand to promote
  24. JobRanksConfig.PromotionChatCommands = {"promote"}
  25. //Chatcommand to demote
  26. JobRanksConfig.DemotionChatCommands = {"demote"}
  27. //Should ranks reset when you die?
  28. JobRanksConfig.ResetRanksOnDeath = false
  29.  
  30. //HUD Jobranks
  31. JobRanksConfig.HUD = true
  32. //Defined 0-100, 0 is as much left as it can and 100 is as much right as it can
  33. JobRanksConfig.UIW = 100
  34. //Defined 0-100, 0 is as much up as it can and 100 is as much down as it can
  35. JobRanksConfig.UIH = 0
  36. --[[
  37. bar = a bar for progress
  38. time = text for time left
  39. number = numbers only
  40. ]]
  41. JobRanksConfig.HUDType = "number"
  42.  
  43. JobRanksConfig.UIBoxColor = Color(100,100,100,200)
  44. JobRanksConfig.UIOutlineColor = Color(200, 200, 200, 200)
  45. JobRanksConfig.UITextColor = Color(255,255,255,200)
  46. JobRanksConfig.BarBackground = Color(0,0,0,255)
  47. JobRanksConfig.Bar = Color(0,200,0,255)
  48.  
  49. JobRanks = JobRanks or {}
  50.  
  51. local function JBR_InitRanks()
  52. timer.Simple(3, function()
  53. JobRanks[TEAM_POLICE] = {} --Each rank table REQUIRES this one to work, otherwise it will BREAK!
  54. JobRanks[TEAM_POLICE].MaxJobRank = 7 --Max rank achieveable
  55. JobRanks[TEAM_POLICE].ReqRanks = {-- XP/Playtime required for each rank -> [RANKID] = AmountRequired,
  56. [1] = 0,
  57. [2] = 1, --THE VALUE MUST BE HIGHER IN EACH RANK THAN THE PREVIOUS RANK
  58. [3] = 2,
  59. [4] = 3,
  60. [5] = 4,
  61. [6] = 5,
  62. [7] = 6,
  63. }
  64. JobRanks[TEAM_POLICE].NameRanks = { -- Names for each rank -> [RANKID] = "Name"
  65. [1] = "Cadet",
  66. [2] = "Gardien de la Paix",
  67. [3] = "Brigadier",
  68. [4] = "Major",
  69. [5] = "Capitaine",
  70. [6] = "Commandant",
  71. [7] = "Commissaire",
  72. }
  73. JobRanks[TEAM_POLICE].BonusSalary = 0 --Extra salary bonus for EACH rank -> 15*RANK -> At rank 2 $30 extra salary, rank 3 $45 extra salary and so on
  74. JobRanks[TEAM_POLICE].ExtraLoadout = {
  75. [2] = {"fas2_glock20"},
  76. [3] = {"fas2_glock20", "fas2_mp5k"},
  77. [4] = {"fas2_glock20", "fas2_mp5k", "fas2_m3s90"}
  78. }--Bonus Equipments for rank X and higher, [RANKID] = WEAPONCLASS
  79. JobRanks[TEAM_POLICE].ExtraLoadoutSingleRank = {}--Bonus Equipments for a SPECIFIC rank only, [RANKID] = {WEAPONCLASS}
  80. JobRanks[TEAM_POLICE].Model = { --Setup different models for each rank, leave it empty to keep default, if you want specific ranks to use default models dont add it in this table
  81. --[[
  82. If you just want one model, this structure is fine, otherwise to avoid confusion you should use the one below the first
  83. [RankID] = {{Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}}
  84. [RankID] = {
  85.             {Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID},
  86.             {Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}, <- this comma is super important, should be one between each one
  87.             {Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}
  88.         }
  89. ]]
  90. [1] = {
  91.             {Model = "models/fear/player/portal/male_1.mdl", Bodygroups = nil, Skin = 1},
  92.             {Model = "models/fear/player/portal/male_2.mdl", Bodygroups = nil, Skin = 1},
  93.             {Model = "models/fear/player/portal/male_3.mdl", Bodygroups = nil, Skin = 1},
  94.             {Model = "models/fear/player/portal/male_4.mdl", Bodygroups = nil, Skin = 1},
  95.             {Model = "models/fear/player/portal/male_5.mdl", Bodygroups = nil, Skin = 1},
  96.             {Model = "models/fear/player/portal/male_6.mdl", Bodygroups = nil, Skin = 1}
  97.         },
  98. --Skipped rank, it will now set default model
  99. [7] = {
  100.             {Model = "models/portal2/patrol_02.mdl", Bodygroups = nil, Skin = 1},
  101.             {Model = "models/portal2/patrol_04.mdl", Bodygroups = nil, Skin = 1},
  102.             {Model = "models/portal2/patrol_05.mdl", Bodygroups = nil, Skin = 1},
  103.             {Model = "models/portal2/patrol_06.mdl", Bodygroups = nil, Skin = 1},
  104.             {Model = "models/portal2/patrol_07.mdl", Bodygroups = nil, Skin = 1},
  105.             {Model = "models/portal2/patrol_08.mdl", Bodygroups = nil, Skin = 1},
  106.             {Model = "models/portal2/patrol_09.mdl", Bodygroups = nil, Skin = 1}
  107.         }
  108. }
  109. JobRanks[TEAM_POLICE].PrefixSeparator = " " -- What separates the prefix from the name, for example if set to a space it would be Pvt ToBadForYou, if set to a . then Pvt.ToBadForYou etc
  110. JobRanks[TEAM_POLICE].Prefix = { --It's set infront of the name for example Pvt.ToBadForYou, Sgt.ToBadForYou -> [RANKID] = "Prefix"
  111. [1] = "Cdt",
  112. [2] = "Gdlp",
  113. [3] = "Bg",
  114. [4] = "Mjr",
  115. [5] = "Cpt",
  116. [6] = "Cmd",
  117. [7] = "Com",
  118. }
  119. JobRanks[TEAM_POLICE].Entities = {} --Restrict specific entities to ranks -> [ENTCLASS] = RankRequired
  120. JobRanks[TEAM_POLICE].Shipments = {} --Restrict specific shipments to ranks -> [SHIPMENT] = RankRequired
  121. JobRanks[TEAM_POLICE].Warrant = 0 --Allows warranting for rank it set to and higher, so Rank 5 and higher can warrant: SET TO NIL TO DISABLE WARRANT FOR ALL RANKS
  122. JobRanks[TEAM_POLICE].Wanted = 0--Allows wanted for rank it set to and higher, so Rank 5 and higher can wanted: SET TO NIL TO DISABLE WANTED FOR ALL RANKS
  123. //THESE ARE JUST TEMPLATES, download icons online and insert their path here (Also upload it on workshop or to your FastDL and add it to force download)
  124. JobRanks[TEAM_POLICE].Icons = { --Setup Rank icons -> [RANKID] = Material("PATH TO PNG")
  125. [1] = Material("jobranks/police/rank1.png"),
  126. [2] = Material("jobranks/police/rank2.png"),
  127. [3] = Material("jobranks/police/rank3.png"),
  128. [4] = Material("jobranks/police/rank4.png"),
  129. [5] = Material("jobranks/police/rank5.png"),
  130. [6] = Material("jobranks/police/rank6.png"),
  131. [7] = Material("jobranks/police/rank7.png"),
  132. }
  133. JobRanks[TEAM_POLICE].BonusStats = {} --Bonus stats for ranks -> [RankID] = {Health = AmountExtraHP, Armor = AmountExtraAP}
  134. JobRanks[TEAM_POLICE].DisableProgression = true --Setting this to true will only allow progression through promotion manually by admin
  135. --[[
  136. Promote = true/false -> Can this rank promote?
  137. MaxPromotion = Number -> Max rank this rank can promote to
  138. Demote = true/false -> Can this rank demote?
  139. MaxDemotion = Number -> Max rank this rank can demote to
  140.  
  141. Leaving MaxPromotion empty will allow to set to highest rank
  142. Leaving MaxDemotion empty will allow to set to lowest rank
  143.  
  144. NOTE: Only add ranks that you want to grant permissions to, if the rank isn't in this config it can't promote or demote
  145. ]]
  146. JobRanks[TEAM_POLICE].Permissions =
  147. {
  148. [6] = {Promote = true, Demote = true, MaxPromotion = 5}, -- Can Promote to rank 5 and demote to rank 3
  149. [7] = {Promote = true, Demote = true}, -- Can promote to highest rank and demote to lowest
  150. }
  151.  
  152. JobRanks[TEAM_POMPIER] = {}
  153. JobRanks[TEAM_POMPIER].MaxJobRank = 12
  154. JobRanks[TEAM_POMPIER].ReqRanks = {
  155. [1] = 0,
  156. [2] = 1,
  157. [3] = 2,
  158. [4] = 3,
  159. [5] = 4,
  160. [6] = 5,
  161. [7] = 6,
  162. [8] = 7,
  163. [9] = 8,
  164. [10] = 9,
  165. [11] = 10,
  166. [12] = 11,
  167. }
  168. JobRanks[TEAM_POMPIER].NameRanks = {
  169. [1] = "Sapeur",
  170. [2] = "Caporal",
  171. [3] = "Caporal-Chef",
  172. [4] = "Sergent",
  173. [5] = "Sergent-Chef",
  174. [6] = "Adjudant",
  175. [7] = "Adjudant-Chef",
  176. [8] = "Lieutenant",
  177. [9] = "Capitaine",
  178. [10] = "Commandant",
  179. [11] = "Lieutenant Colonel",
  180. [12] = "Colonel",
  181. }
  182. JobRanks[TEAM_POMPIER].BonusSalary = 0
  183. JobRanks[TEAM_POMPIER].ExtraLoadout = {}
  184. JobRanks[TEAM_POMPIER].ExtraLoadoutSingleRank = {}
  185. JobRanks[TEAM_POMPIER].Model = {}
  186. JobRanks[TEAM_POMPIER].PrefixSeparator = " "
  187. JobRanks[TEAM_POMPIER].Prefix = { --It's set infront of the name for example Pvt.ToBadForYou, Sgt.ToBadForYou -> [RANKID] = "Prefix"
  188. [1] = "Sap",
  189. [2] = "Cpl",
  190. [3] = "Cch",
  191. [4] = "Sgt",
  192. [5] = "Sch",
  193. [6] = "Adj",
  194. [7] = "Adc",
  195. [8] = "Ltn",
  196. [9] = "Cne",
  197. [10] = "Cdt",
  198. [11] = "Lcl",
  199. [12] = "Col",
  200. }
  201. JobRanks[TEAM_POMPIER].Entities = {}
  202. JobRanks[TEAM_POMPIER].Shipments = {}
  203. JobRanks[TEAM_POMPIER].Warrant = nil
  204. JobRanks[TEAM_POMPIER].Wanted = nil
  205. JobRanks[TEAM_POMPIER].Permissions = {}
  206. JobRanks[TEAM_POMPIER].DisableProgression = true --Setting this to true will only allow progression through promotion manually by admin
  207. JobRanks[TEAM_POMPIER].Permissions =
  208. {
  209. [10] = {Promote = true, Demote = true, MaxPromotion = 9},
  210. [11] = {Promote = true, Demote = true, MaxPromotion = 10},
  211. [12] = {Promote = true, Demote = true}, -- Can promote to highest rank and demote to lowest
  212. }
  213.  
  214. end)
  215. end
  216.  
  217. if ezJobs then
  218.     hook.Add("ezJobsLoaded", "JBR_InitRanks", JBR_InitRanks)
  219. else
  220.     hook.Add("loadCustomDarkRPItems", "JBR_InitRanks", JBR_InitRanks)
  221. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top