[RELEASE][ESX] KASHacters Multi Character

esx
characters

#43

I don’t know if you’re using default esx_identity but with the clean esx_identity it will start the registration form automatically when there is no firstname, lastname etc yet for a player


#44

yeah but what he mean is when we hit the ui box to make a new mp character nothing pops up

edit when you hit the blank ui box hit the play it will load you in with a new mp


#45

when i join the server i have this screen


#47

Nevermind, i didn’t see the full instalion of it. Me bad


#48

UI could do with some more work :man_shrugging: quiet basic if you ask me.


#50

@KASH

What would I need to edit to change the number of characters you have. My esx_identity is modified to a six character limit rather than three.

When I load into the game, it only sees my last three characters.


#51

@Chip_W_Gaming You can just edit the UI to make it to 6 characters no problem :stuck_out_tongue:


#52

I’ll give it a shot


#53

Fantastic job! Just pulled my version of the multi character due so many bugs I couldnt run down but this is working flawlessly so far! THANKS!!


#54

So, I have it allowing the 6 characters. I assumed that it pulled from the character table. I was wrong. No biggie, easy enough to recreate names. When I connect, I can select my first character without a problem. However, I’m unable to create any other ones. Clicking on the boxes does nothing.


#55

Ok, figured that out for anyone that gets confused by this. When you click on an empty character box, the play button shows up under the first box. Just press it.


#56

.Here for those having trouble with jsfour-atm. here is the fix
Go to the server.lua and change the code From

-- Get money
ESX.RegisterServerCallback('jsfour-atm:getMoney', function(source, cb)
  local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)
  local data = {
    bank = xPlayer.getAccount('bank').money,
    cash = xPlayer.getMoney()
  }
  cb(data)
end)

to

-- Get money
ESX.RegisterServerCallback('jsfour-atm:getMoney', function(source, cb)
  local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)
	if xPlayer ~= nil then
  local data = {
    bank = xPlayer.getAccount('bank').money,
    cash = xPlayer.getMoney()
  }
  cb(data)
  end
end)

Thanks took the code from KASH that he posted few post above.


#57

anyone got the problem were you can see the menu but cant click on anything or see your mouse cursor?


#58

rename the resource to esx_kashacters


#59

i already did that


#60

Then follow the readme carefully do everything he says.


#61

i did the comment out thing ive uploaded the SQL file and edited the tables and when i get in game i can see the menu but i cant click on anything


#62

How to install instruction.

  • Download the resource
  • Rename the resource to esx_kashacters
  • import the sql file in your database
  • Go to essentialmode\client\main.lua and edit/comment the code.
--[[Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if NetworkIsSessionStarted() then
			TriggerServerEvent('es:firstJoinProper')
			TriggerEvent('es:allowedToSpawn')
			return
		end
	end
end)]]--
  • Now we edit the table and add all our identifier to make sure our character loads.
  • Edit the code in esx_kashacters\server\main.lua
local IdentifierTables = {
    {table = "addon_account_data", column = "owner"},
	{table = "addon_inventory_items", column = "owner"},
    {table = "billing", column = "identifier"},
	{table = "characters", column = "identifier"},
	{table = "datastore_data", column = "owner"},
	{table = "owned_vehicles", column = "owner"},
	{table = "rented_vehicles", column = "owner"},
	{table = "society_moneywash", column = "identifier"},
	{table = "users", column = "identifier"},
    {table = "user_accounts", column = "identifier"},
	{table = "user_inventory", column = "identifier"},
	{table = "user_licenses", column = "owner"},
}

To get your identifier.
Do this query in your database

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'columnNameHere'

Replace columnNameHere with owner then redo it with identifier
Credit @Xnubil for this query line

The table list provided is just an example. Yours may difer depending on what you install on your server.

Once You’ve done all that. add start esx_kashacters to your server.cfg and then start your server.
If it’s not working you can try clearing your cache. Now when the ui pops in. You see 4 square. If you click on one then the play or delete show on the left. Okay hope this helps you guys get this awesome script going on your server.

@KASH maybe you can add this to the op :slight_smile:

Fix for esx_ambulancejob Credit to @OfficialRobin for this fix

Open esx_ambulancejob/client/main.lua
Find

AddEventHandler('playerSpawned', function()
	IsDead = false

	if FirstSpawn then
		exports.spawnmanager:setAutoSpawn(false) -- disable respawn
		FirstSpawn = false

		ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
			if isDead and Config.AntiCombatLog then
				while not PlayerLoaded do
					Citizen.Wait(1000)
				end

				ESX.ShowNotification(_U('combatlog_message'))
				RemoveItemsAfterRPDeath()
			end
		end)
	end
end)

and just under the last end)
add

RegisterNetEvent('esx_ambulancejob:multicharacter')
AddEventHandler('esx_ambulancejob:multicharacter', function()
	IsDead = false

	if FirstSpawn then
		exports.spawnmanager:setAutoSpawn(false) -- disable respawn
		FirstSpawn = false

		ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(isDead)
			if isDead and Config.AntiCombatLog then
				while not PlayerLoaded do
					Citizen.Wait(1000)
				end

				ESX.ShowNotification(_U('combatlog_message'))
				RemoveItemsAfterRPDeath()
			end
		end)
	end
end)

Then go to esx_kashacters/client/main.lua
Find

RegisterNetEvent('kashactersC:SpawnCharacter')
AddEventHandler('kashactersC:SpawnCharacter', function(spawn)
    TriggerServerEvent('es:firstJoinProper')
    TriggerEvent('es:allowedToSpawn')
    SetTimecycleModifier('default')
    local pos = spawn
    SetEntityCoords(GetPlayerPed(-1), pos.x, pos.y, pos.z)
    DoScreenFadeIn(500)
    Citizen.Wait(500)
    cam2 = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -1355.93,-1487.78,520.75, 300.00,0.00,0.00, 100.00, false, 0)
    PointCamAtCoord(cam2, pos.x,pos.y,pos.z+200)
    SetCamActiveWithInterp(cam2, cam, 900, true, true)
    Citizen.Wait(900)
    cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", pos.x,pos.y,pos.z+200, 300.00,0.00,0.00, 100.00, false, 0)
    PointCamAtCoord(cam, pos.x,pos.y,pos.z+2)
    SetCamActiveWithInterp(cam, cam2, 3700, true, true)
    Citizen.Wait(3700)
    PlaySoundFrontend(-1, "Zoom_Out", "DLC_HEIST_PLANNING_BOARD_SOUNDS", 1)
    RenderScriptCams(false, true, 500, true, true)
    PlaySoundFrontend(-1, "CAR_BIKE_WHOOSH", "MP_LOBBY_SOUNDS", 1)
    FreezeEntityPosition(GetPlayerPed(-1), false)
    Citizen.Wait(500)
    SetCamActive(cam, false)
    DestroyCam(cam, true)
    IsChoosing = false
    DisplayHud(true)
    DisplayRadar(true)
end)

and replace with

RegisterNetEvent('kashactersC:SpawnCharacter')
AddEventHandler('kashactersC:SpawnCharacter', function(spawn, isnew)
    TriggerServerEvent('es:firstJoinProper')
    TriggerEvent('es:allowedToSpawn')
    TriggerEvent('esx_ambulancejob:multicharacter')

    SetTimecycleModifier('default')
    local pos = spawn
    SetEntityCoords(GetPlayerPed(-1), pos.x, pos.y, pos.z)
    DoScreenFadeIn(500)
    Citizen.Wait(500)
    cam2 = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", -1355.93,-1487.78,520.75, 300.00,0.00,0.00, 100.00, false, 0)
    PointCamAtCoord(cam2, pos.x,pos.y,pos.z+200)
    SetCamActiveWithInterp(cam2, cam, 900, true, true)
    Citizen.Wait(900)
	
 if isnew then
	TriggerEvent('esx_identity:showRegisterIdentity')
 end

    cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", pos.x,pos.y,pos.z+200, 300.00,0.00,0.00, 100.00, false, 0)
    PointCamAtCoord(cam, pos.x,pos.y,pos.z+2)
    SetCamActiveWithInterp(cam, cam2, 3700, true, true)
    Citizen.Wait(3700)
    PlaySoundFrontend(-1, "Zoom_Out", "DLC_HEIST_PLANNING_BOARD_SOUNDS", 1)
    RenderScriptCams(false, true, 500, true, true)
    PlaySoundFrontend(-1, "CAR_BIKE_WHOOSH", "MP_LOBBY_SOUNDS", 1)
    FreezeEntityPosition(GetPlayerPed(-1), false)
    Citizen.Wait(500)
    SetCamActive(cam, false)
    DestroyCam(cam, true)
    IsChoosing = false
    DisplayHud(true)
    DisplayRadar(true)
end)

@KASH Maybe you could add this link to your op. Install Instruction


#63

try to clear your server cache then


#64

yup it the same but i still cant use the menu