So an addon that I'm writing right now uses tables to store channel names, and I have a command that will add another channel to that, but I want to make sure that on a map change or server restart that the channel(s) added aren't removed.
This is what I have in place to make sure of that:
SVC = SVC or {}
SVC.VoiceChannels = SVC.VoiceChannels or { -- The [ key ] is what is connected to, and the "Value" is the name of the actual group.
[ "default" ] = { name="Default", access="user" }, -- Do not change the key in this one, only the value.
[ "dead" ] = { name="Dead", access="user"}, -- Do not change the key in this one, only the value.
[ "english" ] = { name="English", access="user" },
[ "spanish" ] = { name="EspaƱol", access="user" },
[ "admin" ] = { name="Admins", access="operator" }
}
Then, how I add them:
function SVC.AddChannel( calling_ply, channelName, accessKey, opAccess )
SVC.VoiceChannels[accessKey] = { name=channelName, access=opAccess }
end
I have it set to itself or a table, will that work?