- Initiateur de la discussion
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 :
Si quelqu'un pourrait m'aider, je lui serais reconnaissant.
Bien cordialement.
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)
Bien cordialement.