[REDESIGN][ESX] KASHacters Multi Character

wont save my positsion

I can’t get this too work someone please help

I have a problem with outfits. I have clothes from other characters in my wardrobe. Don’t know what to do with it?

hey everyone sorry I just want to know must I run this in the SQL as well?
SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”;

SET AUTOCOMMIT = 0;

START TRANSACTION;

SET time_zone = “+00:00”;

Same here is there a fix for this yet ?

1 Like

As long as you have added the SQL table into your data base, and you have made sure you added the identifiers and the owners information from the database into your Kashacters then your issue might be in your esx_datastore.

I had a similar issue and i was able to resolve it by altering the following .
Find esx_datastore > Open the server.lua > Find this (should be the last section )
AddEventHandler(‘esx:playerLoaded’, function(playerId, xPlayer)

Replace that entire function with this

AddEventHandler(‘esx:playerLoaded’, function(source)

local result = MySQL.Sync.fetchAll(‘SELECT * FROM datastore’)

for i=1, #result, 1 do
	local name   = result[i].name
	local label  = result[i].label
	local shared = result[i].shared

	local result2 = MySQL.Sync.fetchAll('SELECT * FROM datastore_data WHERE name = @name', {
		['@name'] = name
	})

	if shared == 0 then

		table.insert(DataStoresIndex, name)
		DataStores[name] = {}

		for j=1, #result2, 1 do
			local storeName  = result2[j].name
			local storeOwner = result2[j].owner
			local storeData  = (result2[j].data == nil and {} or json.decode(result2[j].data))
			local dataStore  = CreateDataStore(storeName, storeOwner, storeData)

			table.insert(DataStores[name], dataStore)
		end
	end
end

local _source = source
local xPlayer = ESX.GetPlayerFromId(_source)
local dataStores = {}

for i=1, #DataStoresIndex, 1 do
	local name      = DataStoresIndex[i]
	local dataStore = GetDataStore(name, xPlayer.identifier)

	if dataStore == nil then
		MySQL.Async.execute('INSERT INTO datastore_data (name, owner, data) VALUES (@name, @owner, @data)',
		{
			['@name']  = name,
			['@owner'] = xPlayer.identifier,
			['@data']  = '{}'
		})

		dataStore = CreateDataStore(name, xPlayer.identifier, {})
		table.insert(DataStores[name], dataStore)
	end

	table.insert(dataStores, dataStore)
end

xPlayer.set('dataStores', dataStores)

end)

This solved the issue of outfits crossing between your other character, as well as the outfits being deleted randomly.

Hope that helps .

You need to add the identifiers as well as the owners information found in the database and add them to the kashacters so that it has the ability to separate the data between your characters. the info on how to do this in the read me as well as in prior comments in this Topic

it is doing the same as this now after the second restart
did you find the problem ?

this line?

– Edit this table to all the database tables and columns

– where identifiers are used (such as users, owned_vehicles, owned_properties, etc.)

so you saying that all of the tables need to go in like this?

local IdentifierTables = {

{table = "users", column = "identifier"},

{table = "owner_vehicles", column = "owner"},

{table = "user_accounts", column = "identifier"},

{table = "user_inventory", column = "identifier"},

{table = "user_inventory", column = "identifier"}, I added this one

}

I do not know which ones are user/player used

But I see that there are ID Column then identifier columns

do I ad those 2 ?

The identifier table is so that the multi character (esx_kashacters) is able to separate your character(s) information, data, cars, inventory, and much more. You need to read the “ReadMe” , and the prior comments where they talk about this kind of stuff. I would also expand your search and look at other topics related to kashacters as several people have redesigned / re-worked this script and over all if you look through related topics you may find that some one else has already talked about this and solved it. I will not post any links here as this is not my topic so I’m sorry I cant give you an example.

What I can do is provide you with the steps on how to prevent your characters data from crossing between each other.

Go into your data base (SQL) and open the query tab. Paste the following into the EMPTY Query.
(Note - If you have anything in the Query Right click and clear it.)
Paste this into the Query /

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = ‘owner’

What this will do is find All of the Columns in your database that have “owner”,
Once you find them you need to go into your esx_kashacters > Server > Main.lua
and at the top under the → local IdentifierTables you will follow the same format that is already listed and add the table information that you got from the Query you executed. once you have added all the columns you will need to do the same for the Columns that have “identifiers” to do so . follow the same steps as before but paste the following

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = ‘identifier’

This will find all the columns with “identifiers” you will then do the same as before and add the needed tables into your esx_kashacters > server > main.lua

Once you have done this you should no longer have items, cars, contacts, ect crossing between your characters.

I hope this helps you with that issue.

As for your issue with the character selection not showing up I am unsure what is causing that.
I would make sure that you have everything in the correct order in your server.cfg
And make sure you didnt rename the folder as by doing so the HTML / JS wouldnt be able to function correctly. We would need more information to help more. but like i stated you should look around at other topics to see if you can find your issue as it may have been solved by another person.

Happy Deving :slight_smile:

1 Like

Thank for this, useful.
However note that I needed to use double quotes not single to avoid an error in the SQL commands, and also you have a typo with identifier, so:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = “owner”

and:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = “identifier”

Anyone here know where to trigger a spawnselector in kashacters? We feel we have tried almost everything to get it working!

If anyone knows or would like to see our client.lua, please let me know!

Thanks - Whippet :100:

Hi man, I was looking into the resource, wondering if i should use it.
Then i stumbled upon your comments and i want to thank you for your clear explenation.
Really helped me thus far so thanks again!

1 Like

Hi all Can someone tell me AS THIS BEEN FIX OR HOW TO FIX PLEASE
[ERROR] [MySQL] [esx_kashacters] An error happens on MySQL for query “UPDATE phone_messages SET owner = ‘Char1:11000010fab5698’ WHERE owner = ‘steam:11000010fab5698’”: ER_TRUNCATED_WRONG_VALUE: Truncated incorrect DOUBLE value: ‘steam:11000010fab5698’

THIS AS BEEN ASK MANY TIME NEED HELP PLEASE

Can someone help me
I tried to install esx_kashacters on my server but it did not work and I deleted it now I am stuck in the loading screen

gotta love it when people post that they came up with a solution while seeing others are seeking help or advice and they don’t say anything lol pointless

Does anyone know how to fix the character menu, I get no errors in the console or anything. It just loads forever.

1 Like

i only have one problem, everything works fine except when i load in my clothes wont load i am the default hipster, and making a new character it does not bring up the menu to chose skin/clothes, but i can set my name etc

Has anyone encountered the minimal disappearing after installing kashacters?

can anyone help me with the error esx_skin throwing attempt to index a nil value (local ‘user’), seems to be an issue caused by this script