> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/assets/vms_multichars/configuration-files/config.commands.lua.md).

# config.commands.lua

Preview File Updated: v2.0.0 - 22.08.2026

```lua
-- THIS COMMAND IS FOR USE ONLY THROUGH THE CONSOLE OR THROUGH THE TEBEX API
RegisterCommand("addslots", function(source, args)
    if (source ~= 0) then
		return
	end
	
	local identifier = string.gsub(args[1], ("%s:"):format(SV.Identifier), "")

	MySQL.Async.fetchAll('SELECT slots FROM multichars_slots WHERE identifier = ?', {identifier}, function(result)
		if result[1] then
			MySQL.update('UPDATE `multichars_slots` SET `slots` = ? WHERE `identifier` = ?', {result[1].slots + tonumber(args[2]), identifier})
		else
			MySQL.update('INSERT INTO `multichars_slots` (`identifier`, `slots`) VALUES (?, ?)', {identifier, Config.DefaultSlots + tonumber(args[2])})
		end
	end)
end, false)



----------------------------------- ▄▀▀ ▄▀▄ █▄ ▄█ █▄ ▄█ ▄▀▄ █▄ █ █▀▄ ▄▀▀ ------------------------------------
----------------------------------- ▀▄▄ ▀▄▀ █ ▀ █ █ ▀ █ █▀█ █ ▀█ █▄▀ ▄██ ------------------------------------
CreateThread(function()
	if Config.Commands['DeleteCharacter']?.Enabled then
		local cmd = Config.Commands['DeleteCharacter']
		
		SV.RegisterCommand(cmd.Name, cmd.Groups, function(src, args)
            local identifier = args.identifier or args?[1]

			local success = DeleteCharacter(identifier)
			if success then
				TriggerClientEvent('vms_multichars:notification', src, {
					type = 'success',
					message = TRANSLATE('notify.success_deleted_character', identifier),
					time = 5500
				})
			end
        end, cmd.Help, cmd.Suggestions)
	end

	if Config.Commands['SetSlots']?.Enabled then
		local cmd = Config.Commands['SetSlots']
		
		SV.RegisterCommand(cmd.Name, cmd.Groups, function(src, args)
            local identifier = args.identifier or args?[1]
            local slots = args.slots or args?[2]

			MySQL.Async.fetchAll('SELECT slots FROM multichars_slots WHERE identifier = ?', {identifier}, function(result)
				if result[1] then
					MySQL.update('UPDATE `multichars_slots` SET `slots` = ? WHERE `identifier` = ?', {slots, identifier})
					
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'success',
						message = TRANSLATE('notify.slots_edited', slots, identifier),
						time = 5500
					})
				else
					MySQL.update('INSERT INTO `multichars_slots` (`identifier`, `slots`) VALUES (?, ?)', {identifier, slots})
					
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'success',
						message = TRANSLATE('notify.slots_added', slots, identifier),
						time = 5500
					})
				end
			end)
        end, cmd.Help, cmd.Suggestions)
	end
	
	if Config.Commands['RemoveSlots']?.Enabled then
		local cmd = Config.Commands['RemoveSlots']
		
		SV.RegisterCommand(cmd.Name, cmd.Groups, function(src, args)
            local identifier = args.identifier or args?[1]

			MySQL.Async.fetchAll('SELECT slots FROM multichars_slots WHERE identifier = ?', {identifier}, function(result)
				if result[1] then
					MySQL.update('DELETE FROM `multichars_slots` WHERE `identifier` = ?', {identifier})

					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'success',
						message = TRANSLATE('notify.slots_removed', identifier),
						time = 5500
					})
				end
			end)
        end, cmd.Help, cmd.Suggestions)
	end

	if Config.Commands['EnableCharacter']?.Enabled then
		local cmd = Config.Commands['EnableCharacter']
		
		SV.RegisterCommand(cmd.Name, cmd.Groups, function(src, args)
            local identifier = args.identifier or args?[1]

			MySQL.update('UPDATE `users` SET `disabled` = 0 WHERE identifier = ?', {identifier}, function(result)
				if result > 0 then
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'success',
						message = TRANSLATE('notify.char_enabled', identifier),
						time = 5500
					})
				else
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'error',
						message = TRANSLATE('notify.char_not_found', identifier),
						time = 5500
					})
				end
			end)
        end, cmd.Help, cmd.Suggestions)
	end

	if Config.Commands['DisableCharacter']?.Enabled then
		local cmd = Config.Commands['DisableCharacter']
		
		SV.RegisterCommand(cmd.Name, cmd.Groups, function(src, args)
            local identifier = args.identifier or args?[1]

			MySQL.update('UPDATE `users` SET `disabled` = 1 WHERE identifier = ?', {identifier}, function(result)
				if result > 0 then
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'success',
						message = TRANSLATE('notify.char_disabled', identifier),
						time = 5500
					})
				else
					TriggerClientEvent('vms_multichars:notification', src, {
						type = 'error',
						message = TRANSLATE('notify.char_not_found', identifier),
						time = 5500
					})
				end
			end)
        end, cmd.Help, cmd.Suggestions)
	end
end)
```
