DarkRP - Derma AddOption

I trying to make job chaging in derma menu

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

This code doesn’t work fine

I believe your RunConsoleCommand should be

RunConsoleCommand(“rp_”…v.Command, k)

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: