Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.21 KB | None | 0 0
  1.  
  2. --[[
  3. Added ezJobs support
  4. Added checks so if bLogs fails to correctly it will no longer error
  5.  
  6. Configs added:
  7. Reset ranks on death
  8. ]]
  9. JobRanksConfig = JobRanksConfig or {}
  10.  
  11. //Who can access admin commands,menus etc
  12. JobRanksConfig.AdminAccessCustomCheck = function(Player) return Player:IsSuperAdmin() end
  13. //How often should it update and save?
  14. JobRanksConfig.UpdateTimer = 30
  15. //Players Required to be able to earns playtime through timer
  16. JobRanksConfig.PlayersRequired = 2
  17. //Should it give SALARY*Bonus instead of SALARY+Bonus?
  18. //NOTE: This calculates BaseSalary + (BaseSalary/100*Bonus)
  19. //So if you set BonusSalary to 15 it will be 15% of the original salary
  20. JobRanksConfig.BonusSalaryPercent = true
  21. //Disables progression if player is AFK
  22. JobRanksConfig.DisableAFKProgress = true
  23. //Set to true to allow higher ranks to promote those who are lower
  24. JobRanksConfig.HigherRankPromotion = true
  25. //Set to true to allow higher ranks to demote those who are lower
  26. JobRanksConfig.HigherRankDemotion = true
  27. //NOTE: These uses DarkRPs chatcommand system, which means it will always use / before the command so by default it would be -> /rpromote NICK REASON
  28. //Chatcommand to promote
  29. JobRanksConfig.PromotionChatCommands = {"rpromote"}
  30. //Chatcommand to demote
  31. JobRanksConfig.DemotionChatCommands = {"rdemote"}
  32. //Should ranks reset when you die?
  33. JobRanksConfig.ResetRanksOnDeath = true
  34.  
  35. //HUD Jobranks
  36. JobRanksConfig.HUD = true
  37. //Defined 0-100, 0 is as much left as it can and 100 is as much right as it can
  38. JobRanksConfig.UIW = 0.5
  39. //Defined 0-100, 0 is as much up as it can and 100 is as much down as it can
  40. JobRanksConfig.UIH = 0.5
  41. --[[
  42. bar = a bar for progress
  43. time = text for time left
  44. number = numbers only
  45. ]]
  46. JobRanksConfig.HUDType = "bar"
  47.  
  48. JobRanksConfig.UIBoxColor = Color(100,100,100,200)
  49. JobRanksConfig.UIOutlineColor = Color(200, 200, 200, 200)
  50. JobRanksConfig.UITextColor = Color(255,255,255,200)
  51. JobRanksConfig.BarBackground = Color(62,62,62,255)
  52. JobRanksConfig.Bar = Color(66,139,202,255)
  53.  
  54. JobRanks = JobRanks or {}
  55.  
  56. local function JBR_InitRanks()
  57. timer.Simple(3, function()
  58.  
  59. -- POLICIER
  60.  
  61. JobRanks[TEAM_POLICIER] = {} -- Each rank table REQUIRES this one to work, otherwise it will BREAK!
  62. JobRanks[TEAM_POLICIER].MaxJobRank = 8 -- Max rank achieveable
  63. JobRanks[TEAM_POLICIER].ReqRanks = { -- XP/Playtime required for each rank -> [RANKID] = AmountRequired,
  64. [1] = 0,
  65. [2] = 2250, --THE VALUE MUST BE HIGHER IN EACH RANK THAN THE PREVIOUS RANK
  66. [3] = 4500,
  67. [4] = 9000,
  68. [5] = 18000,
  69. [6] = 30000,
  70. [7] = 45000,
  71. [8] = 67500,
  72. }
  73. JobRanks[TEAM_POLICIER].NameRanks = { -- Names for each rank -> [RANKID] = "Name"
  74. [1] = "Cadet",
  75. [2] = "Sécurité publique",
  76. [3] = "Brigade des stup.",
  77. [4] = "CRS",
  78. [5] = "Police judiciaire",
  79. [6] = "Renseignement",
  80. [7] = "DRCPN",
  81. [8] = "Directeur générale",
  82. }
  83. JobRanks[TEAM_POLICIER].BonusSalary = 15 --Extra salary bonus for EACH rank -> 15*RANK -> At rank 2 $30 extra salary, rank 3 $45 extra salary and so on
  84. JobRanks[TEAM_POLICIER].ExtraLoadout = { --Bonus Equipments for rank X and higher, [RANKID] = WEAPONCLASS
  85. [2] = "m9k_m92beretta",
  86. [4] = "vc_spikestrip_wep", --Rank 4 or higher spawns with spikestrip
  87. [6] = "m9k_ump45", --Rank 6 or higher spawns with UMP45
  88. }
  89. JobRanks[TEAM_POLICIER].ExtraLoadoutSingleRank = { --Bonus Equipments for a SPECIFIC rank only, [RANKID] = WEAPONCLASS
  90. --[5] = "weapon_pumpshotgun2", --ONLY at rank 5 you spawn with shotgun
  91. --[7] = "weapon_mp52", --ONLY at rank 7 you spawn with MP5
  92. }
  93. JobRanks[TEAM_POLICIER].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
  94. --[RankID] = {Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}
  95. [1] = {Model = nil, Bodygroups = {{0,0}}, Skin = 4}, --Sets model, two custom bodygroups and skin to 1
  96. --Skipped rank 2, it will now set default model on rank 2
  97. [2] = {Model = nil, Bodygroups = nil, Skin = 0},
  98. [3] = {Model = nil, Bodygroups = nil, Skin = 8}, --Sets model, no bodygroups, sets skin to 3
  99. [4] = {Model = nil, Bodygroups = nil, Skin = 10},
  100. [5] = {Model = nil, Bodygroups = nil, Skin = 5},
  101. [6] = {Model = nil, Bodygroups = nil, Skin = 1},
  102. [7] = {Model = nil, Bodygroups = nil, Skin = 3},
  103. [8] = {Model = nil, Bodygroups = nil, Skin = 6}, --Sets default model, no bodygroups, sets skin to 2
  104. }
  105. JobRanks[TEAM_POLICIER].Prefix = { --It's set infront of the name for example Pvt.ToBadForYou, Sgt.ToBadForYou -> [RANKID] = "Prefix"
  106. [1] = "CAD",
  107. [2] = "SP",
  108. [3] = "BS",
  109. [4] = "CRS",
  110. [5] = "PJ",
  111. [6] = "RG",
  112. [7] = "DRCP",
  113. [8] = "DIR",
  114. }
  115. JobRanks[TEAM_POLICIER].Entities = { --Restrict specific entities to ranks -> [ENTCLASS] = RankRequired
  116. --["money_printer"] = 5, --Requires rank 5 in order to buy moneyprinter
  117. }
  118. JobRanks[TEAM_POLICIER].Shipments = { --Restrict specific shipments to ranks -> [SHIPMENT] = RankRequired
  119. --["weapon_pumpshotgun2"] = 5, --Requires rank 5 in order to buy shotgun shipment
  120. }
  121. JobRanks[TEAM_POLICIER].Warrant = 6 --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_POLICIER].Wanted = 6--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_POLICIER].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. [8] = Material("jobranks/police/rank8.png"),
  133. }
  134. JobRanks[TEAM_POLICIER].DisableProgression = false --Setting this to true will only allow progression through promotion manually by admin
  135. JobRanks[TEAM_POLICIER].BonusStats = { --Bonus stats for ranks -> [RankID] = {Health = AmountExtraHP, Armor = AmountExtraAP}
  136. [1] = {Health = 0, Armor = 0},
  137. [2] = {Health = 0, Armor = 0},
  138. [3] = {Health = 0, Armor = 20},
  139. [4] = {Health = 0, Armor = 20},
  140. [5] = {Health = 0, Armor = 50},
  141. [6] = {Health = 0, Armor = 50},
  142. [7] = {Health = 0, Armor = 80},
  143. [8] = {Health = 0, Armor = 100},
  144. }
  145.  
  146. -- CHEF DE LA POLICE
  147.  
  148. JobRanks[TEAM_COMMISSAIRE] = {}
  149. JobRanks[TEAM_COMMISSAIRE].MaxJobRank = 4
  150. JobRanks[TEAM_COMMISSAIRE].ReqRanks = {
  151. [1] = 0,
  152. [2] = 7500,
  153. [3] = 15000,
  154. [4] = 30000,
  155. }
  156. JobRanks[TEAM_COMMISSAIRE].NameRanks = {
  157. [1] = "Lieutenant",
  158. [2] = "Capitaine",
  159. [3] = "Commandant",
  160. [4] = "Commissaire",
  161. }
  162. JobRanks[TEAM_COMMISSAIRE].BonusSalary = 30
  163. JobRanks[TEAM_COMMISSAIRE].ExtraLoadout = {}
  164. JobRanks[TEAM_COMMISSAIRE].ExtraLoadoutSingleRank = {}
  165. JobRanks[TEAM_COMMISSAIRE].Model = {
  166. [1] = {Model = nil, Bodygroups = nil, Skin = nil},
  167. [2] = {Model = nil, Bodygroups = nil, Skin = nil},
  168. [3] = {Model = nil, Bodygroups = nil, Skin = nil},
  169. [4] = {Model = nil, Bodygroups = nil, Skin = nil},
  170. }
  171. JobRanks[TEAM_COMMISSAIRE].Prefix = {
  172. [1] = "LT",
  173. [2] = "CAP",
  174. [3] = "COM",
  175. [4] = "CS",
  176. }
  177. JobRanks[TEAM_COMMISSAIRE].Prefix = {}
  178. JobRanks[TEAM_COMMISSAIRE].ReqToJoin = { [TEAM_POLICIER] = 8 }
  179. JobRanks[TEAM_COMMISSAIRE].Entities = {}
  180. JobRanks[TEAM_COMMISSAIRE].Shipments = {}
  181. JobRanks[TEAM_COMMISSAIRE].Warrant = 1
  182. JobRanks[TEAM_COMMISSAIRE].Wanted = 1
  183. JobRanks[TEAM_COMMISSAIRE].Icons = {}
  184. JobRanks[TEAM_COMMISSAIRE].DisableProgression = false
  185. JobRanks[TEAM_COMMISSAIRE].BonusStats = {}
  186.  
  187. ----- RAID
  188.  
  189. JobRanks[TEAM_CHEFDURAID] = {}
  190. JobRanks[TEAM_CHEFDURAID].MaxJobRank = 4
  191. JobRanks[TEAM_CHEFDURAID].ReqRanks = {
  192. [1] = 0,
  193. [2] = 8000,
  194. [3] = 18000,
  195. [4] = 40000,
  196. }
  197. JobRanks[TEAM_CHEFDURAID].NameRanks = {
  198. [1] = "Chauffeur (R.A.I.D)",
  199. [2] = "Agent (R.A.I.D)",
  200. [3] = "Sniper (R.A.I.D)",
  201. [4] = "Lieutenant (R.A.I.D)",
  202. }
  203. JobRanks[TEAM_CHEFDURAID].ExtraLoadout = {
  204. [2] = "m9k_ump45",
  205. [3] = "m9k_intervention",
  206. }
  207. JobRanks[TEAM_CHEFDURAID].ExtraLoadoutSingleRank = {}
  208. JobRanks[TEAM_CHEFDURAID].Prefix = {
  209. [1] = "CHR",
  210. [2] = "AGR",
  211. [3] = "SNR",
  212. [4] = "LTR",
  213. }
  214. JobRanks[TEAM_CHEFDURAID].BonusSalary = 30
  215. JobRanks[TEAM_CHEFDURAID].Model = {}
  216. JobRanks[TEAM_CHEFDURAID].ReqToJoin = {
  217. [TEAM_POLICIER] = 8,
  218. }
  219. JobRanks[TEAM_CHEFDURAID].Entities = {}
  220. JobRanks[TEAM_CHEFDURAID].Shipments = {}
  221. JobRanks[TEAM_CHEFDURAID].Warrant = 2
  222. JobRanks[TEAM_CHEFDURAID].Wanted = 2
  223.  
  224. -- MAIRE
  225.  
  226. JobRanks[TEAM_MAIRE] = {}
  227. JobRanks[TEAM_MAIRE].MaxJobRank = 6
  228. JobRanks[TEAM_MAIRE].ReqRanks = {
  229. [1] = 0,
  230. [2] = 8000,
  231. [3] = 18000,
  232. [4] = 40000,
  233. [5] = 60000,
  234. [6] = 100000,
  235. }
  236. JobRanks[TEAM_MAIRE].NameRanks = {
  237. [1] = "Maire",
  238. [2] = "Sénateur",
  239. [3] = "Député",
  240. [4] = "Président du sénat",
  241. [5] = "Premier ministre",
  242. [6] = "Président",
  243. }
  244. JobRanks[TEAM_MAIRE].ExtraLoadout = {}
  245. JobRanks[TEAM_MAIRE].BonusSalary = 60
  246. JobRanks[TEAM_MAIRE].ExtraLoadout = {}
  247. JobRanks[TEAM_MAIRE].ExtraLoadoutSingleRank = {}
  248. JobRanks[TEAM_MAIRE].Model = {}
  249. JobRanks[TEAM_MAIRE].Prefix = {}
  250. JobRanks[TEAM_MAIRE].ReqToJoin = {}
  251. JobRanks[TEAM_MAIRE].Entities = {}
  252. JobRanks[TEAM_MAIRE].Shipments = {}
  253. JobRanks[TEAM_MAIRE].Warrant = 1
  254. JobRanks[TEAM_MAIRE].Wanted = 1
  255.  
  256. -- S.A.M.U
  257.  
  258. JobRanks[TEAM_DOCTEUR] = {}
  259. JobRanks[TEAM_DOCTEUR].MaxJobRank = 9
  260. JobRanks[TEAM_DOCTEUR].ReqRanks = {
  261. [1] = 0,
  262. [2] = 1500,
  263. [3] = 3000,
  264. [4] = 6000,
  265. [5] = 12000,
  266. [6] = 20000,
  267. [7] = 30000,
  268. [8] = 45000,
  269. [9] = 60000,
  270. }
  271. JobRanks[TEAM_DOCTEUR].NameRanks = {
  272. [1] = "Medic Trainee",
  273. [2] = "Medic",
  274. [3] = "Medical Scientist",
  275. [4] = "Junior Doctor",
  276. [5] = "Doctor",
  277. [6] = "Plastic Surgeon",
  278. [7] = "Brain Surgeon",
  279. [8] = "Chief Physician",
  280. [9] = "Hospital Manager",
  281. }
  282. JobRanks[TEAM_DOCTEUR].BonusSalary = 15
  283. JobRanks[TEAM_DOCTEUR].ExtraLoadout = {}
  284. JobRanks[TEAM_DOCTEUR].ExtraLoadoutSingleRank = {}
  285. JobRanks[TEAM_DOCTEUR].Model = {}
  286. JobRanks[TEAM_DOCTEUR].Prefix = {}
  287. JobRanks[TEAM_DOCTEUR].Entities = {}
  288. JobRanks[TEAM_DOCTEUR].Shipments = {}
  289. JobRanks[TEAM_DOCTEUR].Warrant = nil
  290. JobRanks[TEAM_DOCTEUR].Wanted = nil
  291.  
  292. end)
  293. end
  294.  
  295. if ezJobs then
  296. hook.Add("ezJobsLoaded", "JBR_InitRanks", JBR_InitRanks)
  297. else
  298. hook.Add("loadCustomDarkRPItems", "JBR_InitRanks", JBR_InitRanks)
  299. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement