DarkRP - Derma AddOption

I trying to make job chaging in derma menu

[LUA]
for k,v in pairs(team.GetAllTeams()) do
jobs:AddOption(v.Name, function() RunConsoleCommand(“rp_”, v.Command, " ", k) end)
end
[/LUA]

This code doesn’t work fine

I believe your RunConsoleCommand should be

[LUA]
RunConsoleCommand(“rp_”…v.Command, k)
[/LUA]

as RunConsoleCommand uses inputs as the Command, then the table of arguments.

The equivalent console command to what you have is
( where Command = “asdf” and k = “qwerty”)

“rp_ asdf k”

You are right! Thanks :downs: