Well, I am getting an error.
[code]
autorun/SuperAdminMenu.lua:80: 'end' expected (to close 'do' at line 78) near 'else'
[/code]
But if I put an end rate after that statement then I am closing it, but can't I close them at the end of the code? Do I really have the end it rate there? If I end it there then I have to end the 'for' and the 'if' statements.
Here is the code if you want to look it over, also I don't know if v:Group works but I am just sticking it there for now.
[lua]/*-------------------------------------------------------------------------------------------
Made by --D.A.R.K-- [url]http://www.187ciclan.com[/url] Super Administration Menu
Command Information:
1) Can use Rcon Commands through a Text Box
2) Telepor yourself to a player
3) Turn your Tag on and Off to show go undercover
More updates to come
*/-------------------------------------------------------------------------------------------
if ( SERVER ) then
AddCSLuaFile("autorun/SuperAdminMenu.lua")
else
include("autorun/SuperAdminMenu.lua")
function SuperAdministratorMenu( ply )
local SMenuFrame = vgui.Create("DFrame")
SMenuFrame:SetSize( 0 )
SMenuFrame:SetPos( 0 , 0 )
SMenuFrame:SetTitle(" ")
SMenuFrame:SetVisible( true )
SMenuFrame:SetDraggable( false )
SMenuFrame:ShowCloseButton( true )
SMenuFrame:MakePopup()
SMenuFrame.Paint = function()
surface.SetDrawColor( 50, 50, 100, 175 )
surface.DrawRect( 0, 0, DermaPanel:GetWide(), DermaPanel:GetTall() )
draw.SimpleText("SuperAdministration Menu", "ScoreboardText", 5, 5, Color(4,255,255,255))
end
SDermaSheet = vgui.Create( "DPropertySheet" )
SDermaSheet:SetParent( DermaPanel )
SDermaSheet:SetPos( 40, 50 )
SDermaSheet:SetSize( 525, 500 )
SDermaSheet.Paint = function()
surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, 200, 50 )
end
RconCmdList = vgui.Create( "DListView" )
RconCmd = vgui.Create("DTextEntry", RconCmdList)
RconCmd:SetPos( 5 , 50 )
RconCmd:SetSize( 250, 25 )
RconCmd:SetText("<Command Here>")
RconCmd.OnEnter = function()
end
Submit = vgui.Create("DButton", Frame)
Submit:SetPos(155, 170)
Submit:SetSize(50, 25)
Submit:SetText("Submit")
Submit.DoClick = function ()
RunConsoleCommand("myrcon" , table.concat(string.Explode(" " , tostring(RconCmd:GetValue())) , ","))
end
concommand.Add("myrcon" , function(ply , cmd, args)
if !ply:IsSuperAdmin() then return end
game.ConsoleCommand(args[1].."\n")
end )
Players = vgui.Create("DListView")
Players:SetPos(25, 50)
Players:SetSize(500, 400)
Players:SetMultiSelect( false )
Players:AddColumn("Name")
Players:AddColumn("Group")
for k,v in pairs(player.GetAll()) do
ply:IsSuperAdmin() do
Players:AddLine(v:Nick(),v:Group())
else if
ply:IsAdmin then
Players:AddLine(v:Nick(),v:Group())
end
concommand.Add("SMenuFrame" , function( ply )
if !ply:IsSuperAdmin() then return
end )
DermaSheet:AddSheet( "Rcon", RconCmdList, "gui/silkicons/newspaper", false, false, "Run Rcon Commands" )
DermaSheet:AddSheet( "View Active Admins", Players, "gui/silkicons/user", false, false, "View Active Admins" )
end
end
[/lua]
[QUOTE=Justin37111;18123534]Well, I am getting an error.
[code]
autorun/SuperAdminMenu.lua:80: 'end' expected (to close 'do' at line 78) near 'else'
[/code]
But if I put an end rate after that statement then I am closing it, but can't I close them at the end of the code? Do I really have the end it rate there? If I end it there then I have to end the 'for' and the 'if' statements.
Here is the code if you want to look it over, also I don't know if v:Group works but I am just sticking it there for now.
[lua]/*-------------------------------------------------------------------------------------------
Made by --D.A.R.K-- [url]http://www.187ciclan.com[/url] Super Administration Menu
Command Information:
1) Can use Rcon Commands through a Text Box
2) Telepor yourself to a player
3) Turn your Tag on and Off to show go undercover
More updates to come
*/-------------------------------------------------------------------------------------------
if ( SERVER ) then
AddCSLuaFile("autorun/SuperAdminMenu.lua")
else
include("autorun/SuperAdminMenu.lua")
function SuperAdministratorMenu( ply )
local SMenuFrame = vgui.Create("DFrame")
SMenuFrame:SetSize( 0 )
SMenuFrame:SetPos( 0 , 0 )
SMenuFrame:SetTitle(" ")
SMenuFrame:SetVisible( true )
SMenuFrame:SetDraggable( false )
SMenuFrame:ShowCloseButton( true )
SMenuFrame:MakePopup()
SMenuFrame.Paint = function()
surface.SetDrawColor( 50, 50, 100, 175 )
surface.DrawRect( 0, 0, DermaPanel:GetWide(), DermaPanel:GetTall() )
draw.SimpleText("SuperAdministration Menu", "ScoreboardText", 5, 5, Color(4,255,255,255))
end
SDermaSheet = vgui.Create( "DPropertySheet" )
SDermaSheet:SetParent( DermaPanel )
SDermaSheet:SetPos( 40, 50 )
SDermaSheet:SetSize( 525, 500 )
SDermaSheet.Paint = function()
surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, 200, 50 )
end
concommand.Add("SuperDermaOpen", function( ply )
if !ply:IsSuperAdmin() then return
end
RconCmdList = vgui.Create( "DListView" )
RconCmd = vgui.Create("DTextEntry", RconCmdList)
RconCmd:SetPos( 5 , 50 )
RconCmd:SetSize( 250, 25 )
RconCmd:SetText("<Command Here>")
RconCmd.OnEnter = function()
end
Submit = vgui.Create("DButton", Frame)
Submit:SetPos(155, 170)
Submit:SetSize(50, 25)
Submit:SetText("Submit")
Submit.DoClick = function ()
RunConsoleCommand("myrcon" , table.concat(string.Explode(" " , tostring(RconCmd:GetValue())) , ","))
end
concommand.Add("myrcon" , function(ply , cmd, args)
if !ply:IsSuperAdmin() then return end
game.ConsoleCommand(args[1].."\n")
end )
Players = vgui.Create("DListView")
Players:SetPos(25, 50)
Players:SetSize(500, 400)
Players:SetMultiSelect( false )
Players:AddColumn("Name")
Players:AddColumn("Group")
for k,v in pairs(player.GetAll()) do
ply:IsSuperAdmin() do
Players:AddLine(v:Nick(),v:Group())
else if
ply:IsAdmin then
Players:AddLine(v:Nick(),v:Group())
end
concommand.Add("SMenuFrame" , SMenuFrame)
DermaSheet:AddSheet( "Rcon", RconCmdList, "gui/silkicons/newspaper", false, false, "Run Rcon Commands" )
DermaSheet:AddSheet( "View Active Admins", Players, "gui/silkicons/user", false, false, "View Active Admins" )
end
end[/lua]
Also if there are mistakes in the code sorry as in closing the statements at the end, etc. I'm not done with the code but that should work after the ends are put in but I am just curious why they have to be closed there.[/QUOTE]
[lua] else if [/lua]
[lua] elseif [/lua]
Rofl, I am still editing it in the post and you posted. Also why elseif instead of else if, shouldn't their be spaces?
[editline]03:05AM[/editline]
Also my question again, why do I have to close it at that exact line?
[lua]
autorun/SuperAdminMenu.lua:76: 'end' expected (to close 'do' at line 74) near 'elseif'
[/lua]
[editline]03:06AM[/editline]
All of the space on here doesn't match up to mine so the lines are off.
[QUOTE=Justin37111;18123567]Rofl, I am still editing it in the post and you posted. Also why elseif instead of else if, shouldn't their be spaces?
[editline]03:05AM[/editline]
Also my question again, why do I have to close it at that exact line?
[lua]
autorun/SuperAdminMenu.lua:76: 'end' expected (to close 'do' at line 74) near 'elseif'
[/lua]
[editline]03:06AM[/editline]
All of the space on here doesn't match up to mine so the lines are off.[/QUOTE]
[lua]/*-------------------------------------------------------------------------------------------
Made by --D.A.R.K-- [url]http://www.187ciclan.com[/url] Super Administration Menu
Command Information:
1) Can use Rcon Commands through a Text Box
2) Telepor yourself to a player
3) Turn your Tag on and Off to show go undercover
More updates to come
*/-------------------------------------------------------------------------------------------
if ( SERVER ) then
AddCSLuaFile("autorun/SuperAdminMenu.lua")
else
include("autorun/SuperAdminMenu.lua")
function SuperAdministratorMenu( ply )
local SMenuFrame = vgui.Create("DFrame")
SMenuFrame:SetSize( 0 )
SMenuFrame:SetPos( 0 , 0 )
SMenuFrame:SetTitle(" ")
SMenuFrame:SetVisible( true )
SMenuFrame:SetDraggable( false )
SMenuFrame:ShowCloseButton( true )
SMenuFrame:MakePopup()
SMenuFrame.Paint = function()
surface.SetDrawColor( 50, 50, 100, 175 )
surface.DrawRect( 0, 0, DermaPanel:GetWide(), DermaPanel:GetTall() )
draw.SimpleText("SuperAdministration Menu", "ScoreboardText", 5, 5, Color(4,255,255,255))
end
SDermaSheet = vgui.Create( "DPropertySheet" )
SDermaSheet:SetParent( DermaPanel )
SDermaSheet:SetPos( 40, 50 )
SDermaSheet:SetSize( 525, 500 )
SDermaSheet.Paint = function()
surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, 200, 50 )
end
concommand.Add("SuperDermaOpen", function( ply )
if !ply:IsSuperAdmin() then return
end
end
RconCmdList = vgui.Create( "DListView" )
RconCmd = vgui.Create("DTextEntry", RconCmdList)
RconCmd:SetPos( 5 , 50 )
RconCmd:SetSize( 250, 25 )
RconCmd:SetText("<Command Here>")
RconCmd.OnEnter = function()
end
Submit = vgui.Create("DButton", Frame)
Submit:SetPos(155, 170)
Submit:SetSize(50, 25)
Submit:SetText("Submit")
Submit.DoClick = function ()
RunConsoleCommand("myrcon" , table.concat(string.Explode(" " , tostring(RconCmd:GetValue())) , ","))
end
concommand.Add("myrcon" , function(ply , cmd, args)
if !ply:IsSuperAdmin() then return end
game.ConsoleCommand(args[1].."\n")
end )
Players = vgui.Create("DListView")
Players:SetPos(25, 50)
Players:SetSize(500, 400)
Players:SetMultiSelect( false )
Players:AddColumn("Name")
Players:AddColumn("Group")
for k,v in pairs(player.GetAll()) do
ply:IsSuperAdmin() do
Players:AddLine(v:Nick(),v:Group())
elseif ply:IsAdmin then
Players:AddLine(v:Nick(),v:Group())
end
concommand.Add("SMenuFrame" , SMenuFrame)
DermaSheet:AddSheet( "Rcon", RconCmdList, "gui/silkicons/newspaper", false, false, "Run Rcon Commands" )
DermaSheet:AddSheet( "View Active Admins", Players, "gui/silkicons/user", false, false, "View Active Admins" )
end
end
end[/lua]
[QUOTE=octogon;18123829][lua]/*-------------------------------------------------------------------------------------------
Made by --D.A.R.K-- [url]http://www.187ciclan.com[/url] Super Administration Menu
Command Information:
1) Can use Rcon Commands through a Text Box
2) Telepor yourself to a player
3) Turn your Tag on and Off to show go undercover
More updates to come
*/-------------------------------------------------------------------------------------------
if ( SERVER ) then
AddCSLuaFile("autorun/SuperAdminMenu.lua")
else
include("autorun/SuperAdminMenu.lua")
function SuperAdministratorMenu( ply )
local SMenuFrame = vgui.Create("DFrame")
SMenuFrame:SetSize( 0 )
SMenuFrame:SetPos( 0 , 0 )
SMenuFrame:SetTitle(" ")
SMenuFrame:SetVisible( true )
SMenuFrame:SetDraggable( false )
SMenuFrame:ShowCloseButton( true )
SMenuFrame:MakePopup()
SMenuFrame.Paint = function()
surface.SetDrawColor( 50, 50, 100, 175 )
surface.DrawRect( 0, 0, DermaPanel:GetWide(), DermaPanel:GetTall() )
draw.SimpleText("SuperAdministration Menu", "ScoreboardText", 5, 5, Color(4,255,255,255))
end
SDermaSheet = vgui.Create( "DPropertySheet" )
SDermaSheet:SetParent( DermaPanel )
SDermaSheet:SetPos( 40, 50 )
SDermaSheet:SetSize( 525, 500 )
SDermaSheet.Paint = function()
surface.SetDrawColor( 0, 0, 0, 0 )
surface.DrawRect( 0, 0, 200, 50 )
end
concommand.Add("SuperDermaOpen", function( ply )
if !ply:IsSuperAdmin() then return
end
end
RconCmdList = vgui.Create( "DListView" )
RconCmd = vgui.Create("DTextEntry", RconCmdList)
RconCmd:SetPos( 5 , 50 )
RconCmd:SetSize( 250, 25 )
RconCmd:SetText("<Command Here>")
RconCmd.OnEnter = function()
end
Submit = vgui.Create("DButton", Frame)
Submit:SetPos(155, 170)
Submit:SetSize(50, 25)
Submit:SetText("Submit")
Submit.DoClick = function ()
RunConsoleCommand("myrcon" , table.concat(string.Explode(" " , tostring(RconCmd:GetValue())) , ","))
end
concommand.Add("myrcon" , function(ply , cmd, args)
if !ply:IsSuperAdmin() then return end
game.ConsoleCommand(args[1].."\n")
end )
Players = vgui.Create("DListView")
Players:SetPos(25, 50)
Players:SetSize(500, 400)
Players:SetMultiSelect( false )
Players:AddColumn("Name")
Players:AddColumn("Group")
for k,v in pairs(player.GetAll()) do
ply:IsSuperAdmin() do
Players:AddLine(v:Nick(),v:Group())
elseif ply:IsAdmin then
Players:AddLine(v:Nick(),v:Group())
end
concommand.Add("SMenuFrame" , SMenuFrame)
DermaSheet:AddSheet( "Rcon", RconCmdList, "gui/silkicons/newspaper", false, false, "Run Rcon Commands" )
DermaSheet:AddSheet( "View Active Admins", Players, "gui/silkicons/user", false, false, "View Active Admins" )
end
end
end[/lua][/QUOTE]
[code]
autorun/SuperAdminMenu.lua:50: unexpected symbol near '='
[/code] I don't see anything wrong with that line
local RconCmd = vgui.Create("DTextEntry", RconCmdList)
[QUOTE=Justin37111;18124126][code]
autorun/SuperAdminMenu.lua:50: unexpected symbol near '='
[/code] I don't see anything wrong with that line[/QUOTE]
The error is on line 46. It should be "end )" rather than just "end".
It was that but the error I get tells me to change it
[lua]
ply:IsAdmin then
[/lua]
Should be
[lua]ply:IsAdmin() then
[/lua]
Line 81
I already changed that in the updated one, I'll post it in a bit but I am busy rate now.
Sorry, you need to Log In to post a reply to this thread.