Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.31 KB | None | 0 0
  1. AddCSLuaFile()
  2. if(SERVER) then
  3. print("Godstick has loaded/updated!")
  4.  end
  5.  
  6. if (CLIENT) then
  7.     surface.CreateFont("DermaDefault24", {
  8.         font = "Tahoma", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  9.         extended = false,
  10.         size = 24,
  11.         weight = 500,
  12.         blursize = 0,
  13.         scanlines = 0,
  14.         antialias = true,
  15.         underline = false,
  16.         italic = false,
  17.         strikeout = false,
  18.         symbol = false,
  19.         rotary = false,
  20.         shadow = false,
  21.         additive = false,
  22.         outline = false
  23.     })
  24.  
  25.     SWEP.PrintName = "Kadens Stick"
  26.     SWEP.Slot = 0
  27.     SWEP.SlotPos = 4
  28.     SWEP.DrawAmmo = false
  29.     SWEP.DrawCrosshair = true
  30. end
  31.  
  32. -- Variables that are used on both client and server
  33. SWEP.Author = "Asriel & Azuraii"
  34. SWEP.Instructions = "Left click to use, right click to select an option"
  35. SWEP.Contact = ""
  36. SWEP.Purpose = ""
  37. SWEP.ViewModelFOV = 62
  38. SWEP.ViewModelFlip = false
  39. SWEP.AnimPrefix = "stunstick"
  40. SWEP.Spawnable = false
  41. SWEP.AdminSpawnable = true
  42. SWEP.NextStrike = 0
  43. SWEP.ViewModel = "models/weapons/c_stunstick.mdl"
  44. SWEP.WorldModel = "models/weapons/w_stunstick.mdl"
  45. SWEP.UseHands = true
  46. --SWEP.Sound = Sound( "weapons/stunstick/stunstick_swing1.wav" );
  47. local ShootSound = Sound("defib/defib_shock.wav")
  48. SWEP.Primary.ClipSize = -1 -- Size of a clip
  49. SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip
  50. SWEP.Primary.Automatic = false -- Automatic/Semi Auto
  51. SWEP.Primary.Ammo = ""
  52. SWEP.Secondary.ClipSize = -1 -- Size of a clip
  53. SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip
  54. SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
  55. SWEP.Secondary.Ammo = ""
  56.  
  57. --[[---------------------------------------------------------
  58.    Name: SWEP:Initialize( )
  59.    Desc: Called when the weapon is first loaded
  60. -----------------------------------------------------------]]
  61. function SWEP:Initialize()
  62.     if SERVER then
  63.         self.Gear = 1
  64.     end
  65.  
  66.     self:SetWeaponHoldType("melee")
  67. end
  68.  
  69. function SWEP:Holster()
  70.     --if not IsFirstTimePredicted() then return end
  71.     if SERVER then
  72.         -- self.Owner:SetNWBool("DrawRing", false)
  73.     end
  74.  
  75.     return true
  76. end
  77.  
  78. function SWEP:Deploy()
  79.     --if not IsFirstTimePredicted() then return end
  80.     if SERVER then
  81.         if not self.Owner:CheckGroup("operator") then
  82.             DarkRP.notify(self.Owner, 0, 4, "The administration stick has been revoked from you!")
  83.             self.Owner:StripWeapon("god_s")
  84.         end
  85.     end
  86.  
  87.     return true
  88. end
  89.  
  90. local SLAP_SOUNDS = {"physics/body/body_medium_impact_hard1.wav", "physics/body/body_medium_impact_hard2.wav", "physics/body/body_medium_impact_hard3.wav", "physics/body/body_medium_impact_hard5.wav", "physics/body/body_medium_impact_hard6.wav", "physics/body/body_medium_impact_soft5.wav", "physics/body/body_medium_impact_soft6.wav", "physics/body/body_medium_impact_soft7.wav"}
  91.  
  92. if CLIENT then
  93.     local godstickCrosshair = surface.GetTextureID("godstick/godstick_crosshairv4")
  94.     local chRotate = 0
  95.  
  96.     local function DrawText(strText, strFont, tblColor, xPos, yPos)
  97.         draw.SimpleTextOutlined(strText, strFont, xPos, yPos, tblColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0, 255))
  98.     end
  99.  
  100.     local ESP_d = CreateClientConVar("godstick_distance", "6000", true, false)
  101.  
  102.     function SWEP:DrawHUD()
  103.         local trace = self.Owner:GetEyeTrace()
  104.         local x = (ScrW() / 2)
  105.         local y = (ScrH() / 2)
  106.         surface.SetDrawColor(HSVToColor(CurTime() % 6 * 60, 1, 1))
  107.         surface.SetTexture(godstickCrosshair)
  108.         surface.DrawTexturedRectRotated(x, y, 64, 64, 0 - chRotate)
  109.         local TargetText = "Target: " .. tostring(trace.Entity)
  110.         local OwnerText
  111.         local ModuleNeme = self.Owner
  112.         local ModuleName = ModuleNeme.StickText or "N/A"
  113.  
  114.         if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
  115.             draw.WordBox(4, x - 150, 10, TargetText, "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  116.             draw.WordBox(4, x - 150, 45, "Steam Name: " .. trace.Entity:SteamName(), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  117.             draw.WordBox(4, x - 150, 80, "Player Name: " .. trace.Entity:Nick(), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  118.             draw.WordBox(4, x - 150, 115, "Player Job: " .. trace.Entity:getDarkRPVar("job"), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  119.             chRotate = chRotate + 8
  120.         end
  121.        
  122.          if IsValid(trace.Entity) and not trace.Entity:IsPlayer() and trace.Entity:CPPIGetOwner() ~= nil then
  123.             draw.WordBox(4, x - 150, 10, TargetText, "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  124.             draw.WordBox(4, x - 150, 45, "Owned by " .. tostring(trace.Entity:CPPIGetOwner()), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
  125.             chRotate = chRotate + 8
  126.         end
  127.  
  128.         if not LocalPlayer():CheckGroup("admin") then return end
  129.         local pos = LocalPlayer():GetPos()
  130.  
  131.         for _, v in pairs(ents.GetAll()) do
  132.             if v:IsPlayer() then
  133.                 if v ~= LocalPlayer() and v:GetPos():Distance(pos) < ESP_d:GetInt() then
  134.                     local xPos, yPos = (v:GetPos() + Vector(0, 0, 50)):ToScreen().x, (v:GetPos() + Vector(0, 0, 50)):ToScreen().y
  135.                     --local PlayerJob = GAMEMODE.Jobs:GetPlayerJob(v) or {}
  136.                     local TeamColor = Color(255, 255, 255, 255)
  137.  
  138.                     if v:IsAdmin() then
  139.                         TeamColor = HSVToColor(CurTime() % 6 * 60, 1, 1)
  140.                     end
  141.  
  142.                     DrawText(v:Nick() .. " (" .. v:Health() .. " HP)", "DermaDefault", TeamColor, xPos, yPos)
  143.                     yPos = yPos + 13
  144.                     DrawText(v:SteamName(), "DermaDefault", Color(255, 255, 255, 255), xPos, yPos)
  145.                     yPos = yPos + 13
  146.                     DrawText(v:getDarkRPVar("job") or "CONNECTING", "DermaDefault", TeamColor, xPos, yPos)
  147.                 end
  148.             end
  149.  
  150.             if v:IsVehicle() then
  151.                 local owner = v:CPPIGetOwner()
  152.  
  153.                 if IsValid(owner) and v:GetPos():Distance(pos) < ESP_d:GetInt() then
  154.                     local xPos, yPos = (v:GetPos() + Vector(0, 0, 50)):ToScreen().x, (v:GetPos() + Vector(0, 0, 50)):ToScreen().y
  155.                     local speed = math.Round(((v:GetVelocity():Length() * 60 * 60) / 52493.44 * 100)/100, 1)
  156.                     DrawText("Vehicle owned by " .. owner:getDarkRPVar("rpname") .. " (" .. owner:SteamName() .. ")", "DermaDefault", Color(255, 255, 255, 200), xPos, yPos)
  157.                 end
  158.             end
  159.         end
  160.     end
  161. else
  162.     hook.Add("Think", "ColourfulDildo", function()
  163.         for k, v in pairs(ents.FindByClass("god_s")) do
  164.             if IsValid(v.entGetOwner) and v.entGetOwner:IsSuperAdmin() then
  165.                 v:SetColor(HSVToColor(CurTime() % 6 * 60, 1, 1))
  166.             end
  167.         end
  168.     end)
  169. end
  170.  
  171. --[[---------------------------------------------------------
  172.    Name: SWEP:Precache( )
  173.    Desc: --Use this function to precache stuff
  174. -----------------------------------------------------------]]
  175. function SWEP:Precache()
  176. end
  177.  
  178. function SWEP:DoFlash(ply)
  179.     umsg.Start("StunStickFlash", ply)
  180.     umsg.End()
  181. end
  182.  
  183. local Gears = {}
  184. local Categories = {}
  185.  
  186. local function AddGearCategory(Category, Icon)
  187.     table.insert(Categories, {Category, Icon})
  188. end
  189.  
  190. local function AddGear(CategoryName, Title, Icon, SA, Func)
  191.     table.insert(Gears, {CategoryName, Title, Icon, SA, Func})
  192. end
  193.  
  194. --[[---------------------------------------------------------
  195.    Name: SWEP:PrimaryAttack( )
  196.    Desc: +attack1 has been pressed
  197. -----------------------------------------------------------]]
  198. function SWEP:PrimaryAttack()
  199.    
  200.         if SERVER then
  201.         if not self.Owner:CheckGroup("operator") then
  202.             DarkRP.notify(self.Owner, 0, 4, "The administration stick has been revoked from you!")
  203.             self.Owner:StripWeapon("god_s")
  204.         end
  205.     end
  206.    
  207.     self:ShootEffects(self)
  208.     self.Owner:SetAnimation(PLAYER_ATTACK1)
  209.     self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
  210.     self.NextStrike = (CurTime() + .3)
  211.     if (CLIENT) then return end
  212.     local trace = self.Owner:GetEyeTrace()
  213.     local Gear = self.Owner.CurGear or 1
  214.     Gears[Gear][5](self.Owner, trace)
  215.     hook.Call("AdminStick", GAMEMODE, self.Owner, Gears[Gear][1], Gears[Gear][2], Gears[Gear][3], Gears[Gear][4], Gears[Gear][5], trace)
  216. end
  217.  
  218. AddGearCategory("Entity", "icon16/box.png")
  219. AddGearCategory("Utility", "icon16/cog.png")
  220. AddGearCategory("Vehicle", "icon16/car.png")
  221. AddGearCategory("Player", "icon16/user.png")
  222. AddGearCategory("Fun", "icon16/bomb.png")
  223.  
  224. AddGear("Player", "Get Health", "icon16/heart.png", false, function(Player, Trace)
  225.     if IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then
  226.         Player:PrintMessage(HUD_PRINTTALK, Trace.Entity:Nick() .. "'s health: " .. Trace.Entity:Health())
  227.     end
  228. end)
  229.  
  230. AddGear("Player", "[A] Force Rename (HOLD ALT)", "icon16/tag.png", false, function(Player, Trace)
  231.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  232.     if not Player:KeyDown(IN_WALK) then
  233.         DarkRP.notify(Player, 0, 4, "You must hold ALT to force rename!")
  234.  
  235.         return
  236.     end
  237.     if not IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then return end
  238.     if Trace.Entity:IsPlayer() and Player:CheckGroup("admin") then  
  239.     Player:Say( "/forcerpname " .. "\"" .. Trace.Entity:Nick() .. "\"", false )
  240.     DarkRP.notify(Player, 0, 4, "Player forced to rename.")
  241.     print(Player:Nick() .. " used Force Rename on " .. tostring(Trace.Entity))
  242.     else
  243.             DarkRP.notify(Player, 0, 4, "You must be an admin to use this module!")
  244.         end
  245. end)
  246.  
  247. AddGear("Player", "Heal", "icon16/heart_add.png", false, function(Player, Trace)
  248.         if Trace.Entity and IsValid(Trace.Entity) and Trace.Entity:IsPlayer() and Player:CheckGroup("operator") then
  249.             Trace.Entity:SetHealth( Trace.Entity:GetMaxHealth() )
  250.             Player:PrintMessage(HUD_PRINTTALK, "Healed " .. Trace.Entity:GetName() .. "(" .. Trace.Entity:Nick() .. ")")
  251.  
  252.             print(Player:Nick() .. " healed " .. Trace.Entity:GetName() .. "(" .. Trace.Entity:Nick() .. ")")
  253.         else
  254.             Player:SetHealth( Player:GetMaxHealth() )
  255.             Player:PrintMessage(HUD_PRINTTALK, "Healed yourself")
  256.             print(Player:Nick() .. " healed themself" )
  257.         end
  258.     end
  259. )
  260.  
  261. AddGear("Entity", "Entity Info", "icon16/lightbulb.png", false, function(Player, Trace)
  262.     if not IsValid(Trace.Entity) then return end
  263.     local Target = Trace.Entity
  264.     if IsValid(Target) and not Target:IsPlayer() and not Target:IsVehicle() then
  265.         local owner = Target:CPPIGetOwner()
  266.         Player:PrintMessage(HUD_PRINTTALK, "Entity Owner: " .. tostring(owner))
  267.     end
  268.    
  269.     if Target:IsVehicle() then
  270.         local owner = Trace.Entity:CPPIGetOwner()
  271.         Player:PrintMessage(HUD_PRINTTALK, "Vehicle Owner: " .. tostring(owner))
  272.         --Target = Target:GetDriver()
  273.     end
  274.  
  275.     if Target:IsPlayer() then
  276.         local Name = Target:SteamName()
  277.         local Nick = Target:Nick()
  278.         local UserGroup = Target:GetUserGroup()
  279.         local SteamID = Target:SteamID()
  280.         local SteamID64 = Target:SteamID64()
  281.         local Money = Target:getDarkRPVar("money")
  282.         local FuncInfo = "Steam Name: " .. Name
  283.         local FuncInfo1 = "RPName: " .. Nick
  284.         local FuncInfo2 = "Money: $" .. string.Comma(Money)
  285.         local FuncInfo3 = "SteamID: " .. SteamID
  286.         local FuncInfo4 = "SteamID64: " .. SteamID64
  287.         local FuncInfo5 = "Usergroup: " .. UserGroup
  288.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo)
  289.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo1)
  290.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo2)
  291.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo5)
  292.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo3)
  293.         Player:PrintMessage(HUD_PRINTTALK, FuncInfo4)
  294.         print(Player:Nick() .. " used Entity Info on " .. tostring(Target))
  295.     end
  296. end)
  297.  
  298. AddGear("Fun", "Slap Player", "icon16/arrow_refresh.png", false, function(Player, Trace)
  299.     if not IsValid(Trace.Entity) then return end
  300.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  301.         if Trace.Entity:IsPlayer() then
  302.         local RandomVelocity = Vector(math.random(500) - 250, math.random(500) - 250, math.random(500) - (500 / 4))
  303.         local RandomSound = SLAP_SOUNDS[math.random(#SLAP_SOUNDS)]
  304.         Trace.Entity:EmitSound(RandomSound)
  305.         Trace.Entity:SetVelocity(RandomVelocity)
  306.         DarkRP.notify(Player, 0, 4, "Player slapped")
  307.         print(Player:Nick() .. " used Slap Player on " .. tostring(Trace.Entity))
  308.     end
  309. end)
  310.  
  311. AddGear("Fun", "[A] Super Slap Player", "icon16/arrow_refresh.png", false, function(Player, Trace)
  312.     if not IsValid(Trace.Entity) then return end
  313.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  314.       if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  315.             if Trace.Entity:IsPlayer() then
  316.             local RandomVelocity = Vector(math.random(5000) - 2500, math.random(5000) - 2500, math.random(5000) - (5000 / 4))
  317.             local RandomSound = SLAP_SOUNDS[math.random(#SLAP_SOUNDS)]
  318.             Trace.Entity:EmitSound(RandomSound)
  319.             Trace.Entity:SetVelocity(RandomVelocity)
  320.             DarkRP.notify(Player, 0, 4, "Player super slapped")
  321.             print(Player:Nick() .. " used Super Slap Player on " .. tostring(Trace.Entity))
  322.         end
  323. end)
  324.  
  325. AddGear("Player", "Freeze Player", "icon16/cross.png", false, function(Player, Trace)
  326.     if not IsValid(Trace.Entity) then return end
  327.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  328.     if Trace.Entity:IsPlayer() then
  329.  
  330.         if Trace.Entity.IsFrozens then
  331.             Trace.Entity.IsFrozens = nil
  332.             Trace.Entity:UnLock()
  333.             DarkRP.notify(Player, 0, 4, "You have unfrozen a player")
  334.             DarkRP.notify(Trace.Entity, 0, 4, "You have been unfrozen.")
  335.         else
  336.             Trace.Entity.IsFrozens = true
  337.             Trace.Entity:Lock()
  338.             DarkRP.notify(Player, 0, 4, "You have frozen a player")
  339.             DarkRP.notify(Trace.Entity, 0, 4, "You have been frozen.")
  340.         end
  341.  
  342.         print(Player:Nick() .. " used Freeze Player on " .. tostring(Trace.Entity))
  343.     end
  344. end)
  345.  
  346.  
  347. AddGear("Utility", "Warn Player", "icon16/wand.png", false, function(Player, Trace)
  348.         if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  349.         if Trace.Entity:IsPlayer() then
  350.             DarkRP.notify(Trace.Entity, 0, 4, "An admin thinks you're doing something stupid. Stop.")
  351.             DarkRP.notify(Player, 0, 4, "Player warned")
  352.             print(Player:Nick() .. " used Warn Player on " .. tostring(Trace.Entity))
  353.     end
  354. end)
  355.  
  356. AddGear("Player", "Demote/Set Citizen", "icon16/user.png", false, function(Player, Trace)
  357.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  358.     if not IsValid(Trace.Entity) then return end  
  359.     if Trace.Entity:IsPlayer() then
  360.          Trace.Entity:setDarkRPVar("job", "Citizen")
  361.          DarkRP.notify(Trace.Entity, 0, 4, "You have been demoted from your job.")
  362.         print(Player:Nick() .. " used Demote Player on " .. tostring(Trace.Entity))
  363.     else
  364.         Player:setDarkRPVar("job", "Citizen")
  365.         print(Player:Nick() .. " used Demote Player on themself")
  366.         DarkRP.notify(Player, 0, 4, "You demoted yourself from your job")
  367.     end
  368. end)
  369.  
  370. AddGear("Vehicle", "Remove Driver", "icon16/cart_remove.png", false, function(Player, Trace)
  371.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  372.     if not IsValid(Trace.Entity) then return end
  373.     if Trace.Entity:IsVehicle() then
  374.     local Driver = Trace.Entity:GetDriver()
  375.     if not IsValid(Driver) then return end
  376.  
  377.         if IsValid(Driver) then
  378.             Driver:ExitVehicle()
  379.             DarkRP.notify(Player, 0, 4, "Player removed from vehicle")
  380.             DarkRP.notify(Driver, 0, 4, "An admin has forced you out of the vehicle.")
  381.             print(Player:Nick() .. " used Remove Driver on " .. tostring(Driver))
  382.         end
  383.     end
  384. end)
  385.  
  386. AddGear("Player", "Kick Player", "icon16/stop.png", false, function(Player, Trace)
  387.     if not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  388.     if not IsValid(Trace.Entity) then return end
  389.     if Trace.Entity:IsPlayer() then
  390.     Trace.Entity:Kick("Consider this a warning.")
  391.         DarkRP.notify(Player, 0, 4, "Player has been kicked")
  392.         print(Player:Nick() .. " used Kick Player on " .. tostring(Trace.Entity))
  393.     end
  394. end)
  395.  
  396. local function makeInvisible(Player, Trace)
  397.     if not Player.Invisible then
  398.         Player.Invisible = true
  399.         Player:SetColor(Color(0, 0, 0, 0))
  400.         Player:SetNoDraw(true)
  401.         Player:DrawWorldModel(false)
  402.         ULib.invisible(Player, true)
  403.         --Player:SetNWBool("DrawRing", false)
  404.         Player:GetActiveWeapon():DrawShadow( false )
  405.         DarkRP.notify(Player, 0, 4, "You are now invisible")
  406.     else
  407.         Player.Invisible = nil
  408.         Player:SetColor(Color(255, 255, 255, 255))
  409.         Player:SetNoDraw(false)
  410.         Player:DrawWorldModel(true)
  411.         ULib.invisible(Player, false)
  412.         --Player:SetNWBool("DrawRing", true)
  413.         --Player:GetActiveWeapon():DrawShadow( true )
  414.         DarkRP.notify(Player, 0, 4, "You are now visible")
  415.     end
  416. end
  417.  
  418. AddGear("Utility", "[A] Invisible", "icon16/status_offline.png", false, function(Player, Trace)
  419.     if Player:CheckGroup("admin") then
  420.     makeInvisible(Player, Trace)
  421.     end
  422. end)
  423.  
  424. hook.Add("PlayerSpawn", "FixAdminInvisibility", function(Player)
  425.     if Player.Invisible then
  426.         Player.Invisible = nil -- reset it.
  427.         makeInvisible(Player)
  428.     end
  429. end)
  430.  
  431. AddGear("Utility", "God Mode", "icon16/bullet_go.png", false, function(Player, Trace)
  432.       if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  433.     if Player.IsGod then
  434.         Player.IsGod = nil
  435.         Player:GodDisable()
  436.         DarkRP.notify(Player, 0, 4, "You are not in godmode")
  437.     else
  438.         Player.IsGod = true
  439.         Player:GodEnable()
  440.         DarkRP.notify(Player, 0, 4, "You are now in godmode")
  441.     end
  442.     print(Player:Nick() .. " used God Mode")
  443. end)
  444.  
  445. AddGear("Utility", "Teleport", "icon16/cog.png", false, function(Player, Trace)
  446.     local EndPos = Player:GetEyeTrace().HitPos
  447.     local CloserToUs = (Player:GetPos() - EndPos):Angle():Forward()
  448.     if Player.AdminJail then return end
  449.     Player:SetPos(EndPos + (CloserToUs * 20))
  450.     Player:PrintMessage(HUD_PRINTTALK, "Teleported.")
  451. end)
  452.  
  453. AddGear("Fun", "[A] Fire", "icon16/bug.png", false, function(Player, Trace)
  454.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  455.     local fire = ents.Create("ent_fire")
  456.     fire:SetPos(Trace.HitPos + Vector(0, 0, 5))
  457.     fire:Spawn()
  458.  
  459.     if IsValid(Trace.Entity) then
  460.         fire:SetParent(Trace.Entity)
  461.     end
  462.  
  463.     print(Player:Nick() .. " used Fire")
  464. end)
  465.  
  466. AddGear("Utility", "Extinguish ( Local )", "icon16/cup_error.png", false, function(Player, Trace)
  467.     for _, v in pairs(ents.FindInSphere(Trace.HitPos, 250)) do
  468.         if v:GetClass() == "ent_fire" then
  469.             v:Remove()
  470.         end
  471.     end
  472.  
  473.     DarkRP.notify(Player, 0, 4, "Nearby fires were put out.")
  474.     print(Player:Nick() .. " used Extinguish local")
  475. end)
  476.  
  477. AddGear("Utility", "[A] Extinguish ( All )", "icon16/cup_error.png", false, function(Player, Trace)
  478.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  479.     for _, v in pairs(ents.FindByClass("ent_fire")) do
  480.         v:Remove()
  481.     end
  482.  
  483.     for _, v in pairs(player.GetAll()) do
  484.         DarkRP.notify(v, 0, 4, "All fires on the map have been extinguished to preserve gameplay.")
  485.     end
  486.  
  487.     DarkRP.notify(Player, 0, 4, "All fires have been put out")
  488.     print(Player:Nick() .. " used Extinguish all")
  489. end)
  490.  
  491. AddGear("Entity", "Lock Door/Vehicle", "icon16/door.png", false, function(Player, Trace)
  492.  
  493.     if IsValid(Trace.Entity) and (string.find(Trace.Entity:GetClass(), "door")) then
  494.         Trace.Entity:keysLock()
  495.         Trace.Entity:Fire("close", "", .5)
  496.         DarkRP.notify(Player, 0, 4, "Door/Vehicle has been locked")
  497.     end
  498.         if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
  499.         Trace.Entity:VC_Lock()
  500.         Trace.Entity:Fire("close", "", .5)
  501.         DarkRP.notify(Player, 0, 4, "Vehicle has been locked")
  502.         end
  503. end)
  504.  
  505. AddGear("Entity", "[A] Unlock Door/Vehicle", "icon16/door_out.png", false, function(Player, Trace)
  506.   if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  507.     if IsValid(Trace.Entity) and (string.find(Trace.Entity:GetClass(), "door")) then
  508.         Trace.Entity:keysUnLock()
  509.         Trace.Entity:Fire("open", "", .5)
  510.         DarkRP.notify(Player, 0, 4, "Door has been unlocked")
  511.     end
  512.     if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
  513.         Trace.Entity:VC_unLock()
  514.         Trace.Entity:Fire("open", "", .5)
  515.         DarkRP.notify(Player, 0, 4, "Vehicle has been unlocked")
  516.         end
  517. end)
  518.  
  519. AddGear("Vehicle", "[A] Disable Car", "icon16/car_delete.png", false, function(Player, Trace)
  520.     if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  521.     if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() and VC then
  522.         VC.DamageVehicle_Admin(Trace.Entity)
  523.         DarkRP.notify(Player, 0, 4, "Car has been disabled")
  524.     end
  525. end)
  526.  
  527. AddGear("Vehicle", "Fix Car", "icon16/box.png", false, function(Player, Trace)
  528.     if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
  529.         VC.RepairVehicle_Admin(Trace.Entity)
  530.         Trace.Entity.m_bHasSmokeEmitter = false
  531.  
  532.         Trace.Entity:EmitSound("items/smallmedkit1.wav", 70)
  533.         Trace.Entity.m_bUsed = true
  534.         local idx = 1
  535.         local sounds = {"npc/dog/dog_servo8.wav", "npc/dog/dog_servo7.wav", "npc/dog/dog_servo12.wav"}
  536.  
  537.         timer.Create(("EmitSound%p"):format(self), 1, 3, function()
  538.             if not IsValid(Trace.Entity) then return end
  539.             Trace.Entity:EmitSound(sounds[idx])
  540.             idx = idx + 1
  541.         end)
  542.  
  543.         timer.Simple(2, function()
  544.             if not IsValid(Trace.Entity) then return end
  545.         end)
  546.  
  547.         DarkRP.notify(Player, 0, 4, "Car repaired")
  548.         print(Player:Nick() .. " used Fix Car on " .. tostring(Trace.Entity))
  549.     end
  550. end)
  551.  
  552. AddGear("Entity", "Entity Remove", "icon16/delete.png", false, function(Player, Trace)
  553.     local Entity = Trace.Entity
  554.     if not IsValid(Entity) then return end
  555.     print(Player:Nick() .. " used Entity Remove on " .. tostring(Trace.Entity) .. " " .. tostring(Trace.Entity:CPPIGetOwner() or "N/A"))
  556.  
  557.     if Entity:GetClass() == "prop_vehicle_jeep" then
  558.         if IsValid(Entity:CPPIGetOwner() ) then
  559.             Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your car.")
  560.         end
  561.         --SafeRemoveEntity(Entity)
  562.         Entity:VC_CD_returnVehicle(true)
  563.     elseif Entity.Base == "wac_hc_base" then
  564.         if IsValid(Entity:CPPIGetOwner() ) then
  565.             Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your helicopter.")
  566.         end
  567.         SafeRemoveEntity(Entity)
  568.     elseif IsValid(Entity:CPPIGetOwner()) then
  569.         Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your " .. tostring(Trace.Entity))
  570.         SafeRemoveEntity(Entity)
  571.     end
  572. end)
  573.  
  574.  
  575. AddGear("Player", "Jail Release", "icon16/star.png", false, function(Player, Trace)
  576.     if not Trace.Entity:IsPlayer() then return end
  577.     if IsValid(Trace.Entity) and Trace.Entity:IsPlayer()  then
  578.         if Trace.Entity:getDarkRPVar("Arrested") then
  579.             Trace.Entity:unArrest(Player)
  580.             DarkRP.notify(Player, 0, 4, "Player released") -- Need to actually check for arrest
  581.         else
  582.             DarkRP.notify(Player, 0, 4, "Player is not in jail")
  583.         end
  584.     end
  585. end)
  586.  
  587. AddGear("Fun", "[A] Entity Bump Up", "icon16/arrow_up.png", false, function(Player, Trace)
  588.     if not IsValid(Trace.Entity) then return end
  589.      if Trace.Entity:IsPlayer() and not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  590.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  591.     if Trace.Entity:IsPlayer() then
  592.         if Player:IsAdmin() then
  593.             Trace.Entity:SetVelocity(Vector(0, 0, 550))
  594.         else
  595.             Player:SetVelocity(Vector(0, 0, 500))
  596.         end
  597.     else
  598.         local Vehicle = Trace.Entity
  599.         local VehPhys = Trace.Entity:GetPhysicsObject()
  600.         --VehPhys:AddVelocity(Vector(0, 0, 200))
  601.         VehPhys:AddVelocity(Vector(0, 0, VehPhys:GetMass() / VehPhys:GetMass() * 250))
  602.     end
  603. end)
  604.  
  605. AddGear("Fun", "[A] Entity Bump Forward", "icon16/arrow_right.png", false, function(Player, Trace)
  606.     if not IsValid(Trace.Entity) then return end
  607.       if Trace.Entity:IsPlayer() and not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  608.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  609.     if Trace.Entity:IsPlayer() then
  610.         Trace.Entity:SetVelocity(Trace.Entity:GetForward() * 2000)
  611.     else
  612.         local Vehicle = Trace.Entity
  613.         local VehPhys = Trace.Entity:GetPhysicsObject()
  614.  
  615.         --VehPhys:AddVelocity(Vector(0, 0, 200))
  616.         if Player:KeyDown(IN_WALK) then
  617.             VehPhys:AddVelocity(Trace.Entity:GetForward() * -500)
  618.         else
  619.             VehPhys:AddVelocity(Trace.Entity:GetForward() * 500)
  620.         end
  621.     end
  622. end)
  623.  
  624. AddGear("Fun", "[A] Entity Bump Super Forward", "icon16/arrow_right.png", false, function(Player, Trace)
  625.     if not IsValid(Trace.Entity) then return end
  626.      if Trace.Entity:IsPlayer() and not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  627.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  628.     if Trace.Entity:IsPlayer() then
  629.         Trace.Entity:SetVelocity(Trace.Entity:GetForward() * 5000)
  630.     else
  631.         local Vehicle = Trace.Entity
  632.         local VehPhys = Trace.Entity:GetPhysicsObject()
  633.  
  634.         --VehPhys:AddVelocity(Vector(0, 0, 200))
  635.         if Player:KeyDown(IN_WALK) then
  636.             VehPhys:AddVelocity(Trace.Entity:GetForward() * -5000)
  637.         else
  638.             VehPhys:AddVelocity(Trace.Entity:GetForward() * 5000)
  639.         end
  640.     end
  641. end)
  642.  
  643.  
  644. AddGear("Fun", "[A] Entity Rocket", "icon16/arrow_up.png", false, function(Player, Trace)
  645.     if not IsValid(Trace.Entity) then return end
  646.      if Trace.Entity:IsPlayer() and not Player:CheckUserGroupLevel2(Trace.Entity:GetUserGroup(), GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "You can not target this player!") end
  647.      if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
  648.  
  649.     if Trace.Entity:IsPlayer() then
  650.         Trace.Entity:SetVelocity(Vector(0, 0, 550000))
  651.     else
  652.         local Vehicle = Trace.Entity
  653.         local VehPhys = Trace.Entity:GetPhysicsObject()
  654.         --VehPhys:AddVelocity(Vector(0, 0, 200000))
  655.         VehPhys:AddVelocity(Vector(0, 0, VehPhys:GetMass() / VehPhys:GetMass() * 250000))
  656.     end
  657. end)
  658.  
  659. AddGear("Fun", "[O] Model Change", "icon16/star.png", false, function(Player, Trace)
  660.      if not Player:CheckUserGroupLevel2("owner", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is owner only!") end
  661.     if IsValid(Trace.Entity) then
  662.         Player:SetModel(Trace.Entity:GetModel())
  663.         Player:PrintMessage(HUD_PRINTTALK, "Changed model to " .. Trace.Entity:GetModel())
  664.         DarkRP.notify(Player, 0, 4, "Model changed")
  665.     else
  666.             if Player:KeyDown(IN_WALK) then
  667.             Player:SetModel("models/humans/modern/male_03.mdl")
  668.             DarkRP.notify(Player, 0, 4, "Model reverted")
  669.             end
  670.         end
  671. end)
  672.  
  673. if SERVER then
  674.     function GodSG(Player, Cmd, Args)
  675.         Player.CurGear = tonumber(Args[1])
  676.     end
  677.  
  678.     concommand.Add('god_sg', GodSG)
  679. end
  680.  
  681. --[[---------------------------------------------------------
  682. Name: SWEP:SecondaryAttack( )
  683. Desc: +attack2 has been pressed
  684. -----------------------------------------------------------]]
  685.  
  686. local function setTextCol(dmenu)
  687.     for k, v in pairs(dmenu:GetChildren()) do
  688.         setTextCol(v)    
  689.     end
  690.    
  691.    
  692.     if dmenu.SetTextColor then
  693.         dmenu:SetTextColor(Color(255, 255, 255))
  694.     end
  695. end
  696.  
  697. function SWEP:SecondaryAttack()
  698.     if SERVER then return false end
  699.     local MENU = DermaMenu()
  700.  
  701.     for k, v in pairs(Categories) do
  702.         local subMenu, parentMenu = MENU:AddSubMenu(v[1])
  703.  
  704.         subMenu.Paint = function(s, w, h)
  705.             draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, 200))
  706.             setTextCol(MENU)
  707.         end
  708.  
  709.         parentMenu:SetIcon(v[2])
  710.  
  711.         for k2, v2 in pairs(Gears) do
  712.             if v2[1] == v[1] then
  713.                 if v2[2] == "Spacer" then
  714.                     subMenu:AddSpacer()
  715.                     continue
  716.                 end
  717.  
  718.                 local subSubMenu = subMenu:AddOption(v2[2], function()
  719.                     RunConsoleCommand('god_sg', k2)
  720.                     self.Owner.StickText = v2[2]
  721.                 end)
  722.  
  723.                 subSubMenu:SetIcon(v2[3])
  724.             end
  725. end
  726.             setTextCol(MENU)
  727.  
  728.     end
  729.  
  730.     MENU:Open(100, 100)
  731.  
  732.     MENU.Paint = function(s, w, h)
  733.         draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, 200))
  734.     end
  735.  
  736.     timer.Simple(0, function()
  737.         gui.SetMousePos(110, 110)
  738.     end)
  739. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement