Advertisement
Guest User

Driver licence config

a guest
Apr 20th, 2019
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.43 KB | None | 0 0
  1.  
  2. --[[
  3. Fixed error with Perfect Radar System
  4. Minior fixes
  5.  
  6. Config changes:
  7. Added .DisplayPoints -> Displays license points on players driver license (only for the player himself)
  8. ]]
  9.  
  10. TBFYDIConfig = TBFYDIConfig or {}
  11. DI_THEORYDB = DI_THEORYDB or {}
  12. DI_PLAYERDATA = DI_PLAYERDATA or {}
  13. DI_INSTRUCTORS = DI_INSTRUCTORS or {}
  14.  
  15. --Contact me on SF for help to translate
  16. --Languages available:
  17. --[[
  18. English
  19. French
  20. German
  21. Korean
  22. Russian
  23. Slovak
  24. ]]
  25. TBFYDIConfig.LanguageToUse = "English"
  26.  
  27. //Width and Height of overview menu
  28. TBFYDIConfig.OverviewW, TBFYDIConfig.OverviewH = 525, 375
  29. //Width and Height of question menu
  30. TBFYDIConfig.QuestionW, TBFYDIConfig.QuestionH = 800, 450
  31.  
  32. TBFYDIConfig.AdminChatCommands = {"!dimanage", "!dimenu"}
  33. TBFYDIConfig.InstructorChatCommands = {"!instructor", "!insmenu"}
  34.  
  35. //How many % of the questions need to be answered correctly in order to pass the theory test
  36. TBFYDIConfig.Theory_PercentageRequired = 80
  37. //How many questions the theory test will have in total
  38. //NOTE: THIS NUMBER CANT BE HIGHER THAN THE AMOUNT OF QUESTIONS AVAILABLE
  39. TBFYDIConfig.Theory_QuestionAmount = 48
  40.  
  41. //Automatic Practical test can only be done if no instructors are online
  42. --[[
  43. 1 = No restrictions
  44. 2 = Only if there's driver instructors
  45. 3 = Only if there isn't driver instructors
  46. ]]
  47. TBFYDIConfig.PracticalTestRestriction = 3
  48. //Should The Perfect Radar System fail pracital tests if exceeding speedlimit? (If it's installed)
  49. TBFYDIConfig.PracticalTestRadarDetection = true
  50. //How much above the speedlimit do you have to drive to fail the test?
  51. TBFYDIConfig.PracticalTestRadarSpeedLimit = 1
  52.  
  53. //Allow checking the drivers license through vehicle?
  54. TBFYDIConfig.CheckLicenseThroughVehicle = true
  55.  
  56. //When can a player remove/add a point again
  57. TBFYDIConfig.PointsCooldown = 120
  58. //Use french point system? (goes from max points to 0 instead of 0 to max points)
  59. TBFYDIConfig.FrenchPointSystem = true
  60.  
  61. //If set to true, you have to redo the theory test if your license is revoked due to points
  62. TBFYDIConfig.RedoTheoryOnPointsRevoke = true
  63.  
  64. //Should the person receive the driving license without a practical test?
  65. TBFYDIConfig.GrantLicenseOnTheoryComplete = true
  66.  
  67. //Instructors requires whitelist for each license type
  68. TBFYDIConfig.InstructorLicenses = true
  69.  
  70. //Do you require whitelist for instructor job/Giving licenses?
  71. TBFYDIConfig.InstructorWhitelist = true
  72.  
  73. //Do you require the specific job in order to grant license?
  74. TBFYDIConfig.InstructorRestrictToJob = true
  75.  
  76. TBFYDIConfig.NPCData = {
  77. ["di_instructor_vehiclespawner"] = {Text = "Instructor Vehicle Spawn", Model = "models/alyx.mdl", TextFont = "di_npc_text", TextRotationSpeed = 80, TextColor = Color(255,255,255,255), TextBackgroundColor = Color(0,0,0,255)},
  78. ["di_practicaltest_npc"] = {Text = "Practical Driver Test", Model = "models/alyx.mdl", TextFont = "di_npc_text", TextRotationSpeed = 80, TextColor = Color(255,255,255,255), TextBackgroundColor = Color(0,0,0,255)},
  79. }
  80.  
  81. --[[
  82. Name = Name displayed in menu
  83. Class = Vehicle Class (Found from sandbox spawn menu)
  84. Skin = Vehicle Skin ID
  85. Req = LicenseID required, set to nil if for all
  86. ]]
  87. TBFYDIConfig.InstructorVehicles = {
  88. [1] = {Name = "Jeep", Class = "Jeep", Skin = 1, Req = nil},
  89. [2] = {Name = "Airboat", Class = "Airboat", Skin = 1, Req = 2},
  90. }
  91.  
  92. //Should SteamID be displayed on license?
  93. TBFYDIConfig.DisplaySteamID = true
  94. //Should job be displayed on license?
  95. TBFYDIConfig.DisplayJob = true
  96. //Should license display points?
  97. TBFYDIConfig.DisplayPoints = false
  98.  
  99. //Set this to false if you only want license restrictions on those you add in the VehicleDATABASE config
  100. TBFYDIConfig.ShouldRestrictDefault = true
  101. //The default license you require for every vehicle unless specified different in the VehicleDATABASE config
  102. TBFYDIConfig.DefaultRestrictLicense = 2
  103. --[[
  104. 1 = No Restrictions
  105. 2 = Notifies that you require license
  106. 3 = Can't enter vehicle
  107. ]]
  108. TBFYDIConfig.EnterVehicleRestrictionType = 3
  109. //This seems to cause issues to some when set to true, if you have issues set this to false
  110. TBFYDIConfig.RespawnAfterCleanUp = true
  111.  
  112. //Add vehicles that should require licenses here, also which license it requires
  113. //[MODELPATH] = LicenseID Required
  114. TBFYDIConfig.VehicleDATABASE = {
  115. ["models/tdmcars/bmwm3e92.mdl"] = 3,
  116. }
  117.  
  118. //Who can access admin commands,menus etc
  119. TBFYDIConfig.AdminAccessCustomCheck = function(Player) return Player:IsSuperAdmin() end
  120.  
  121. DI_DATABASE = {
  122. [1] = {
  123. Name = "A", --License Name
  124. Desc = "Any motorcycle or motor tricycle.", --Description
  125. Image = "di_motorcycle.png", --Image name
  126. TheoryCost = 500, --Theory test cost
  127. TheoryTime = 1200, --How much time for the theory test
  128. MaxPoints = 5, --Max points for the license before revoked
  129. PracticalCost = 500, --How much the practical test costs
  130. PracticalTime = 100, --How much time you have for the practical test
  131. PracticalVehicle = "Jeep", -- Vehicle class
  132. PracticalVehicleSkin = 1, -- Skin for vehicle
  133. },
  134. [2] = {
  135. Name = "B",
  136. Desc = "Motor vehicles.",
  137. Image = "di_car.png",
  138. TheoryCost = 2500,
  139. TheoryTime = 1200,
  140. MaxPoints = 5,
  141. PracticalCost = 2500,
  142. PracticalTime = 100,
  143. PracticalVehicle = "Jeep",
  144. PracticalVehicleSkin = 1,
  145. },
  146. [3] = {
  147. Name = "C",
  148. Desc = "Large goods vehicles.",
  149. Image = "di_truck.png",
  150. TheoryCost = 3000,
  151. TheoryTime = 1200,
  152. MaxPoints = 5,
  153. PracticalCost = 3000,
  154. PracticalTime = 100,
  155. PracticalVehicle = "Jeep",
  156. PracticalVehicleSkin = 1,
  157. },
  158. [4] = {
  159. Name = "D",
  160. Desc = "Buses.",
  161. Image = "di_bus.png",
  162. TheoryCost = 3000,
  163. TheoryTime = 1200,
  164. MaxPoints = 5,
  165. PracticalCost = 3000,
  166. PracticalTime = 100,
  167. PracticalVehicle = "Jeep",
  168. PracticalVehicleSkin = 1,
  169. },
  170. [5] = {
  171. Name = "E",
  172. Desc = "Military Grade vehicles.",
  173. Image = "di_military.png",
  174. TheoryCost = 5000,
  175. TheoryTime = 1200,
  176. MaxPoints = 5,
  177. PracticalCost = 5000,
  178. PracticalTime = 100,
  179. PracticalVehicle = "Jeep",
  180. PracticalVehicleSkin = 1,
  181. }
  182. }
  183.  
  184. function DI_InitJobConfigs()
  185. timer.Simple(3, function()
  186. //Jobs that get the license checker and can remove points
  187. TBFYDIConfig.PoliceJobs = {
  188. [TEAM_POLICE] = true,
  189. [TEAM_CHIEF] = true,
  190. }
  191.  
  192. //Job requirement to give the license
  193. TBFYDIConfig.InstructorJob = TEAM_DI_INSTRUCTOR
  194. end)
  195. end
  196.  
  197. hook.Add("DarkRPFinishedLoading", "DI_InitJobConfigs", function()
  198. if ezJobs then
  199. hook.Add("ezJobsLoaded", "DI_InitJobConfigs", DI_InitJobConfigs)
  200. else
  201. hook.Add("loadCustomDarkRPItems", "DI_InitJobConfigs", DI_InitJobConfigs)
  202. end
  203. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement