Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new

Question Cyber Multicharacter with Qb Clothing ESX

cowardtv

Silver Elite
Joined
Jul 1, 2021
Messages
48
Reaction score
20
Points
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 identifier=@identifier AND active=@active', {['@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)
 
Top