RegisterNUICallback('setCurrentPed', function(data, cb)
local playerData = QBCore.Functions.GetPlayerData()
if playerData.charinfo.gender == 0 then
if Config.ManPlayerModels[data.ped] == nil then
cb(Config.ManPlayerModels[1])
ChangeToSkinNoUpdate(Config.ManPlayerModels[1])
return
end
cb(Config.ManPlayerModels[data.ped])
ChangeToSkinNoUpdate(Config.ManPlayerModels[data.ped])
else
if Config.WomanPlayerModels[data.ped] == nil then
cb(Config.WomanPlayerModels[1])
ChangeToSkinNoUpdate(Config.WomanPlayerModels[1])
return
end
cb(Config.WomanPlayerModels[data.ped])
ChangeToSkinNoUpdate(Config.WomanPlayerModels[data.ped])
end
end)
谢谢大佬简单替换一下, 可能是你想要修复的样子lua:RegisterNUICallback('setCurrentPed', function(data, cb) local playerData = QBCore.Functions.GetPlayerData() if playerData.charinfo.gender == 0 then if Config.ManPlayerModels[data.ped] == nil then cb(Config.ManPlayerModels[1]) ChangeToSkinNoUpdate(Config.ManPlayerModels[1]) return end cb(Config.ManPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.ManPlayerModels[data.ped]) else if Config.WomanPlayerModels[data.ped] == nil then cb(Config.WomanPlayerModels[1]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[1]) return end cb(Config.WomanPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[data.ped]) end end)
简单替换一下, 可能是你想要修复的样子lua:RegisterNUICallback('setCurrentPed', function(data, cb) local playerData = QBCore.Functions.GetPlayerData() if playerData.charinfo.gender == 0 then if Config.ManPlayerModels[data.ped] == nil then cb(Config.ManPlayerModels[1]) ChangeToSkinNoUpdate(Config.ManPlayerModels[1]) return end cb(Config.ManPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.ManPlayerModels[data.ped]) else if Config.WomanPlayerModels[data.ped] == nil then cb(Config.WomanPlayerModels[1]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[1]) return end cb(Config.WomanPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[data.ped]) end end)
数据库文件正常导入了吗[ scriptxmysql] Error: qb-clothing was unable to execute a query!
[ scriptxmysql] Query: INSERT INTO player_outfits (citizenid, outfitname, model, components, props) VALUES (?, ?, ?, ?, ?)
[ scriptxmysql] ["RUR32063","12","mp_m_freemode_01","[{\"component_id\":0,\"drawable\":0,\"texture\":0},{\"component_id\":1,\"drawable\":9,\"texture\":0},{\"component_id\":2,\"drawable\":0,\"texture\":0},{\"component_id\":3,\"drawable\":11,\"texture\":0},{\"component_id\":4,\"drawable\":69,\"texture\":0},{\"component_id\":5,\"drawable\":0,\"texture\":0},{\"component_id\":6,\"drawable\":14,\"texture\":0},{\"component_id\":7,\"drawable\":0,\"texture\":0},{\"component_id\":8,\"drawable\":5,\"texture\":0},{\"component_id\":9,\"drawable\":0,\"texture\":0},{\"component_id\":10,\"drawable\":175,\"texture\":0},{\"component_id\":11,\"drawable\":96,\"texture\":0}]","[{\"drawable\":3,\"prop_id\":0,\"texture\":0},{\"drawable\":55,\"prop_id\":1,\"texture\":0},{\"drawable\":-1,\"prop_id\":2,\"texture\":-1},{\"drawable\":-1,\"prop_id\":6,\"texture\":-1},{\"drawable\":-1,\"prop_id\":7,\"texture\":-1}]"]
[ scriptxmysql] Unknown column 'components' in 'field list'浏览附件1561
这个报错是什么原因呢,还是这个服装店插件,保存不了衣服
RegisterNUICallback('setCurrentPed'
, 然后修改替换:RegisterNUICallback('setCurrentPed', function(data, cb)
local playerData = QBCore.Functions.GetPlayerData()
if playerData.charinfo.gender == 0 then
if Config.ManPlayerModels[data.ped] == nil then
cb(Config.ManPlayerModels[1])
ChangeToSkinNoUpdate(Config.ManPlayerModels[1])
return
end
cb(Config.ManPlayerModels[data.ped])
ChangeToSkinNoUpdate(Config.ManPlayerModels[data.ped])
else
if Config.WomanPlayerModels[data.ped] == nil then
cb(Config.WomanPlayerModels[1])
ChangeToSkinNoUpdate(Config.WomanPlayerModels[1])
return
end
cb(Config.WomanPlayerModels[data.ped])
ChangeToSkinNoUpdate(Config.WomanPlayerModels[data.ped])
end
end)
数据库正常导入了数据库文件正常导入了吗
我现在的话是换了一个插件,上面有图,删掉了模型里面还是有昨天给你的代码是在 qb-clothing 里面修改,下面是我的使用范例, 修复删除多余PED模型后出现NULL值的情况.
- 首先在 qb-clothing-config.lua 中删除多的无用模型例如:
浏览附件1563- 前往 qb-clothing-client-main.lua 文件找到
RegisterNUICallback('setCurrentPed'
, 然后修改替换:
lua:RegisterNUICallback('setCurrentPed', function(data, cb) local playerData = QBCore.Functions.GetPlayerData() if playerData.charinfo.gender == 0 then if Config.ManPlayerModels[data.ped] == nil then cb(Config.ManPlayerModels[1]) ChangeToSkinNoUpdate(Config.ManPlayerModels[1]) return end cb(Config.ManPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.ManPlayerModels[data.ped]) else if Config.WomanPlayerModels[data.ped] == nil then cb(Config.WomanPlayerModels[1]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[1]) return end cb(Config.WomanPlayerModels[data.ped]) ChangeToSkinNoUpdate(Config.WomanPlayerModels[data.ped]) end end)