Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- if(SERVER) then
- print("Godstick has loaded/updated!")
- end
- if (CLIENT) then
- surface.CreateFont("DermaDefault24", {
- font = "Tahoma", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
- extended = false,
- size = 24,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false
- })
- SWEP.PrintName = "Kadens Stick"
- SWEP.Slot = 0
- SWEP.SlotPos = 4
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = true
- end
- -- Variables that are used on both client and server
- SWEP.Author = "Asriel & Azuraii"
- SWEP.Instructions = "Left click to use, right click to select an option"
- SWEP.Contact = ""
- SWEP.Purpose = ""
- SWEP.ViewModelFOV = 62
- SWEP.ViewModelFlip = false
- SWEP.AnimPrefix = "stunstick"
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = true
- SWEP.NextStrike = 0
- SWEP.ViewModel = "models/weapons/c_stunstick.mdl"
- SWEP.WorldModel = "models/weapons/w_stunstick.mdl"
- SWEP.UseHands = true
- --SWEP.Sound = Sound( "weapons/stunstick/stunstick_swing1.wav" );
- local ShootSound = Sound("defib/defib_shock.wav")
- SWEP.Primary.ClipSize = -1 -- Size of a clip
- SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip
- SWEP.Primary.Automatic = false -- Automatic/Semi Auto
- SWEP.Primary.Ammo = ""
- SWEP.Secondary.ClipSize = -1 -- Size of a clip
- SWEP.Secondary.DefaultClip = 0 -- Default number of bullets in a clip
- SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
- SWEP.Secondary.Ammo = ""
- --[[---------------------------------------------------------
- Name: SWEP:Initialize( )
- Desc: Called when the weapon is first loaded
- -----------------------------------------------------------]]
- function SWEP:Initialize()
- if SERVER then
- self.Gear = 1
- end
- self:SetWeaponHoldType("melee")
- end
- function SWEP:Holster()
- --if not IsFirstTimePredicted() then return end
- if SERVER then
- -- self.Owner:SetNWBool("DrawRing", false)
- end
- return true
- end
- function SWEP:Deploy()
- --if not IsFirstTimePredicted() then return end
- if SERVER then
- if not self.Owner:CheckGroup("operator") then
- DarkRP.notify(self.Owner, 0, 4, "The administration stick has been revoked from you!")
- self.Owner:StripWeapon("god_s")
- end
- end
- return true
- end
- 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"}
- if CLIENT then
- local godstickCrosshair = surface.GetTextureID("godstick/godstick_crosshairv4")
- local chRotate = 0
- local function DrawText(strText, strFont, tblColor, xPos, yPos)
- draw.SimpleTextOutlined(strText, strFont, xPos, yPos, tblColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 1, Color(0, 0, 0, 255))
- end
- local ESP_d = CreateClientConVar("godstick_distance", "6000", true, false)
- function SWEP:DrawHUD()
- local trace = self.Owner:GetEyeTrace()
- local x = (ScrW() / 2)
- local y = (ScrH() / 2)
- surface.SetDrawColor(HSVToColor(CurTime() % 6 * 60, 1, 1))
- surface.SetTexture(godstickCrosshair)
- surface.DrawTexturedRectRotated(x, y, 64, 64, 0 - chRotate)
- local TargetText = "Target: " .. tostring(trace.Entity)
- local OwnerText
- local ModuleNeme = self.Owner
- local ModuleName = ModuleNeme.StickText or "N/A"
- if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
- draw.WordBox(4, x - 150, 10, TargetText, "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- draw.WordBox(4, x - 150, 45, "Steam Name: " .. trace.Entity:SteamName(), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- draw.WordBox(4, x - 150, 80, "Player Name: " .. trace.Entity:Nick(), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- draw.WordBox(4, x - 150, 115, "Player Job: " .. trace.Entity:getDarkRPVar("job"), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- chRotate = chRotate + 8
- end
- if IsValid(trace.Entity) and not trace.Entity:IsPlayer() and trace.Entity:CPPIGetOwner() ~= nil then
- draw.WordBox(4, x - 150, 10, TargetText, "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- draw.WordBox(4, x - 150, 45, "Owned by " .. tostring(trace.Entity:CPPIGetOwner()), "DermaDefault24", Color(22, 22, 22, 240), HSVToColor(CurTime() % 6 * 60, 1, 1))
- chRotate = chRotate + 8
- end
- if not LocalPlayer():CheckGroup("admin") then return end
- local pos = LocalPlayer():GetPos()
- for _, v in pairs(ents.GetAll()) do
- if v:IsPlayer() then
- if v ~= LocalPlayer() and v:GetPos():Distance(pos) < ESP_d:GetInt() then
- local xPos, yPos = (v:GetPos() + Vector(0, 0, 50)):ToScreen().x, (v:GetPos() + Vector(0, 0, 50)):ToScreen().y
- --local PlayerJob = GAMEMODE.Jobs:GetPlayerJob(v) or {}
- local TeamColor = Color(255, 255, 255, 255)
- if v:IsAdmin() then
- TeamColor = HSVToColor(CurTime() % 6 * 60, 1, 1)
- end
- DrawText(v:Nick() .. " (" .. v:Health() .. " HP)", "DermaDefault", TeamColor, xPos, yPos)
- yPos = yPos + 13
- DrawText(v:SteamName(), "DermaDefault", Color(255, 255, 255, 255), xPos, yPos)
- yPos = yPos + 13
- DrawText(v:getDarkRPVar("job") or "CONNECTING", "DermaDefault", TeamColor, xPos, yPos)
- end
- end
- if v:IsVehicle() then
- local owner = v:CPPIGetOwner()
- if IsValid(owner) and v:GetPos():Distance(pos) < ESP_d:GetInt() then
- local xPos, yPos = (v:GetPos() + Vector(0, 0, 50)):ToScreen().x, (v:GetPos() + Vector(0, 0, 50)):ToScreen().y
- local speed = math.Round(((v:GetVelocity():Length() * 60 * 60) / 52493.44 * 100)/100, 1)
- DrawText("Vehicle owned by " .. owner:getDarkRPVar("rpname") .. " (" .. owner:SteamName() .. ")", "DermaDefault", Color(255, 255, 255, 200), xPos, yPos)
- end
- end
- end
- end
- else
- hook.Add("Think", "ColourfulDildo", function()
- for k, v in pairs(ents.FindByClass("god_s")) do
- if IsValid(v.entGetOwner) and v.entGetOwner:IsSuperAdmin() then
- v:SetColor(HSVToColor(CurTime() % 6 * 60, 1, 1))
- end
- end
- end)
- end
- --[[---------------------------------------------------------
- Name: SWEP:Precache( )
- Desc: --Use this function to precache stuff
- -----------------------------------------------------------]]
- function SWEP:Precache()
- end
- function SWEP:DoFlash(ply)
- umsg.Start("StunStickFlash", ply)
- umsg.End()
- end
- local Gears = {}
- local Categories = {}
- local function AddGearCategory(Category, Icon)
- table.insert(Categories, {Category, Icon})
- end
- local function AddGear(CategoryName, Title, Icon, SA, Func)
- table.insert(Gears, {CategoryName, Title, Icon, SA, Func})
- end
- --[[---------------------------------------------------------
- Name: SWEP:PrimaryAttack( )
- Desc: +attack1 has been pressed
- -----------------------------------------------------------]]
- function SWEP:PrimaryAttack()
- if SERVER then
- if not self.Owner:CheckGroup("operator") then
- DarkRP.notify(self.Owner, 0, 4, "The administration stick has been revoked from you!")
- self.Owner:StripWeapon("god_s")
- end
- end
- self:ShootEffects(self)
- self.Owner:SetAnimation(PLAYER_ATTACK1)
- self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
- self.NextStrike = (CurTime() + .3)
- if (CLIENT) then return end
- local trace = self.Owner:GetEyeTrace()
- local Gear = self.Owner.CurGear or 1
- Gears[Gear][5](self.Owner, trace)
- hook.Call("AdminStick", GAMEMODE, self.Owner, Gears[Gear][1], Gears[Gear][2], Gears[Gear][3], Gears[Gear][4], Gears[Gear][5], trace)
- end
- AddGearCategory("Entity", "icon16/box.png")
- AddGearCategory("Utility", "icon16/cog.png")
- AddGearCategory("Vehicle", "icon16/car.png")
- AddGearCategory("Player", "icon16/user.png")
- AddGearCategory("Fun", "icon16/bomb.png")
- AddGear("Player", "Get Health", "icon16/heart.png", false, function(Player, Trace)
- if IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then
- Player:PrintMessage(HUD_PRINTTALK, Trace.Entity:Nick() .. "'s health: " .. Trace.Entity:Health())
- end
- end)
- AddGear("Player", "[A] Force Rename (HOLD ALT)", "icon16/tag.png", false, function(Player, Trace)
- 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
- if not Player:KeyDown(IN_WALK) then
- DarkRP.notify(Player, 0, 4, "You must hold ALT to force rename!")
- return
- end
- if not IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then return end
- if Trace.Entity:IsPlayer() and Player:CheckGroup("admin") then
- Player:Say( "/forcerpname " .. "\"" .. Trace.Entity:Nick() .. "\"", false )
- DarkRP.notify(Player, 0, 4, "Player forced to rename.")
- print(Player:Nick() .. " used Force Rename on " .. tostring(Trace.Entity))
- else
- DarkRP.notify(Player, 0, 4, "You must be an admin to use this module!")
- end
- end)
- AddGear("Player", "Heal", "icon16/heart_add.png", false, function(Player, Trace)
- if Trace.Entity and IsValid(Trace.Entity) and Trace.Entity:IsPlayer() and Player:CheckGroup("operator") then
- Trace.Entity:SetHealth( Trace.Entity:GetMaxHealth() )
- Player:PrintMessage(HUD_PRINTTALK, "Healed " .. Trace.Entity:GetName() .. "(" .. Trace.Entity:Nick() .. ")")
- print(Player:Nick() .. " healed " .. Trace.Entity:GetName() .. "(" .. Trace.Entity:Nick() .. ")")
- else
- Player:SetHealth( Player:GetMaxHealth() )
- Player:PrintMessage(HUD_PRINTTALK, "Healed yourself")
- print(Player:Nick() .. " healed themself" )
- end
- end
- )
- AddGear("Entity", "Entity Info", "icon16/lightbulb.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- local Target = Trace.Entity
- if IsValid(Target) and not Target:IsPlayer() and not Target:IsVehicle() then
- local owner = Target:CPPIGetOwner()
- Player:PrintMessage(HUD_PRINTTALK, "Entity Owner: " .. tostring(owner))
- end
- if Target:IsVehicle() then
- local owner = Trace.Entity:CPPIGetOwner()
- Player:PrintMessage(HUD_PRINTTALK, "Vehicle Owner: " .. tostring(owner))
- --Target = Target:GetDriver()
- end
- if Target:IsPlayer() then
- local Name = Target:SteamName()
- local Nick = Target:Nick()
- local UserGroup = Target:GetUserGroup()
- local SteamID = Target:SteamID()
- local SteamID64 = Target:SteamID64()
- local Money = Target:getDarkRPVar("money")
- local FuncInfo = "Steam Name: " .. Name
- local FuncInfo1 = "RPName: " .. Nick
- local FuncInfo2 = "Money: $" .. string.Comma(Money)
- local FuncInfo3 = "SteamID: " .. SteamID
- local FuncInfo4 = "SteamID64: " .. SteamID64
- local FuncInfo5 = "Usergroup: " .. UserGroup
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo)
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo1)
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo2)
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo5)
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo3)
- Player:PrintMessage(HUD_PRINTTALK, FuncInfo4)
- print(Player:Nick() .. " used Entity Info on " .. tostring(Target))
- end
- end)
- AddGear("Fun", "Slap Player", "icon16/arrow_refresh.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if Trace.Entity:IsPlayer() then
- local RandomVelocity = Vector(math.random(500) - 250, math.random(500) - 250, math.random(500) - (500 / 4))
- local RandomSound = SLAP_SOUNDS[math.random(#SLAP_SOUNDS)]
- Trace.Entity:EmitSound(RandomSound)
- Trace.Entity:SetVelocity(RandomVelocity)
- DarkRP.notify(Player, 0, 4, "Player slapped")
- print(Player:Nick() .. " used Slap Player on " .. tostring(Trace.Entity))
- end
- end)
- AddGear("Fun", "[A] Super Slap Player", "icon16/arrow_refresh.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Trace.Entity:IsPlayer() then
- local RandomVelocity = Vector(math.random(5000) - 2500, math.random(5000) - 2500, math.random(5000) - (5000 / 4))
- local RandomSound = SLAP_SOUNDS[math.random(#SLAP_SOUNDS)]
- Trace.Entity:EmitSound(RandomSound)
- Trace.Entity:SetVelocity(RandomVelocity)
- DarkRP.notify(Player, 0, 4, "Player super slapped")
- print(Player:Nick() .. " used Super Slap Player on " .. tostring(Trace.Entity))
- end
- end)
- AddGear("Player", "Freeze Player", "icon16/cross.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if Trace.Entity:IsPlayer() then
- if Trace.Entity.IsFrozens then
- Trace.Entity.IsFrozens = nil
- Trace.Entity:UnLock()
- DarkRP.notify(Player, 0, 4, "You have unfrozen a player")
- DarkRP.notify(Trace.Entity, 0, 4, "You have been unfrozen.")
- else
- Trace.Entity.IsFrozens = true
- Trace.Entity:Lock()
- DarkRP.notify(Player, 0, 4, "You have frozen a player")
- DarkRP.notify(Trace.Entity, 0, 4, "You have been frozen.")
- end
- print(Player:Nick() .. " used Freeze Player on " .. tostring(Trace.Entity))
- end
- end)
- AddGear("Utility", "Warn Player", "icon16/wand.png", false, function(Player, Trace)
- 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
- if Trace.Entity:IsPlayer() then
- DarkRP.notify(Trace.Entity, 0, 4, "An admin thinks you're doing something stupid. Stop.")
- DarkRP.notify(Player, 0, 4, "Player warned")
- print(Player:Nick() .. " used Warn Player on " .. tostring(Trace.Entity))
- end
- end)
- AddGear("Player", "Demote/Set Citizen", "icon16/user.png", false, function(Player, Trace)
- 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
- if not IsValid(Trace.Entity) then return end
- if Trace.Entity:IsPlayer() then
- Trace.Entity:setDarkRPVar("job", "Citizen")
- DarkRP.notify(Trace.Entity, 0, 4, "You have been demoted from your job.")
- print(Player:Nick() .. " used Demote Player on " .. tostring(Trace.Entity))
- else
- Player:setDarkRPVar("job", "Citizen")
- print(Player:Nick() .. " used Demote Player on themself")
- DarkRP.notify(Player, 0, 4, "You demoted yourself from your job")
- end
- end)
- AddGear("Vehicle", "Remove Driver", "icon16/cart_remove.png", false, function(Player, Trace)
- 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
- if not IsValid(Trace.Entity) then return end
- if Trace.Entity:IsVehicle() then
- local Driver = Trace.Entity:GetDriver()
- if not IsValid(Driver) then return end
- if IsValid(Driver) then
- Driver:ExitVehicle()
- DarkRP.notify(Player, 0, 4, "Player removed from vehicle")
- DarkRP.notify(Driver, 0, 4, "An admin has forced you out of the vehicle.")
- print(Player:Nick() .. " used Remove Driver on " .. tostring(Driver))
- end
- end
- end)
- AddGear("Player", "Kick Player", "icon16/stop.png", false, function(Player, Trace)
- 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
- if not IsValid(Trace.Entity) then return end
- if Trace.Entity:IsPlayer() then
- Trace.Entity:Kick("Consider this a warning.")
- DarkRP.notify(Player, 0, 4, "Player has been kicked")
- print(Player:Nick() .. " used Kick Player on " .. tostring(Trace.Entity))
- end
- end)
- local function makeInvisible(Player, Trace)
- if not Player.Invisible then
- Player.Invisible = true
- Player:SetColor(Color(0, 0, 0, 0))
- Player:SetNoDraw(true)
- Player:DrawWorldModel(false)
- ULib.invisible(Player, true)
- --Player:SetNWBool("DrawRing", false)
- Player:GetActiveWeapon():DrawShadow( false )
- DarkRP.notify(Player, 0, 4, "You are now invisible")
- else
- Player.Invisible = nil
- Player:SetColor(Color(255, 255, 255, 255))
- Player:SetNoDraw(false)
- Player:DrawWorldModel(true)
- ULib.invisible(Player, false)
- --Player:SetNWBool("DrawRing", true)
- --Player:GetActiveWeapon():DrawShadow( true )
- DarkRP.notify(Player, 0, 4, "You are now visible")
- end
- end
- AddGear("Utility", "[A] Invisible", "icon16/status_offline.png", false, function(Player, Trace)
- if Player:CheckGroup("admin") then
- makeInvisible(Player, Trace)
- end
- end)
- hook.Add("PlayerSpawn", "FixAdminInvisibility", function(Player)
- if Player.Invisible then
- Player.Invisible = nil -- reset it.
- makeInvisible(Player)
- end
- end)
- AddGear("Utility", "God Mode", "icon16/bullet_go.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Player.IsGod then
- Player.IsGod = nil
- Player:GodDisable()
- DarkRP.notify(Player, 0, 4, "You are not in godmode")
- else
- Player.IsGod = true
- Player:GodEnable()
- DarkRP.notify(Player, 0, 4, "You are now in godmode")
- end
- print(Player:Nick() .. " used God Mode")
- end)
- AddGear("Utility", "Teleport", "icon16/cog.png", false, function(Player, Trace)
- local EndPos = Player:GetEyeTrace().HitPos
- local CloserToUs = (Player:GetPos() - EndPos):Angle():Forward()
- if Player.AdminJail then return end
- Player:SetPos(EndPos + (CloserToUs * 20))
- Player:PrintMessage(HUD_PRINTTALK, "Teleported.")
- end)
- AddGear("Fun", "[A] Fire", "icon16/bug.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- local fire = ents.Create("ent_fire")
- fire:SetPos(Trace.HitPos + Vector(0, 0, 5))
- fire:Spawn()
- if IsValid(Trace.Entity) then
- fire:SetParent(Trace.Entity)
- end
- print(Player:Nick() .. " used Fire")
- end)
- AddGear("Utility", "Extinguish ( Local )", "icon16/cup_error.png", false, function(Player, Trace)
- for _, v in pairs(ents.FindInSphere(Trace.HitPos, 250)) do
- if v:GetClass() == "ent_fire" then
- v:Remove()
- end
- end
- DarkRP.notify(Player, 0, 4, "Nearby fires were put out.")
- print(Player:Nick() .. " used Extinguish local")
- end)
- AddGear("Utility", "[A] Extinguish ( All )", "icon16/cup_error.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- for _, v in pairs(ents.FindByClass("ent_fire")) do
- v:Remove()
- end
- for _, v in pairs(player.GetAll()) do
- DarkRP.notify(v, 0, 4, "All fires on the map have been extinguished to preserve gameplay.")
- end
- DarkRP.notify(Player, 0, 4, "All fires have been put out")
- print(Player:Nick() .. " used Extinguish all")
- end)
- AddGear("Entity", "Lock Door/Vehicle", "icon16/door.png", false, function(Player, Trace)
- if IsValid(Trace.Entity) and (string.find(Trace.Entity:GetClass(), "door")) then
- Trace.Entity:keysLock()
- Trace.Entity:Fire("close", "", .5)
- DarkRP.notify(Player, 0, 4, "Door/Vehicle has been locked")
- end
- if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
- Trace.Entity:VC_Lock()
- Trace.Entity:Fire("close", "", .5)
- DarkRP.notify(Player, 0, 4, "Vehicle has been locked")
- end
- end)
- AddGear("Entity", "[A] Unlock Door/Vehicle", "icon16/door_out.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if IsValid(Trace.Entity) and (string.find(Trace.Entity:GetClass(), "door")) then
- Trace.Entity:keysUnLock()
- Trace.Entity:Fire("open", "", .5)
- DarkRP.notify(Player, 0, 4, "Door has been unlocked")
- end
- if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
- Trace.Entity:VC_unLock()
- Trace.Entity:Fire("open", "", .5)
- DarkRP.notify(Player, 0, 4, "Vehicle has been unlocked")
- end
- end)
- AddGear("Vehicle", "[A] Disable Car", "icon16/car_delete.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() and VC then
- VC.DamageVehicle_Admin(Trace.Entity)
- DarkRP.notify(Player, 0, 4, "Car has been disabled")
- end
- end)
- AddGear("Vehicle", "Fix Car", "icon16/box.png", false, function(Player, Trace)
- if IsValid(Trace.Entity) and Trace.Entity:IsVehicle() then
- VC.RepairVehicle_Admin(Trace.Entity)
- Trace.Entity.m_bHasSmokeEmitter = false
- Trace.Entity:EmitSound("items/smallmedkit1.wav", 70)
- Trace.Entity.m_bUsed = true
- local idx = 1
- local sounds = {"npc/dog/dog_servo8.wav", "npc/dog/dog_servo7.wav", "npc/dog/dog_servo12.wav"}
- timer.Create(("EmitSound%p"):format(self), 1, 3, function()
- if not IsValid(Trace.Entity) then return end
- Trace.Entity:EmitSound(sounds[idx])
- idx = idx + 1
- end)
- timer.Simple(2, function()
- if not IsValid(Trace.Entity) then return end
- end)
- DarkRP.notify(Player, 0, 4, "Car repaired")
- print(Player:Nick() .. " used Fix Car on " .. tostring(Trace.Entity))
- end
- end)
- AddGear("Entity", "Entity Remove", "icon16/delete.png", false, function(Player, Trace)
- local Entity = Trace.Entity
- if not IsValid(Entity) then return end
- print(Player:Nick() .. " used Entity Remove on " .. tostring(Trace.Entity) .. " " .. tostring(Trace.Entity:CPPIGetOwner() or "N/A"))
- if Entity:GetClass() == "prop_vehicle_jeep" then
- if IsValid(Entity:CPPIGetOwner() ) then
- Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your car.")
- end
- --SafeRemoveEntity(Entity)
- Entity:VC_CD_returnVehicle(true)
- elseif Entity.Base == "wac_hc_base" then
- if IsValid(Entity:CPPIGetOwner() ) then
- Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your helicopter.")
- end
- SafeRemoveEntity(Entity)
- elseif IsValid(Entity:CPPIGetOwner()) then
- Entity:CPPIGetOwner():PrintMessage(HUD_PRINTTALK, "A Staff member has removed your " .. tostring(Trace.Entity))
- SafeRemoveEntity(Entity)
- end
- end)
- AddGear("Player", "Jail Release", "icon16/star.png", false, function(Player, Trace)
- if not Trace.Entity:IsPlayer() then return end
- if IsValid(Trace.Entity) and Trace.Entity:IsPlayer() then
- if Trace.Entity:getDarkRPVar("Arrested") then
- Trace.Entity:unArrest(Player)
- DarkRP.notify(Player, 0, 4, "Player released") -- Need to actually check for arrest
- else
- DarkRP.notify(Player, 0, 4, "Player is not in jail")
- end
- end
- end)
- AddGear("Fun", "[A] Entity Bump Up", "icon16/arrow_up.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Trace.Entity:IsPlayer() then
- if Player:IsAdmin() then
- Trace.Entity:SetVelocity(Vector(0, 0, 550))
- else
- Player:SetVelocity(Vector(0, 0, 500))
- end
- else
- local Vehicle = Trace.Entity
- local VehPhys = Trace.Entity:GetPhysicsObject()
- --VehPhys:AddVelocity(Vector(0, 0, 200))
- VehPhys:AddVelocity(Vector(0, 0, VehPhys:GetMass() / VehPhys:GetMass() * 250))
- end
- end)
- AddGear("Fun", "[A] Entity Bump Forward", "icon16/arrow_right.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Trace.Entity:IsPlayer() then
- Trace.Entity:SetVelocity(Trace.Entity:GetForward() * 2000)
- else
- local Vehicle = Trace.Entity
- local VehPhys = Trace.Entity:GetPhysicsObject()
- --VehPhys:AddVelocity(Vector(0, 0, 200))
- if Player:KeyDown(IN_WALK) then
- VehPhys:AddVelocity(Trace.Entity:GetForward() * -500)
- else
- VehPhys:AddVelocity(Trace.Entity:GetForward() * 500)
- end
- end
- end)
- AddGear("Fun", "[A] Entity Bump Super Forward", "icon16/arrow_right.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Trace.Entity:IsPlayer() then
- Trace.Entity:SetVelocity(Trace.Entity:GetForward() * 5000)
- else
- local Vehicle = Trace.Entity
- local VehPhys = Trace.Entity:GetPhysicsObject()
- --VehPhys:AddVelocity(Vector(0, 0, 200))
- if Player:KeyDown(IN_WALK) then
- VehPhys:AddVelocity(Trace.Entity:GetForward() * -5000)
- else
- VehPhys:AddVelocity(Trace.Entity:GetForward() * 5000)
- end
- end
- end)
- AddGear("Fun", "[A] Entity Rocket", "icon16/arrow_up.png", false, function(Player, Trace)
- if not IsValid(Trace.Entity) then return end
- 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
- if not Player:CheckUserGroupLevel2("admin", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is admin only!") end
- if Trace.Entity:IsPlayer() then
- Trace.Entity:SetVelocity(Vector(0, 0, 550000))
- else
- local Vehicle = Trace.Entity
- local VehPhys = Trace.Entity:GetPhysicsObject()
- --VehPhys:AddVelocity(Vector(0, 0, 200000))
- VehPhys:AddVelocity(Vector(0, 0, VehPhys:GetMass() / VehPhys:GetMass() * 250000))
- end
- end)
- AddGear("Fun", "[O] Model Change", "icon16/star.png", false, function(Player, Trace)
- if not Player:CheckUserGroupLevel2("owner", GREATER_THAN_OR_EQUAL) then return DarkRP.notify(Player, 0, 4, "This module is owner only!") end
- if IsValid(Trace.Entity) then
- Player:SetModel(Trace.Entity:GetModel())
- Player:PrintMessage(HUD_PRINTTALK, "Changed model to " .. Trace.Entity:GetModel())
- DarkRP.notify(Player, 0, 4, "Model changed")
- else
- if Player:KeyDown(IN_WALK) then
- Player:SetModel("models/humans/modern/male_03.mdl")
- DarkRP.notify(Player, 0, 4, "Model reverted")
- end
- end
- end)
- if SERVER then
- function GodSG(Player, Cmd, Args)
- Player.CurGear = tonumber(Args[1])
- end
- concommand.Add('god_sg', GodSG)
- end
- --[[---------------------------------------------------------
- Name: SWEP:SecondaryAttack( )
- Desc: +attack2 has been pressed
- -----------------------------------------------------------]]
- local function setTextCol(dmenu)
- for k, v in pairs(dmenu:GetChildren()) do
- setTextCol(v)
- end
- if dmenu.SetTextColor then
- dmenu:SetTextColor(Color(255, 255, 255))
- end
- end
- function SWEP:SecondaryAttack()
- if SERVER then return false end
- local MENU = DermaMenu()
- for k, v in pairs(Categories) do
- local subMenu, parentMenu = MENU:AddSubMenu(v[1])
- subMenu.Paint = function(s, w, h)
- draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, 200))
- setTextCol(MENU)
- end
- parentMenu:SetIcon(v[2])
- for k2, v2 in pairs(Gears) do
- if v2[1] == v[1] then
- if v2[2] == "Spacer" then
- subMenu:AddSpacer()
- continue
- end
- local subSubMenu = subMenu:AddOption(v2[2], function()
- RunConsoleCommand('god_sg', k2)
- self.Owner.StickText = v2[2]
- end)
- subSubMenu:SetIcon(v2[3])
- end
- end
- setTextCol(MENU)
- end
- MENU:Open(100, 100)
- MENU.Paint = function(s, w, h)
- draw.RoundedBox(0, 0, 0, w, h, Color(0, 0, 0, 200))
- end
- timer.Simple(0, function()
- gui.SetMousePos(110, 110)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement