Welcome to the forum, Guest

To access forum content and all of our services, you must register or log in to the forum. Joining the forum and all content on the forum is completely free.

The world's largest FiveM Forum and GTA 5 Forum address

Hello dear member,
We work 24/7 to provide the most valuable content that will be of use to you,
you can share content and support the entire FiveM & GTA 5 mods.

Question Cyber Multicharacter with Qb Clothing ESX

Çevrimdışı

cowardtv

Silver Elite
Jul 1, 2021
44
13
156
soo when ever i use this code below in a cyber multicharacter system that shows the ped like any qb server.
my character wont load at all soo if i use this in the functions i dont see the ped at all and no error
[ model = model ~= nil and tonumber(model) or false ] but when i do this [ model = tonumber(model) ]its loading only the ped it self and still no clothes on it.. i cant figure how to make the ped with the currect clothes and not just a ped with default skin

Client Side

Code:
RegisterNUICallback("SelectChars", function(data, cb)
DoScreenFadeOut(500)
while not IsScreenFadedOut() do
Citizen.Wait(10)
end
Citizen.Wait(500)
if LastSelectedChar ~= data.charid and DoesEntityExist(charPed) then
SetEntityAsMissionEntity(charPed, true, true)
DeleteEntity(charPed)
end
if LastSelectedChar ~= data.charid then
Citizen.Wait(150)
local randommodels = {
"mp_m_freemode_01",
"mp_f_freemode_01",
}
if data.ischar == "true" then
ESX.TriggerServerCallback('kashactersS:getPlayerSkin', function(model, data)
model = model ~= nil and tonumber(model) or false
if model ~= nil then
Citizen.CreateThread(function()
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
charPed = CreatePed(2, model, Config.charids.x, Config.charids.y, Config.charids.z, Config.charids.h, false, true)
SetPedComponentVariation(charPed, 0, 0, 0, 2)
FreezeEntityPosition(charPed, false)
SetEntityInvincible(charPed, true)
PlaceObjectOnGroundProperly(charPed)
SetBlockingOfNonTemporaryEvents(charPed, true)
data = json.decode(data)
TriggerEvent('qb-clothing:client:loadPlayerClothing', data, charPed)
end)

if needed this is server side for fetching the skin data from SQL
Code:
ESX.RegisterServerCallback('kashactersS:getPlayerSkin', function(source, cb, charidp)
local src = source

local result = MySQLAsyncExecute('SELECT * FROM playerskins WHERE [email protected] AND [email protected]', {['@identifier'] = 'Char'..charidp..GetPlayerIdentifiers(source)[1], ['@active'] = 1})
if result[1] ~= nil then
cb(result[1].model, result[1].skin)
else
cb(nil)
end
end)
 

Login or register to get more out of the forum!

Login or register to get more out of the forum!

Register

Creating an account on the forum is completely free.

Register now
Log in

If you have an account, please login

Log in

Theme editor

Theme customizations

Graphic Backgrounds

Granite Backgrounds