Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 12th, 2013  |  syntax: Lua  |  size: 7.07 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. GM.Version = "2.4.3"
  2. GM.Name = "DarkRP"
  3. GM.Author = "By Rickster, Updated: Pcwizdan, Sibre, philxyz, [GNC] Matt, Chrome Bolt, FPtje Falco, Eusion, Drakehawke"
  4.  
  5. CUR = "$"
  6.  
  7. -- Checking if counterstrike is installed correctly
  8. if table.Count(file.Find("*", "cstrike")) == 0 then
  9.         timer.Create("TheresNoCSS", 10, 0, function()
  10.                 for k,v in pairs(player.GetAll()) do
  11.                         v:ChatPrint("Counter Strike: Source is incorrectly installed!")
  12.                         v:ChatPrint("You need it for DarkRP to work!")
  13.                         print("Counter Strike: Source is incorrectly installed!\nYou need it for DarkRP to work!")
  14.                 end
  15.         end)
  16. end
  17.  
  18. -- RP Name Overrides
  19.  
  20. local meta = FindMetaTable("Player")
  21. meta.SteamName = meta.SteamName or meta.Name
  22. meta.Name = function(self)
  23.         if not IsValid(self) then return "" end
  24.         if GAMEMODE.Config.allowrpnames then
  25.                 self.DarkRPVars = self.DarkRPVars or {}
  26.                 return self.DarkRPVars.rpname and tostring(self.DarkRPVars.rpname) or self:SteamName()
  27.         else
  28.                 return self:SteamName()
  29.         end
  30. end
  31. meta.Nick = meta.Name
  32. meta.GetName = meta.Name
  33. -- End
  34.  
  35. DeriveGamemode("sandbox")
  36.  
  37. util.AddNetworkString("DarkRP_InitializeVars")
  38. util.AddNetworkString("DarkRP_DoorData")
  39. util.AddNetworkString("FAdmin_retrievebans")
  40. util.AddNetworkString("DarkRP_keypadData")
  41.  
  42. AddCSLuaFile("addentities.lua")
  43. AddCSLuaFile("shared.lua")
  44. AddCSLuaFile("ammotypes.lua")
  45. AddCSLuaFile("cl_init.lua")
  46. AddCSLuaFile("config.lua")
  47.  
  48. AddCSLuaFile("client/DRPDermaSkin.lua")
  49. AddCSLuaFile("client/help.lua")
  50. AddCSLuaFile("client/helpvgui.lua")
  51. AddCSLuaFile("client/hud.lua")
  52. AddCSLuaFile("client/showteamtabs.lua")
  53. AddCSLuaFile("client/vgui.lua")
  54.  
  55. AddCSLuaFile("shared/animations.lua")
  56. AddCSLuaFile("shared/commands.lua")
  57. AddCSLuaFile("shared/entity.lua")
  58. AddCSLuaFile("shared/language.lua")
  59. AddCSLuaFile("shared/MakeThings.lua")
  60. AddCSLuaFile("shared/Workarounds.lua")
  61.  
  62. -- Earthquake Mod addon
  63. resource.AddFile("sound/earthquake.mp3")
  64. util.PrecacheSound("earthquake.mp3")
  65.  
  66. resource.AddFile("materials/darkrp/DarkRPSkin.png")
  67.  
  68. DB = DB or {}
  69. GM.Config = GM.Config or {}
  70. GM.NoLicense = GM.NoLicense or {}
  71.  
  72. -- sv_alltalk must be 0
  73. -- Note, everyone will STILL hear everyone UNLESS rp_voiceradius is 1!!!
  74. -- This will fix the rp_voiceradius not working
  75. game.ConsoleCommand("sv_alltalk 0\n")
  76.  
  77. include("_MySQL.lua")
  78. include("config.lua")
  79. include("licenseweapons.lua")
  80.  
  81. include("server/chat.lua")
  82. include("server/admincc.lua")
  83.  
  84. include("shared/animations.lua")
  85. include("shared/commands.lua")
  86. include("shared/entity.lua")
  87.  
  88. include("shared/language.lua")
  89. include("shared/MakeThings.lua")
  90. include("shared/Workarounds.lua")
  91.  
  92. include("shared.lua")
  93. include("addentities.lua")
  94. include("ammotypes.lua")
  95.  
  96. include("server/data.lua")
  97. include("server/gamemode_functions.lua")
  98. include("server/main.lua")
  99. include("server/player.lua")
  100. include("server/questions.lua")
  101. include("server/util.lua")
  102. include("server/votes.lua")
  103.  
  104.  
  105. -- Falco's prop protection
  106. local BlockedModelsExist = sql.QueryValue("SELECT COUNT(*) FROM FPP_BLOCKEDMODELS;") ~= false
  107. if not BlockedModelsExist then
  108.         sql.Query("CREATE TABLE IF NOT EXISTS FPP_BLOCKEDMODELS('model' TEXT NOT NULL PRIMARY KEY);")
  109.         include("fpp/FPP_DefaultBlockedModels.lua") -- Load the default blocked models
  110. end
  111. AddCSLuaFile("fpp/sh_CPPI.lua")
  112. AddCSLuaFile("fpp/sh_settings.lua")
  113. AddCSLuaFile("fpp/client/FPP_Menu.lua")
  114. AddCSLuaFile("fpp/client/FPP_HUD.lua")
  115. AddCSLuaFile("fpp/client/FPP_Buddies.lua")
  116. AddCSLuaFile("shared/fadmin_darkrp.lua")
  117.  
  118. include("fpp/sh_settings.lua")
  119. include("fpp/sh_CPPI.lua")
  120. include("fpp/server/FPP_Settings.lua")
  121. include("fpp/server/FPP_Core.lua")
  122. include("fpp/server/FPP_Antispam.lua")
  123. include("shared/fadmin_darkrp.lua")
  124.  
  125. /*---------------------------------------------------------------------------
  126. Loading modules
  127. ---------------------------------------------------------------------------*/
  128. local fol = GM.FolderName.."/gamemode/modules/"
  129. local files, folders = file.Find(fol .. "*", "LUA")
  130. for k,v in pairs(files) do
  131.         include(fol .. v)
  132. end
  133.  
  134. for _, folder in SortedPairs(folders, true) do
  135.         if folder ~= "." and folder ~= ".." then
  136.                 for _, File in SortedPairs(file.Find(fol .. folder .."/sh_*.lua", "LUA"), true) do
  137.                         AddCSLuaFile(fol..folder .. "/" ..File)
  138.                         include(fol.. folder .. "/" ..File)
  139.                 end
  140.  
  141.                 for _, File in SortedPairs(file.Find(fol .. folder .."/sv_*.lua", "LUA"), true) do
  142.                         include(fol.. folder .. "/" ..File)
  143.                 end
  144.  
  145.                 for _, File in SortedPairs(file.Find(fol .. folder .."/cl_*.lua", "LUA"), true) do
  146.                         AddCSLuaFile(fol.. folder .. "/" ..File)
  147.                 end
  148.         end
  149. end
  150.  
  151. local function GetAvailableVehicles(ply)
  152.         if not ply:IsAdmin() then return end
  153.         ServerLog("Available vehicles for custom vehicles:" .. "\n")
  154.         print("Available vehicles for custom vehicles:")
  155.         for k,v in pairs(list.Get("Vehicles")) do
  156.                 ServerLog("\""..k.."\"" .. "\n")
  157.                 print("\""..k.."\"")
  158.         end
  159. end
  160. concommand.Add("rp_getvehicles_sv", GetAvailableVehicles)
  161.  
  162. /*---------------------------------------------------------------------------
  163. Registering numpad data
  164. ---------------------------------------------------------------------------*/
  165. local oldNumpadUp = numpad.OnUp
  166. local oldNumpadDown = numpad.OnDown
  167.  
  168. function numpad.OnUp(ply, key, name, ent, ...)
  169.         numpad.OnUpItems = numpad.OnUpItems or {}
  170.         table.insert(numpad.OnUpItems, {ply = ply, key = key, name = name, ent = ent, arg = {...}})
  171.  
  172.         return oldNumpadUp(ply, key, name, ent, ...)
  173. end
  174.  
  175. function numpad.OnDown(ply, key, name, ent, ...)
  176.         numpad.OnDownItems = numpad.OnDownItems or {}
  177.         table.insert(numpad.OnDownItems, {ply = ply, key = key, name = name, ent = ent, arg = {...}})
  178.  
  179.         return oldNumpadDown(ply, key, name, ent, ...)
  180. end
  181.  
  182. hook.Add("PlayerDeath","DemoteMayor",function(v,k)
  183.     if (v:Team() == TEAM_MAYOR) then
  184.         v:ChangeTeam(TEAM_CITIZEN,true);
  185.         for k, v in ipairs(player.GetAll()) do
  186.             v:PrintMessage(HUD_PRINTCENTER,"The mayor has been killed!");
  187.         end;
  188.     end;
  189. end);
  190.  
  191. hook.Add("PlayerDeath","DemoteGangLeader",function(v,k)
  192.     if (v:Team() == TEAM_GANGLEADER) then
  193.         v:ChangeTeam(TEAM_GANG,true);
  194.         for k, v in ipairs(player.GetAll()) do
  195.             v:PrintMessage(HUD_PRINTCENTER,"The gang leader has been killed!");
  196.         end;
  197.     end;
  198. end);
  199.  
  200. hook.Add("PlayerDeath","DemoteTriadLeader",function(v,k)
  201.     if (v:Team() == TEAM_TRIADLEADER) then
  202.         v:ChangeTeam(TEAM_TRIAD,true);
  203.         for k, v in ipairs(player.GetAll()) do
  204.             v:PrintMessage(HUD_PRINTCENTER,"The triad leader has been killed!");
  205.         end;
  206.     end;
  207. end);
  208.  
  209. hook.Add("PlayerDeath","DemoteMobBoss",function(v,k)
  210.     if (v:Team() == TEAM_MOB) then
  211.         v:ChangeTeam(TEAM_MAFIA,true);
  212.         for k, v in ipairs(player.GetAll()) do
  213.             v:PrintMessage(HUD_PRINTCENTER,"The mob boss has been killed!");
  214.         end;
  215.     end;
  216. end);
  217. resource.AddSingleFile("materials/Hud/Hbar.vmt")
  218. resource.AddSingleFile("materials/Hud/Hbar.vtf")
  219. resource.AddSingleFile("materials/Hud/HbarShadow.vmt")
  220. resource.AddSingleFile("materials/Hud/HbarShadow.vtf")
  221. resource.AddSingleFile("materials/Hud/SServers.vtf")
  222. resource.AddSingleFile("materials/Hud/SServers.vmt")
clone this paste RAW Paste Data