Hey, I'm making my own single player quick admin menu. So when people need a mini admin mod to control players they got my quick admin and my problem is with is. When i join a game and i try run my admin menu with the console command but never works. Gives me nothing. Can someone please tell me what I'm doing wrong?
Quick admin path folders:
Quick Admin
Quick Admin/lua
Quick Admin/lua/autorun
Quick Admin/lua/autorun/server
Quick Admin/lua/autorun/server/quickadmin.lua
Quick Admin/lua/autorun/client
Quick Admin/lua/autorun/client/adminmenu.lua
Quick Admin/info.txt
-----------------
adminmenu.lua: [url]http://pastebin.com/r6G4iRvd[/url]
quickadmin.lua: [url]http://pastebin.com/AYifj2r7[/url]
info.txt: [url]http://pastebin.com/apRVxkv6[/url]
Thank you for helping I would really like it if you tried.
Does that folder have a space in it? If so, change it to an underscore.
Or I'm completely wrong, and I'm an idiot.
just put it it lua/autorun and do
[lua]
if SERVER then
AddCSLuaFile("quickadmin.lua")
else
function adminmenu()
local Admin = vgui.Create( "DFrame" )
Admin:SetPos( ScrW()*0.32, ScrH()*0.30 )
Admin:SetSize( 450, 300 )
Admin:SetTitle( "Basic Admin Menu" )
Admin:SetVisible( true )
Admin:SetDraggable( false )
Admin:ShowCloseButton( true )
Admin:MakePopup()
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( Admin )
PropertySheet:SetPos( 5, 25 )
PropertySheet:SetSize( 440, 270 )
local PanelOne = vgui.Create( "DPanel" )
local PanelTwo = vgui.Create( "DPanel" )
--[[local BanList = vgui.Create("DComboBox", PanelTwo)
BanList:SetPos(5, 5)
BanList:SetSize(105, PropertySheet:GetTall()-45)
BanList:SetMultiple( false )]]
local ComboBox = vgui.Create("DComboBox", PanelOne)
ComboBox:SetPos(5, 5)
ComboBox:SetSize(105, PropertySheet:GetTall()-45)
ComboBox:SetMultiple( false )
for k,v in pairs(player.GetAll()) do
ComboBox:AddItem(v:Nick())
end
local ComboBox2 = vgui.Create("DComboBox", PanelOne)
ComboBox2:SetPos(109, 5)
ComboBox2:SetSize(25, PropertySheet:GetTall()-45)
ComboBox2:SetMultiple( false )
for k,v in pairs(player.GetAll()) do
ComboBox2:AddItem(v:UserID())
end
local Selection = vgui.Create( "DPanel", PanelOne )
Selection:SetPos( 150, 5 )
Selection:SetSize( PropertySheet:GetWide(), PropertySheet:GetTall() )
Selection.Paint = function()
draw.RoundedBox( 0, 0, 0, PropertySheet:GetWide() - 150, PropertySheet:GetTall() - 35, Color( 50, 50, 50, 255 ) )
if ComboBox:GetSelectedItems() and ComboBox:GetSelectedItems()[1] then
draw.SimpleText( "Selection: "..ComboBox:GetSelectedItems()[1]:GetValue(), "Default", 5, 5, Color( 255, 255, 255, 255 ) )
end
end
local kbutton = vgui.Create( "DButton", Selection )
kbutton:SetSize( 100, 30 )
kbutton:SetPos( 5, 30 )
kbutton:SetText( "Kick" )
kbutton.DoClick = function( button )
RunConsoleCommand( unpack( string.Explode( " ", "kick "..ComboBox:GetSelectedItems()[1]:GetValue() ) ) )
end
local bbutton = vgui.Create( "DButton", Selection )
bbutton:SetSize( 100, 30 )
bbutton:SetPos( 5, 65 )
bbutton:SetText( "Ban Player" )
bbutton.DoClick = function( button )
local punishment = DermaMenu()
punishment:AddOption("1 Hour", function()
RunConsoleCommand( "banid2", "60", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for one hour." )
Admin:SetVisible( false )
end )
punishment:AddOption("2 Hours", function()
RunConsoleCommand( "banid2", "120", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for one hour." )
Admin:SetVisible( false )
end )
punishment:AddOption("12 Hours", function()
RunConsoleCommand( "banid2", "600", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for one hour." )
Admin:SetVisible( false )
end )
punishment:AddOption("1 Day", function()
RunConsoleCommand( "banid2", "1440", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for one day." )
Admin:SetVisible( false )
for k,v in pairs(player.GetAll()) do
BanList:AddItem(ComboBox2:GetSelectedItems()[1]:GetValue())
end
end )
punishment:AddOption("2 Days", function()
RunConsoleCommand( "banid2", "2880", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for two days." )
Admin:SetVisible( false )
for k,v in pairs(player.GetAll()) do
BanList:AddItem(ComboBox2:GetSelectedItems()[1]:GetValue())
end
end )
punishment:AddOption("3 Days", function()
RunConsoleCommand( "banid2", "3400", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for three days." )
Admin:SetVisible( false )
for k,v in pairs(player.GetAll()) do
BanList:AddItem(ComboBox2:GetSelectedItems()[1]:GetValue())
end
end )
punishment:AddOption("1 week", function()
RunConsoleCommand( "banid2", "10080", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for 1 week." )
Admin:SetVisible( false )
for k,v in pairs(player.GetAll()) do
BanList:AddItem(ComboBox2:GetSelectedItems()[1]:GetValue())
end
end )
punishment:AddOption("Forever", function()
RunConsoleCommand( "banid2", "0", ComboBox2:GetSelectedItems()[1]:GetValue() )
RunConsoleCommand( "kickid2", ComboBox2:GetSelectedItems()[1]:GetValue(), "Banned for ever." )
Admin:SetVisible( false )
for k,v in pairs(player.GetAll()) do
BanList:AddItem(ComboBox2:GetSelectedItems()[1]:GetValue())
end
end )
punishment:Open()
end
dlistview.OnRowSelected = function(self, row)
local confirmation = DermaMenu()
confirmation:AddOption("Kick?", function()
RunConsoleCommand( "kick", self:GetLine(row):GetValue(1) )
end )
confirmation:Open()
end
local sbutton = vgui.Create( "DButton", Selection )
sbutton:SetSize( 100, 30 )
sbutton:SetPos( 5, 95 )
sbutton:SetText( "Slap Player" )
sbutton.DoClick = function( button )
RunConsoleCommand( unpack( string.Explode( " ", "slap "..ComboBox:GetSelectedItems()[1]:GetValue() ) ) )
DermaPanel:Close()
end
local Sbutton = vgui.Create( "DButton", Selection )
Sbutton:SetSize( 100, 30 )
Sbutton:SetPos( 5, 125 )
Sbutton:SetText( "Slap Player" )
Sbutton.DoClick = function( button )
RunConsoleCommand( unpack( string.Explode( " ", "slay "..ComboBox:GetSelectedItems()[1]:GetValue() ) ) )
DermaPanel:Close()
end
local Nbutton = vgui.Create( "DButton", Selection )
Nbutton:SetSize( 100, 30 )
Nbutton:SetPos( 5, 155 )
Nbutton:SetText( "Noclip Player" )
Nbutton.DoClick = function( button )
RunConsoleCommand( unpack( string.Explode( " ", "noclip "..ComboBox:GetSelectedItems()[1]:GetValue() ) ) )
DermaPanel:Close()
end
local Fbutton = vgui.Create( "DButton", Selection )
Fbutton:SetSize( 100, 30 )
Fbutton:SetPos( 5, 185 )
Fbutton:SetText( "Freeze Player" )
Fbutton.DoClick = function( button )
RunConsoleCommand( unpack( string.Explode( " ", "freeze "..ComboBox:GetSelectedItems()[1]:GetValue() ) ) )
DermaPanel:Close()
end
end
PropertySheet:AddSheet( "Basic Administration", PanelOne, "gui/silkicons/shield_add", false, false, "Kick, Ban, Etc" )
-------------------------------------------------- --------------------------------------------------
-------------------------------------------------- --------------------------------------------------
-------------------------------------------------- --------------------------------------------------
end
end
concommand.Add("Quickadmin", adminmenu)[/lua]
and make the file name quickadmin.lua, try that.
[QUOTE=c-unit;26538622]just put it it lua/autorun and do
[lua]
blah[/lua]
and make the file name quickadmin.lua, try that.[/QUOTE]
So thats what you spent your last 3 hours doing lol.
[QUOTE=zzaacckk;26539990]So thats what you spent your last 3 hours doing lol.[/QUOTE]
lol -_-, sorry I forgot to get back to you.
Thank you c-unit.
Did that work?
[QUOTE=c-unit;26552816]Did that work?[/QUOTE]
No, he thanked you because it didn't work.
I tested it never worked.
Don't mean i have to test it first. Then reply thank you.
You forgot to mention that you took some of that code out of my quickhud addon >.>
It's not "your own", technically it's mine and you edited it, lol.
I would fix it for you, but since you didn't credit me you're on your own.
also, [B]you copied the out dated version[/B] >.>
>.<
I might fix it as an early christmas present today. :P
I kinda edit the whole thing. Also no need to give me a dump.
You changed a few variables and took what was already there to add more to the code without giving me credit. >.>
[QUOTE=Jova;26623569]You changed a few variables and took what was already there to add more to the code without giving me credit. >.>[/QUOTE]
I did give credit :D
where -.-?
Sorry, you need to Log In to post a reply to this thread.