Configuration

1. Configuration config.lua

If you want players to be able to delete their character, set true, if you want them to see a notify about going to the administration for delete a character, set false

Config.CanDelete = true -- true / false

Configure the weather system so that the character preview has the weather you want

Config.WeatherSync = "vSync" -- "cd_easytime", "vSync"
Config.Weather = 'EXTRASUNNY' -- weather type

If you use a custom character creator for e.g. vms_charcreator, set this option to true, if you want to use the default one from esx_skin, fivem-appearance or illenium-appearance, set it to false

Config.UseCustomSkinCreator = false -- if you use esx_skin / fivem-appearance for character creator set it to false, if you use custom character creator set it to true and change in @vms_multichars/config/config_client.lua function openCharacterCreator(skin)

This moves the player into their own virtual world which also removes any collisions between players

Config.UseRoutingBuckets = true

By default the coordinates are set on top of Diamond Casino, if you don't have a server started with build that extended of Diamond Casino DLC, you won't be able to select a character, you need to change coordinates or add a set new server build

Config.ToLeft = vector3(919.61, -295.44, 64.73) -- This coords is on the Diamond Casino, if you didnt have build with this, its not works, you need to change the coords
Config.Spawn = vector4(917.4, -293.36, 64.63, 280.76) -- This coords is on the Diamond Casino, if you didnt have build with this, its not works, you need to change the coords
Config.FromRight = vector3(917.7, -291.62, 64.63) -- This coords is on the Diamond Casino, if you didnt have build with this, its not works, you need to change the coords

If you have changed the player's position you can also change the camera height to match the new coordinates

Config.CameraHeightPoint = 1.5 -- + 1.5
Config.CameraHeight = 0.5
Config.CameraForward = 1.0

You can change the coordinates where the player will spawn after creating a new character but if you are using a custom character creator, you need to change the respawn coordinates in the char creator script

Config.SpawnLocation = vec(1071.86, -711.57, 873.45) -- here you can set the coordinates in which the player will spawn after creating a character ! IMPORTANT, if you use Config.UseCustomSkinCreator, it won't work, you need to set in charcreator e.g. vms_charcreator !

Here you set whether players will be able to change characters during the game on the coordinates you set, if you don't want it set enable = false

Config.ChangeCharacterPoint = {
	enable = true,
	coords = vector3(-1045.07, -2750.11, 21.36),
	marker = {
		id = 2, 
		rgba = {255, 215, 25, 100}, 
		size = vec(0.75, 0.75, 0.75), 
		rotate = true
	},
	blip = {
		sprite = 480, 
		color = 2, 
		scale = 1.0, 
		name = "Character Selector"
	},
}

2. Configuration config_client.lua

If you use a custom character creator than vms_charcreator here you can add a trigger/export to open it

openCharacterCreator = function(skin, gender)
    TriggerEvent('skinchanger:loadSkin', skin, function()
        ResetEntityAlpha(PlayerPedId())
        SetPedAoBlobRendering(PlayerPedId(), true)
        if not Config.UseCustomSkinCreator then
            TriggerEvent('esx_skin:openSaveableMenu', function()
                finished = true 
            end, function() 
                finished = true
            end)
        else
            TriggerEvent('vms_charcreator:openCreator', gender)
        end
    end)
end

If you are using a different identity than vms_identity you can change the trigger to open it here

openIdentity = function()
    TriggerEvent('vms_identity:showRegisterIdentity')
end

If you are using vms_spawnselector or other spawnselector, you can enter your event here

openSpawnSelector = function()
    TriggerEvent('vms_spawnselector:open')
end

3. Open config_server.lua

You can set the default count of slots a player has. Remember that the administrator can also assign a custom number of slots to a player on the identifier with the command

Config.Slots = 5

If you have a non-standard database, and more specifically a users table with an identifier column you need change this

Config.UsersDatabase = {users = 'identifier'} -- {table = column}

You can change the prefix that will be saved in the database by default it is char

Config.Prefix = 'char'

Check what player identifier you use in your server, if you use steam hex set "steam", if you use identifier as R* license set "license"

Config.Identifier = "license" -- this is the identifier you use in the users table, if you use R* license set "license", if steam set "steam"

Using the options below, you can set the starting items and money for the player

Config.EnableStarterItems = false
Config.StarterItems = {
    {name = 'bread', count = 15},
    {name = 'water', count = 15},
}

Config.EnableStarterMoney = false
Config.StarterMoney = {
    {account = 'cash', amount = 1000},
    {account = 'bank', amount = 5000},
}

4. Open config_commands.lua

Adjust the command to delete characters, add missing tables from which data assigned to the player ID is to be removed

ESX.RegisterCommand('deletecharacter', 'admin', function(xPlayer, args, showError)
    MySQL.update("DELETE FROM `users` WHERE identifier = ?", {args.identifier})
    MySQL.update("DELETE FROM `owned_vehicles` WHERE owner = ?", {args.identifier})
    MySQL.update("DELETE FROM `user_licenses` WHERE owner = ?", {args.identifier})
    MySQL.update("DELETE FROM `datastore_data` WHERE owner = ?", {args.identifier})
    -- Here you can add more tables that you want it to delete when deleting a character.
    
    xPlayer.triggerEvent('vms_multichars:notification', (Config.Translate['cmd.success_deleted_character']):format(args.identifier), 5500, 'success')
end, true, {help = Config.Translate['cmd.help_deletecharacter'], validate = true, arguments = {
	{name = 'identifier', help = Config.Translate['cmd.help_identifier'], type = 'string'},
}})

Last updated