Problème avec JobRankSystem

  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Bonjour bonjour,

D'habitude, je n'ai pas de soucis avec les configurations, mais là, je suis tombé sur un script bien compliqué, ou alors c'est juste moi qui comprend rien.
Le script étant : https://www.gmodstore.com/market/view/2631 pour informations, même dans les reviews, certains acheteurs ont eux même confirmé que le script était dure à configurer, je me tourne vers vous, car même avec ce que l'auteur à fournis dans sa description, je n'arrive pas à le configurer aucune vidéo, rien comme explications en détails.

Voilà le fichier configuration de base :

Code:
--[[
Added a function to config to copy existing jobrank tables for other jobs:
JBR_CopyRankTable(JobToCopy, Job)
JobToCopy - This is the jobs ranktable it will copy and use
Job - The job that should use the ranktable
Example: JBR_CopyRankTable(TEAM_CHIEF, TEAM_POLICE)
This would give TEAM_POLICE the same ranks as TEAM_CHIEF
However this only COPY the table, the progression is still unique for each job
NOTE: THIS FUNCTION HAS TO BE CALLED AT THE END OF THE CONFIG
Added command to convert all data from SQLite to MySQL (This overwrites MySQL data, use player command if you wish to convert a specific player)
Restart server once this command has been used as it doesn't update current players
"jobranks_convertsql_all"
Config changes:
]]
JobRanksConfig = JobRanksConfig or {}
JobRanksConfig.MYSQLOO = false
JobRanksConfig.AdminAccessCustomCheck = function(Player) if Player:IsAdmin() or Player:IsSuperAdmin() then return true else return false end
end
JobRanksConfig.UpdateTimer = 30
JobRanksConfig.PlayersRequired = 0
JobRanksConfig.BonusSalaryPercent = false
JobRanksConfig.DisableAFKProgress = true
JobRanksConfig.PromotionChatCommands = {"rpromote"}
JobRanksConfig.DemotionChatCommands = {"rdemote"}
JobRanksConfig.ResetRanksOnDeath = false
JobRanksConfig.HUD = true
JobRanksConfig.UIW = 100
JobRanksConfig.UIH = 0
--[[
bar = a bar for progress
time = text for time left
number = numbers only
]]
JobRanksConfig.HUDType = "number"
--[[
1 = Displays: Job
2 = Displays: Jobrank
3 = Displays: Job (JobRank)
]]
JobRanksConfig.ShowJobType = 3
JobRanksConfig.UIBoxColor = Color(100,100,100,200)
JobRanksConfig.UIOutlineColor = Color(200, 200, 200, 200)
JobRanksConfig.UITextColor = Color(255,255,255,200)
JobRanksConfig.BarBackground = Color(0,0,0,255)
JobRanksConfig.Bar = Color(0,200,0,255)
JobRanks = JobRanks or {}
JobRanksConfig.JobJoinRestrictments = JobRanksConfig.JobJoinRestrictments or {}
JobRanksConfig.JobPermissionList = JobRanksConfig.JobPermissionList or {}
local function JBR_InitRanks()
timer.Simple(3, function()
--[[
JBR_SetupRestrictedJob(Job, RequiredJobs)
Job - The job to be restricted
RequiredJobs - Table of the ranks you must reach in that specific job {[Job] = RequiredRank, [Job2] = RequiredRank} etc
]]
JBR_SetupRestrictedJob(TEAM_CHIEF, {[TEAM_POLICE] = 8})
--[[
JBR_SetupJobPermissionList(Job, AllowedJobs)
Job - Job that is allowed to promote/demote
AllowedJobs - The jobs the job is allowed to promote/demote {[Job] = true, [Job2] = true} etc
]]
JBR_SetupJobPermissionList(TEAM_POLICE, {[TEAM_POLICE] = true})
--[[
JBR_SetupRankTable(Job, MaxRank, BonusSalary, PrefixSeparator, Warrant, Wanted, DisableProgression)
Job - Variable for job for example TEAM_POLICE
MaxRank - Maximum rank achieveable
BonusSalary - Bonus salary for each rank, so Amount*Rank, if bonus is set to 15 and you are rank 3 you would recieve 45$ extra
PrefixSeparator - What should be between Prefix and Name, for example . would be Pvt.ToBadForYou or _ would be Pvt_ToBadForYou
Warrant - Rank required to warrant, set to nil to disable
Wanted - Rank required to Wanted, set to nil to disable
DisableProgression - true or false, true will not allow the player to progress through playtime only through manual promotions
]]
JBR_SetupRankTable(TEAM_POLICE, 8, 15, ".", 5, 5, false)-- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
--[[
JBR_SetupRank(RankID, TimeRequired, Name, Prefix, Permissions, ExtraStats, Loadout, Icon)
RankID - RankID should start from 1
TimeRequired - First rank MUST always have 0, other ranks must be above the previous one. It counts the difference between OLD and NEW rank
Name - Rank name
Prefix - Prefix before players name
Permissions
----------------------------------------------------
Promote = true/false -> Can this rank promote?
MaxPromotion = Number -> Max rank this rank can promote to
Demote = true/false -> Can this rank demote?
MaxDemotion = Number -> Max rank this rank can demote to
Leaving MaxPromotion empty will allow to set to highest rank
Leaving MaxDemotion empty will allow to set to lowest rank
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
----------------------------------------------------
ExtraStats - Extra stats (speaks for itself)
Loadout - Extraloadout for this SPECIFIC rank
Icon - Icon path for this ranks icon
]]
JBR_SetupRank(1, 0, "Recruit", "Rct", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, Material("jobranks/police/rank1.png"))
JBR_SetupRank(2, 1500, "Deputy", "Dpt", {Promote = false, Demote = false}, {Health = 10, Armor = 10}, {}, Material("jobranks/police/rank2.png"))
JBR_SetupRank(3, 3000, "Detective", "Det", {Promote = false, Demote = false}, {Health = 15, Armor = 15}, {}, Material("jobranks/police/rank3.png"))
JBR_SetupRank(4, 6000, "Sergeant", "Sgt", {Promote = false, Demote = false}, {Health = 20, Armor = 20}, {}, Material("jobranks/police/rank4.png"))
JBR_SetupRank(5, 12000, "Lieutenant", "Lt", {Promote = false, Demote = true, MaxDemotion = 4}, {Health = 25, Armor = 25}, {"weapon_pumpshotgun2"}, Material("jobranks/police/rank5.png"))
JBR_SetupRank(6, 20000, "Captain", "Cpt", {Promote = true, Demote = false, MaxPromotion = 5}, {Health = 30, Armor = 30}, {}, Material("jobranks/police/rank6.png"))
JBR_SetupRank(7, 30000, "Major", "Maj", {Promote = true, Demote = true, MaxPromotion = 5, MaxDemotion = 3}, {Health = 35, Armor = 35}, {"weapon_mp52"}, Material("jobranks/police/rank7.png"))
JBR_SetupRank(8, 45000, "Inspector", "Insp", {Promote = true, Demote = true}, {Health = 40, Armor = 40}, {}, Material("jobranks/police/rank8.png"))
--[[
RankID - Rank to setup for, set to false if for all ranks
Function - Custom lua function
NOTE: ONLY SETUP CUSTOM LUA FUNCTION IF YOU KNOW WHAT YOU ARE DOING
]]
JBR_SetupRankSpawnFunc(false, function(Player) print(Player, "all ranks") end) -- This custom lua function will run for ALL ranks upon SPAWN
JBR_SetupRankSpawnFunc(1, function(Player) print(Player, "rank 1") end) -- This custom lua function will run for ONLY RANK 1 upon SPAWN
--[[
JBR_SetupRankModel(RankID, ModelTbl)
RankID - Rank to setup for
ModelTbl - Model information, {{Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}}
]]
JBR_SetupRankModel(1, {{Model = "models/player/police.mdl", Bodygroups = {{0,0},{2,1}}, Skin = 1}})--Sets model, two custom bodygroups and skin to 1
--Skipped rank 2, it will now set default model on rank 2
JBR_SetupRankModel(3, {{Model = "models/player/police.mdl", Bodygroups = {{0,0},{2,1}}, Skin = 1},{Model = "models/player/police_fem.mdl", Bodygroups = nil, Skin = 3}}) -- EXAMPLE OF MULTIPLY MODELS FOR ONE RANK
JBR_SetupRankModel(4, {{Model = "models/player/police_fem.mdl", Bodygroups = nil, Skin = 3}})--Sets model, no bodygroups, sets skin to 3
JBR_SetupRankModel(5, {{Model = nil, Bodygroups = nil, Skin = 2}})--Sets default model, no bodygroups, sets skin to 2
--[[
JBR_AddLoadout(RankID, Weapons)
RankID - RankID
Weapons - List of weapons
This adds the loadout to this rank AND all ranks ABOVE this rank
]]
JBR_AddLoadout(5, {"weapon_pumpshotgun2"})
JBR_AddLoadout(7, {"weapon_mp52"})
--[[
JBR_AddEntity(RankID, Entities)
RankID - RankID required to buy the entities
Entities - List of entities
This will allow the input rank and all ABOVE this rank to purchase these entities
]]
JBR_AddEntity(5, {"money_printer"})
--[[
JBR_AddShipment(RankID, Shipments)
RankID - RankID required to buy the shipments
Shipments - List of shipments
This will allow the input rank and all ABOVE this rank to purchase these shipments
]]
JBR_AddShipment(5, {"weapon_pumpshotgun2"})
JBR_SetupRankTable(TEAM_CHIEF, 4, 30, ".", 1, 1, false) -- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
JBR_SetupRank(1, 0, "Chief Recruit", "Rct", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(2, 5000, "Deputy Chief", "Dpt", {Promote = false, Demote = false}, {Health = 25, Armor = 25}, {}, nil)
JBR_SetupRank(3, 10000, "Assistant Chief", "Asst", {Promote = false, Demote = false}, {Health = 50, Armor = 50}, {}, nil)
JBR_SetupRank(4, 20000, "Chief of Police", "Chief", {Promote = true, Demote = true}, {Health = 100, Armor = 100}, {}, nil)
JBR_SetupRankTable(TEAM_MEDIC, 9, 15, ".", nil, nil, false) -- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
JBR_SetupRank(1, 0, "Medic Trainee", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(2, 1500, "Medic", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(3, 3000, "Medical Scientist", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(4, 6000, "Junior Doctor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(5, 12000, "Doctor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(6, 20000, "Plastic Surgeon", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(7, 30000, "Brain Surgeon", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(8, 45000, "Chief Physician", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(9, 60000, "Hospital Manager", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRankTable(TEAM_MAYOR, 7, 45, ".", 1, 1, false) -- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
JBR_SetupRank(1, 0, "Candidate", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(2, 5000, "Politician", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(3, 10000, "Vice Mayor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(4, 15000, "Mayor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(5, 20000, "Vice President", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(6, 25000, "President", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(7, 30000, "Supreme Leader", nil, {Promote = false, Demote = false}, nil, {}, nil)
--[[
NOTE: THIS FUNCTION HAS TO BE CALLED AT THE END OF THE CONFIG
JBR_CopyRankTable(JobToCopy, Job)
JobToCopy - This is the jobs ranktable it will copy and use
Job - The job that should use the ranktable
Example: JBR_CopyRankTable(TEAM_CHIEF, TEAM_POLICE)
This would give TEAM_POLICE the same ranks as TEAM_CHIEF
However this only COPY the table, the progression is still unique for each job
]]
JBR_CopyRankTable(TEAM_POLICE, TEAM_POLICE)
end)
end
hook.Add("DarkRPFinishedLoading", "JBR_InitRanks", function() if DCONFIG then hook.Add("DConfigDataLoaded", "JBR_InitRanks", JBR_InitRanks) elseif ezJobs then hook.Add("ezJobsLoaded", "JBR_InitRanks", JBR_InitRanks) else hook.Add("loadCustomDarkRPItems", "JBR_InitRanks", JBR_InitRanks) end
end)
Si quelqu'un pourrait m'aider, je lui serais reconnaissant.
Bien cordialement.
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Personne n'a ce script en fait :') ?
 
Firyo89

Firyo89

Geek suprême
Messages
572
Score réaction
123
Points
170
Tu veux faire quoi enfait, explique
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Firyo89 à dit:
Tu veux faire quoi enfait, explique
J'ai 18 métiers, une police avec grade complet.
En gros la recrue peut-être accéder sans temps, en suite le gardien de la paix c'est 10 heure de jeu minimum, en suite le sous-brigadier 30 heures, enfin etc... Pour chaque grade il y aura un minimum d'heure à avoir. Ils ont également des préfix comme sur la config ci-dessus "Rct", "Dpt" etc.. pour exemple j'avais fais ça.
Les grades fonctionnent parfaitement, mais l'accessibilité au niveau du temps ne fonctionne pas. En gros ça bloque ici : JBR_SetupRestrictedJob(TEAM_CHIEF, {[TEAM_POLICE] = 8})
 
Firyo89

Firyo89

Geek suprême
Messages
572
Score réaction
123
Points
170
La c'est pour que pour que ton joueur prenne le job "TEAM_CHIEF" il doit être grade "8" dans la "TEAM_POLICE"
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Bon voilà mon fichier de config :

Cette fois-ci en étant dans le métier TEAM_RECRUE, et bien ça ne fait absolument rien, je peux quand même prendre le métier TEAM_POLICE
pourtant : JBR_SetupRestrictedJob(TEAM_POLICE, {[TEAM_RECRUE] = 2}) j'ai ça
et 2 correspond au métier TEAM_POLICE

Code:
--[[
Added a function to config to copy existing jobrank tables for other jobs:
JBR_CopyRankTable(JobToCopy, Job)
JobToCopy - This is the jobs ranktable it will copy and use
Job - The job that should use the ranktable
Example: JBR_CopyRankTable(TEAM_CHIEF, TEAM_POLICE)
This would give TEAM_POLICE the same ranks as TEAM_CHIEF
However this only COPY the table, the progression is still unique for each job
NOTE: THIS FUNCTION HAS TO BE CALLED AT THE END OF THE CONFIG
Added command to convert all data from SQLite to MySQL (This overwrites MySQL data, use player command if you wish to convert a specific player)
Restart server once this command has been used as it doesn't update current players
"jobranks_convertsql_all"
Config changes:
]]
JobRanksConfig = JobRanksConfig or {}
JobRanksConfig.MYSQLOO = false
JobRanksConfig.AdminAccessCustomCheck = function(Player) if Player:IsAdmin() or Player:IsSuperAdmin() then return true else return false end
end
JobRanksConfig.UpdateTimer = 30
JobRanksConfig.PlayersRequired = 0
JobRanksConfig.BonusSalaryPercent = false
JobRanksConfig.DisableAFKProgress = true
JobRanksConfig.PromotionChatCommands = {"rpromote"}
JobRanksConfig.DemotionChatCommands = {"rdemote"}
JobRanksConfig.ResetRanksOnDeath = false
JobRanksConfig.HUD = true
JobRanksConfig.UIW = 100
JobRanksConfig.UIH = 0
--[[
bar = a bar for progress
time = text for time left
number = numbers only
]]
JobRanksConfig.HUDType = "number"
--[[
1 = Displays: Job
2 = Displays: Jobrank
3 = Displays: Job (JobRank)
]]
JobRanksConfig.ShowJobType = 3
JobRanksConfig.UIBoxColor = Color(100,100,100,200)
JobRanksConfig.UIOutlineColor = Color(200, 200, 200, 200)
JobRanksConfig.UITextColor = Color(255,255,255,200)
JobRanksConfig.BarBackground = Color(0,0,0,255)
JobRanksConfig.Bar = Color(0,200,0,255)
JobRanks = JobRanks or {}
JobRanksConfig.JobJoinRestrictments = JobRanksConfig.JobJoinRestrictments or {}
JobRanksConfig.JobPermissionList = JobRanksConfig.JobPermissionList or {}
local function JBR_InitRanks()
timer.Simple(3, function()
--[[
JBR_SetupRestrictedJob(Job, RequiredJobs)
Job - The job to be restricted
RequiredJobs - Table of the ranks you must reach in that specific job {[Job] = RequiredRank, [Job2] = RequiredRank} etc
]]
JBR_SetupRestrictedJob(TEAM_POLICE, {[TEAM_RECRUE] = 2})
--[[
JBR_SetupJobPermissionList(Job, AllowedJobs)
Job - Job that is allowed to promote/demote
AllowedJobs - The jobs the job is allowed to promote/demote {[Job] = true, [Job2] = true} etc
]]
JBR_SetupJobPermissionList(TEAM_POLICE, {[TEAM_POLICE] = true})
--[[
JBR_SetupRankTable(Job, MaxRank, BonusSalary, PrefixSeparator, Warrant, Wanted, DisableProgression)
Job - Variable for job for example TEAM_POLICE
MaxRank - Maximum rank achieveable
BonusSalary - Bonus salary for each rank, so Amount*Rank, if bonus is set to 15 and you are rank 3 you would recieve 45$ extra
PrefixSeparator - What should be between Prefix and Name, for example . would be Pvt.ToBadForYou or _ would be Pvt_ToBadForYou
Warrant - Rank required to warrant, set to nil to disable
Wanted - Rank required to Wanted, set to nil to disable
DisableProgression - true or false, true will not allow the player to progress through playtime only through manual promotions
]]
JBR_SetupRankTable(TEAM_POLICE, 8, 15, ".", 5, 5, false)-- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
--[[
JBR_SetupRank(RankID, TimeRequired, Name, Prefix, Permissions, ExtraStats, Loadout, Icon)
RankID - RankID should start from 1
TimeRequired - First rank MUST always have 0, other ranks must be above the previous one. It counts the difference between OLD and NEW rank
Name - Rank name
Prefix - Prefix before players name
Permissions
----------------------------------------------------
Promote = true/false -> Can this rank promote?
MaxPromotion = Number -> Max rank this rank can promote to
Demote = true/false -> Can this rank demote?
MaxDemotion = Number -> Max rank this rank can demote to
Leaving MaxPromotion empty will allow to set to highest rank
Leaving MaxDemotion empty will allow to set to lowest rank
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
----------------------------------------------------
ExtraStats - Extra stats (speaks for itself)
Loadout - Extraloadout for this SPECIFIC rank
Icon - Icon path for this ranks icon
]]
--[[
JBR_SetupRank(1, 0, "Recruit", "Rct", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, Material("jobranks/police/rank1.png"))
JBR_SetupRank(2, 1500, "Deputy", "Dpt", {Promote = false, Demote = false}, {Health = 10, Armor = 10}, {}, Material("jobranks/police/rank2.png"))
JBR_SetupRank(3, 3000, "Detective", "Det", {Promote = false, Demote = false}, {Health = 15, Armor = 15}, {}, Material("jobranks/police/rank3.png"))
JBR_SetupRank(4, 6000, "Sergeant", "Sgt", {Promote = false, Demote = false}, {Health = 20, Armor = 20}, {}, Material("jobranks/police/rank4.png"))
JBR_SetupRank(5, 12000, "Lieutenant", "Lt", {Promote = false, Demote = true, MaxDemotion = 4}, {Health = 25, Armor = 25}, {"weapon_pumpshotgun2"}, Material("jobranks/police/rank5.png"))
JBR_SetupRank(6, 20000, "Captain", "Cpt", {Promote = true, Demote = false, MaxPromotion = 5}, {Health = 30, Armor = 30}, {}, Material("jobranks/police/rank6.png"))
JBR_SetupRank(7, 30000, "Major", "Maj", {Promote = true, Demote = true, MaxPromotion = 5, MaxDemotion = 3}, {Health = 35, Armor = 35}, {"weapon_mp52"}, Material("jobranks/police/rank7.png"))
JBR_SetupRank(8, 45000, "Inspector", "Insp", {Promote = true, Demote = true}, {Health = 40, Armor = 40}, {}, Material("jobranks/police/rank8.png"))
]]--
--[[
RankID - Rank to setup for, set to false if for all ranks
Function - Custom lua function
NOTE: ONLY SETUP CUSTOM LUA FUNCTION IF YOU KNOW WHAT YOU ARE DOING
]]
JBR_SetupRankSpawnFunc(false, function(Player) print(Player, "all ranks") end) -- This custom lua function will run for ALL ranks upon SPAWN
JBR_SetupRankSpawnFunc(1, function(Player) print(Player, "rank 1") end) -- This custom lua function will run for ONLY RANK 1 upon SPAWN
--[[
JBR_SetupRankModel(RankID, ModelTbl)
RankID - Rank to setup for
ModelTbl - Model information, {{Model = "MODELPATH", Bodygroups{{BodygroupID, Amount}}, Skin = SKINID}}
]]
JBR_SetupRankModel(1, {{Model = "models/player/police.mdl", Bodygroups = {{0,0},{2,1}}, Skin = 1}})--Sets model, two custom bodygroups and skin to 1
--Skipped rank 2, it will now set default model on rank 2
JBR_SetupRankModel(3, {{Model = "models/player/police.mdl", Bodygroups = {{0,0},{2,1}}, Skin = 1},{Model = "models/player/police_fem.mdl", Bodygroups = nil, Skin = 3}}) -- EXAMPLE OF MULTIPLY MODELS FOR ONE RANK
JBR_SetupRankModel(4, {{Model = "models/player/police_fem.mdl", Bodygroups = nil, Skin = 3}})--Sets model, no bodygroups, sets skin to 3
JBR_SetupRankModel(5, {{Model = nil, Bodygroups = nil, Skin = 2}})--Sets default model, no bodygroups, sets skin to 2
--[[
JBR_AddLoadout(RankID, Weapons)
RankID - RankID
Weapons - List of weapons
This adds the loadout to this rank AND all ranks ABOVE this rank
]]
--JBR_AddLoadout(5, {"weapon_pumpshotgun2"})
--JBR_AddLoadout(7, {"weapon_mp52"})
--[[
JBR_AddEntity(RankID, Entities)
RankID - RankID required to buy the entities
Entities - List of entities
This will allow the input rank and all ABOVE this rank to purchase these entities
]]
--JBR_AddEntity(5, {"money_printer"})
--[[
JBR_AddShipment(RankID, Shipments)
RankID - RankID required to buy the shipments
Shipments - List of shipments
This will allow the input rank and all ABOVE this rank to purchase these shipments
]]
--JBR_AddShipment(5, {"weapon_pumpshotgun2"})
JBR_SetupRankTable(TEAM_RECRUE, 18, 0, ".", 1, 1, false)
JBR_SetupRank(1, 0, "Recrue", "Rce", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(2, 36000, "Gardien de la paix", "Grd", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(3, 108000, "Sous-Brigadier", "S-Bri", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(4, 180000, "Brigadier", "Bri", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(5, 252000, "Brigadier-Chef", "BriC", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(6, 324000, "Brigadier-Major", "BriMaj", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil))
JBR_SetupRank(7, 432000, "Lieutenant", "Ltn", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(8, 540000, "Lieutenant-Major", "LtnMaj", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(9, 648000, "Lieutenant-Capitaine", "LtnCne", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(10, 756000, "Lieutenant-Colonel", "LtnCl", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(11, 936000, "Capitaine", "Cne", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(12, 1080000, "Commandant", "Cdt", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(13, 1260000, "Colonel", "Col", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(14, 1476000, "Commissaire", "Com", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(15, 1656000, "Commissaire Principal", "ComP", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(16, 1836000, "Directeur des services actif", "Dir", {Promote = false, Demote = false}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(17, 2016000, "Commissaire Divisionnaire", "Div", {Promote = true, Demote = true}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRank(18, 2160000, "Inspecteur Général", "Insp", {Promote = true, Demote = true}, {Health = 5, Armor = 5}, {}, nil)
JBR_SetupRankTable(TEAM_MEDIC, 9, 15, ".", nil, nil, false) -- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
JBR_SetupRank(1, 0, "Medic Trainee", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(2, 1500, "Medic", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(3, 3000, "Medical Scientist", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(4, 6000, "Junior Doctor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(5, 12000, "Doctor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(6, 20000, "Plastic Surgeon", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(7, 30000, "Brain Surgeon", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(8, 45000, "Chief Physician", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(9, 60000, "Hospital Manager", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRankTable(TEAM_MAYOR, 7, 45, ".", 1, 1, false) -- THIS MUST ALWAYS BE FIRST OR IT WILL SETUP FOR THE JOBRANK THAT WAS DEFINED BEFORE THIS
JBR_SetupRank(1, 0, "Candidate", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(2, 5000, "Politician", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(3, 10000, "Vice Mayor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(4, 15000, "Mayor", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(5, 20000, "Vice President", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(6, 25000, "President", nil, {Promote = false, Demote = false}, nil, {}, nil)
JBR_SetupRank(7, 30000, "Supreme Leader", nil, {Promote = false, Demote = false}, nil, {}, nil)
--[[
NOTE: THIS FUNCTION HAS TO BE CALLED AT THE END OF THE CONFIG
JBR_CopyRankTable(JobToCopy, Job)
JobToCopy - This is the jobs ranktable it will copy and use
Job - The job that should use the ranktable
Example: JBR_CopyRankTable(TEAM_CHIEF, TEAM_POLICE)
This would give TEAM_POLICE the same ranks as TEAM_CHIEF
However this only COPY the table, the progression is still unique for each job
]]
--JBR_CopyRankTable(TEAM_POLICE, TEAM_POLICE)
end)
end
hook.Add("DarkRPFinishedLoading", "JBR_InitRanks", function() if DCONFIG then hook.Add("DConfigDataLoaded", "JBR_InitRanks", JBR_InitRanks) elseif ezJobs then hook.Add("ezJobsLoaded", "JBR_InitRanks", JBR_InitRanks) else hook.Add("loadCustomDarkRPItems", "JBR_InitRanks", JBR_InitRanks) end
end)
Bon je crois que je viens de comprendre, en fait cela ne fonctionne qu'avec un métier, et en suite ça note juste des grades à côté.
C'est ça peut-être? Ou alors comment faire pour les 18 métiers ? :/
 
Firyo89

Firyo89

Geek suprême
Messages
572
Score réaction
123
Points
170
C'est un métier pour tous les policiers par éxemple
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
par exemple ? tu as fini ta phrase ou pas x) ^^ ?
 
Firyo89

Firyo89

Geek suprême
Messages
572
Score réaction
123
Points
170
J'ai bien fini ma phrase

Moi j'avais fais ça sur mon ancien serveur :

Policier

Commissaire [Peut promure Policier]
 
Shifter

Shifter

Geek suprême
Messages
162
Score réaction
46
Points
140
Bonjour,

Si je puis me permettre, tu as énormément de grades dans ta police.... et beaucoup qui sont incompréhensibles... (Lieutenant-Capitaine, Lieutenant-Commandant ou autres grades inexistants) est-ce fait exprès ? Car tu pourrais simplifier les choses (dans ta config et ton gameplay) avec les véritables grades qui sont moins nombreux ^^
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Shifter à dit:
Bonjour,

Si je puis me permettre, tu as énormément de grades dans ta police.... et beaucoup qui sont incompréhensibles... (Lieutenant-Capitaine, Lieutenant-Commandant ou autres grades inexistants) est-ce fait exprès ? Car tu pourrais simplifier les choses (dans ta config et ton gameplay) avec les véritables grades qui sont moins nombreux ^^
Je n'ai pas choisis, c'est à quelqu'un qui le fais, mais merci et oui tu pouvais te permettre ;) ^^
 
Shifter

Shifter

Geek suprême
Messages
162
Score réaction
46
Points
140
xLomble77 à dit:
Je n'ai pas choisis, c'est à quelqu'un qui le fais, mais merci et oui tu pouvais te permettre ;) ^^
Je vois, pas de soucis ^^
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
@Firyo89 bon j'ai réussi tout ça sauf maintenant je veux attribuer un modèle à un grade spécifique avec :
JBR_SetupRankModel(18, {{Model = "models/player/police_agent/male_01_agent.mdl", Bodygroups{{0, 1}}, Skin = 1}})
et ça fonctionne pas, serais-tu pourquoi ?
ou quelqu'un serait-il?
 
  • Initiateur de la discussion
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Quelqu'un du coup ? ^^
 
Discord d'entraide
Rejoignz-nous sur Discord