Automatically Run Commands

Hey, I need help with some LUA.

I got an admin mod on my server called Citrus.
Everytime the server restarts, it doesn’t enable the plugins I want so I have to do it manually.

Is there a way I can make something in LUA that it would automatically do this everytime the server starts/restarts?

Thanks.

[lua]local commands = {
“command_1”,
“command_2 args go here”
}

hook.Add(“InitPostEntity”,“CitrusCommands”,function()
for _,v in pairs(commands) do game.ConsoleCommand(v) end
end)[/lua]

Yeah.

I need 2 commands, the commands are

citrus load “Entity Limits”
and
citrus load “Restrict Tools”

Thanks.

[lua]
local commands = {
“citrus load ‘Entity Limits’”,
“citrus load ‘Restrict Tools’”
}[/lua]

and i put this in autorun/server right?

Thanks.

Well?

Yes you do but couldnt you have tested it instead of waiting 16 hours for someone to reply?

Indeed.

I done the following code.

[lua]
local commands = {
“citrus load ‘Entity Limits’”,
“citrus load ‘Restrict Tools’”
}

hook.Add(“InitPostEntity”,“CitrusCommands”,function()
for _,v in pairs(commands) do game.ConsoleCommand(v) end
end)
[/lua]

And I get the following errors in console.
Error, bad server command citrus load ‘Entity Limits’
Error, bad server command citrus load ‘Restrict Tools’

Read this: http://wiki.garrysmod.com/?title=Game.ConsoleCommand (append an
)

Example:
[lua]game.ConsoleCommand("say Cake
")[/lua]

[lua]local commands = {
"citrus load ‘Entity Limits’
",
"citrus load ‘Restrict Tools’
"
}

hook.Add(“InitPostEntity”,“CitrusCommands”,function()
for _,v in pairs(commands) do game.ConsoleCommand(v) end
end)
[/lua]

Sup with them?

I assume he wants ‘Entity Limits’ to be counted as one argument. Not sure if that will work though.

It will work fine, “text wdjkadawd” is counted as one argument in Lua.