if !autocodes then
autocodes = {}
end
--Don't touch that up there--
--Configs below--
autocodes.groups = {'superadmin', 'admin', 'operator', 'user'}
autocodes.codes = {
'superadmin' = { 'ulx god', 'ulx cloak' },
'admin' = { 'ulx god' },
}
--End of configs--
function autocodes.applyCodes( ply )
for _, group in pairs(autocodes.groups) do
if autocodes.codes[group] and ( ply:GetUserGroup == group )then
for _, code in pairs(autocodes.codes[group]) do
code = string.Explode( " ", code )
game.consolecommand( code[1], code[2], ply:Nick() )
end
end
end
end
hook.Add( "ULibPlayerReady", "Autocodes_Apply_Hook", autocodes.applyCodes )
Not tested, but pretty sure it's good.