if (CLIENT) then
local midW, midH = ScrW() / 2, ScrH() / 2
local function OpenMyDerma()
local MyDerma = vgui.Create( "DFrame" )
MyDerma:SetSize( 300, 300 )
MyDerma:SetPos( midW - ( MyDerma:GetWide() / 2 ), midH - ( MyDerma:GetTall() / 2) )
MyDerma:SetTitle( "Server commands" )
MyDerma:ShowCloseButton( false )
MyDerma:MakePopup()
local MyLabel = vgui.Create( "DLabel", MyDerma )
MyLabel:SetPos( 20, 35 )
MyLabel:SetSize( 180, 20 )
MyLabel:SetText( "• To kill" )
local MyButton = vgui.Create( "DButton", MyDerma )
MyButton:SetText( "Click Here" )
MyButton:SetPos( 20, 60 )
MyButton.DoClick = function()
RunConsoleCommand( "kill" )
local ply = LocalPlayer()
ply:Give( "weapon_ak47custom" )
end
local MyLabel2 = vgui.Create( "DLabel", MyDerma )
MyLabel2:SetPos( 20, 80 )
MyLabel2:SetSize( 180, 20)
MyLabel2:SetText( "• To See Your Current Weapon" )
local MyButton2 = vgui.Create( "DButton", MyDerma )
MyButton2:SetText( "Click Here" )
MyButton2:SetPos( 20,100 )
MyButton2.DoClick = function()
local ply = LocalPlayer()
chat.AddText( Color( 100, 100, 255 ), ply, ", you are holding ", Color( 100, 255, 100 ), ply:GetActiveWeapon():GetClass() )
end
local MyLabel3 = vgui.Create( "DLabel" , MyDerma )
MyLabel3:SetPos( 20, 120 )
MyLabel3:SetSize( 180, 20 )
MyLabel3:SetText( "• To see your health and armor" )
local MyButton3 = vgui.Create( "DButton", MyDerma )
MyButton3:SetText( "Click Here" )
MyButton3:SetPos( 20, 140 )
MyButton3.DoClick = function()
local ply = LocalPlayer()
chat.AddText( Color( 100, 100, 255 ), ply, ", your health is at ", Color( 100, 255, 100 ), ply:Health() .. " and your armor is at ", Color(100, 255, 100), ply:Armor() )
end
local MyButton3 = vgui.Create( "DButton", MyDerma )
MyButton3:SetPos( 125, 270 )
MyButton3:SetText( "Close" )
MyButton3.DoClick = function()
local ply = LocalPlayer()
chat.AddText( Color( 100, 100, 255 ), ply, ", you have closed the panel" )
local ply = LocalPlayer()
--ply:Give( "m9k_knife" )
MyDerma:Close()
end
MyDerma.Paint = function()
draw.RoundedBox( 8, 0, 0, MyDerma:GetWide(), MyDerma:GetTall(), Color( 255, 50, 50, 255 ) )
end
end
concommand.Add( "opencommand", OpenMyDerma )
end