Szerző Téma: Paintjob hiba modolt autónál  (Megtekintve 858 alkalommal)

Nem elérhető Atesz

Paintjob hiba modolt autónál
« Dátum: 2018. augusztus 14. - 14:58:34 »
0 Show voters
Helló! Előre is elnézést kérek nem nagyon tudom hogyan kellene \"normálisan\" és átláthatóbban elrendezni és beilleszteni a kódot :)
Olyan problémám volna hogy nézegettük egyik ismerősömmel ezt a paintjob systemet viszont nem úgy működik ahogy mi azt szeretnénk vagy kellene neki.
2-3 napja nézegetjük de egyszerűen nem tudunk rájönni arra hogy miért nem működik normálisan.
A hiába annyi volna hogy ha például egy EVO-ra szeretnénk a berakott paintjobot felrakni akkor nem jelenik meg, viszont hogyha simán a sultan nevű alap GTA San Andreas-os járművet nézzük azon megjelenik hibátlanul. Textúra checkerrel is megnéztem a kocsik texturájának nevét be is írtam de úgy sem működik (pl.: remapelegybody stb)
Csakis a sima GTA-s kocsikra teszi rá a paintjobot
Előre is köszönöm mindenkinek a segítségét további szép napot
SourceC.lua
 
 

local shaders = {}
local elementShaders = {}
local textureCache = {}
local textureCount = {}
local textureSize = 768
function applyShader(texture, img, distance, element)
if element then
   destroyShaderCache(element)
end
local this = #shaders + 1
shaders[this] = {}
shaders[this][1] = dxCreateShader(\"graphics.fx\",0,distance,layered)
if not textureCount[img] then
   textureCount[img] = 0
end
if textureCount[img] == 0 then
   textureCache[img] = dxCreateTexture(img)
end
textureCount[img] = textureCount[img] + 1
shaders[this][2] = textureCache[img]
shaders[this][3] = texture
if element then
   if not elementShaders[element] then
      elementShaders[element] = {shaders[this], img}
   end
end
if shaders[this][1] and shaders[this][2] then
   dxSetShaderValue(shaders[this][1], \"TEXTURE\", shaders[this][2])
   engineApplyShaderToWorldTexture(shaders[this][1], texture, element)
end
end
function destroyShaderCache(element)
if elementShaders[element] then
   destroyElement(elementShaders[element][1][1])
   local old_img = elementShaders[element][2]
   textureCount[old_img] = textureCount[old_img] - 1
   if textureCount[old_img] == 0 then
      destroyElement(elementShaders[element][1][2])
   end
   elementShaders[element] = nil
end
end
addEvent(\"destroyShaderCache\", true)
addEventHandler(\"destroyShaderCache\", root, destroyShaderCache)
addEventHandler(\"onClientResourceStart\", resourceRoot, function()
for k,v in ipairs(getElementsByType(\"vehicle\", root, true)) do
   local pj = tonumber(getElementData(v, \"veh:PaintJob\")) or 0
   if pj > 0 then
      addVehiclePaintJob(v, getElementModel(v), pj)
   end
end
end)
function getVehiclePaintJobs(model)
if paintJobs[model] then
   return #paintJobs[model]
else
   return 0
end
end
function addVehiclePaintJob(veh, model, id)
local pj = paintJobs[model]
if pj then
   local pj = pj[id]
   if pj then
      applyShader(pj[1], pj[2], 100, veh)
   end
end
end
addEvent(\"addVehiclePaintJob\", true)
addEventHandler(\"addVehiclePaintJob\", root, addVehiclePaintJob)
 
addEventHandler(\"onClientElementDestroy\", getRootElement(), function()
if getElementType(source) == \"vehicle\" then
   destroyShaderCache(source)
end
end)
addEventHandler(\"onClientElementStreamIn\", getRootElement(), function()
if getElementType(source) == \"vehicle\" then
   local pj = tonumber(getElementData(source, \"veh:PaintJob\")) or 0
   if pj > 0 then
      addVehiclePaintJob(source, getElementModel(source), pj)
   end
end
end)
addEventHandler(\"onClientElementStreamOut\", getRootElement(), function()
if getElementType(source) == \"vehicle\" then
   destroyShaderCache(source)
end
end)

 
SourceG.lua
 

paintJobs =
{
        [445] =
    {
        {\"*remap*\", \"paintjobs/445/1.png\"},
        {\"*remap*\", \"paintjobs/445/2.png\"},
        {\"*remap*\", \"paintjobs/445/3.png\"},
   {\"*remap*\", \"paintjobs/445/4.png\"},
   {\"*remap*\", \"paintjobs/445/5.png\"},
   {\"*remap*\", \"paintjobs/445/6.png\"}
    },

        [451] =
    {
        {\"*remap*\", \"paintjobs/451/1.png\"},
        {\"*remap*\", \"paintjobs/451/2.png\"},
        {\"*remap*\", \"paintjobs/451/3.png\"}
    },

        [517] =
    {
        {\"*remap*\", \"paintjobs/517/1.png\"},
        {\"*remap*\", \"paintjobs/517/2.png\"},
        {\"*remap*\", \"paintjobs/517/3.png\"},
   {\"*remap*\", \"paintjobs/517/4.png\"}
    },

        [560] =
    {
        {\"*remap*\", \"paintjobs/560/1.png\"},
        {\"*remap*\", \"paintjobs/560/2.png\"},
        {\"*remap*\", \"paintjobs/560/3.png\"},
   {\"*remap*\", \"paintjobs/560/4.png\"},
   {\"*remap*\", \"paintjobs/560/5.png\"},
   {\"*remap*\", \"paintjobs/560/6.png\"},
   {\"*remap*\", \"paintjobs/560/8.png\"},
   {\"*remap*\", \"paintjobs/560/7.png\"}
    },

        [562] =
    {
        {\"*remap*\", \"paintjobs/562/1.png\"},
        {\"*remap*\", \"paintjobs/562/2.png\"},
        {\"*remap*\", \"paintjobs/562/3.png\"},
   {\"*remap*\", \"paintjobs/562/4.png\"}
    },

        [565] =
    {
        {\"*remap*\", \"paintjobs/565/1.png\"},
        {\"*remap*\", \"paintjobs/565/2.png\"},
        {\"*remap*\", \"paintjobs/565/3.png\"},
   {\"*remap*\", \"paintjobs/565/4.png\"}
    },
   
        [405] =
    {
        {\"*remap*\", \"paintjobs/405/1.png\"},
        {\"*remap*\", \"paintjobs/405/2.png\"},
        {\"*remap*\", \"paintjobs/405/3.png\"}
    },
   
        [429] =
    {
        {\"*remap*\", \"paintjobs/429/1.png\"},
        {\"*remap*\", \"paintjobs/429/2.png\"},
        {\"*remap*\", \"paintjobs/429/3.png\"},
        {\"*remap*\", \"paintjobs/429/4.png\"}
    },
   
        [466] =
    {
        {\"*remap*\", \"paintjobs/466/1.png\"},
        {\"*remap*\", \"paintjobs/466/2.png\"},
        {\"*remap*\", \"paintjobs/466/3.png\"}
    },
   
        [477] =
    {
        {\"*remap*\", \"paintjobs/477/1.png\"},
        {\"*remap*\", \"paintjobs/477/2.png\"},
        {\"*remap*\", \"paintjobs/477/3.png\"},
        {\"*remap*\", \"paintjobs/477/4.png\"}
    },
   
        [494] =
    {
        {\"*remap*\", \"paintjobs/494/1.png\"},
        {\"*remap*\", \"paintjobs/494/2.png\"},
        {\"*remap*\", \"paintjobs/494/3.png\"},
        {\"*remap*\", \"paintjobs/494/4.png\"}
    },
   
        [527] =
    {
        {\"*remap*\", \"paintjobs/527/1.png\"},
        {\"*remap*\", \"paintjobs/527/2.png\"},
        {\"*remap*\", \"paintjobs/527/3.png\"},
        {\"*remap*\", \"paintjobs/527/4.png\"}
    },
   
        [540] =
    {
        {\"*remap*\", \"paintjobs/540/1.png\"},
        {\"*remap*\", \"paintjobs/540/2.png\"},
        {\"*remap*\", \"paintjobs/540/3.png\"},
        {\"*remap*\", \"paintjobs/540/4.png\"}
    },
   
        [547] =
    {
        {\"*remap*\", \"paintjobs/547/1.png\"},
        {\"*remap*\", \"paintjobs/547/2.png\"},
        {\"*remap*\", \"paintjobs/547/3.png\"},
        {\"*remap*\", \"paintjobs/547/4.png\"}
    },
   
        [555] =
    {
        {\"*remap*\", \"paintjobs/555/1.png\"},
        {\"*remap*\", \"paintjobs/555/2.png\"},
        {\"*remap*\", \"paintjobs/555/3.png\"},
        {\"*remap*\", \"paintjobs/555/4.png\"}
    },
   
        [558] =
    {
        {\"*remap*\", \"paintjobs/558/1.png\"},
        {\"*remap*\", \"paintjobs/558/2.png\"},
        {\"*remap*\", \"paintjobs/558/3.png\"}
    },
   
        [561] =
    {
        {\"*remap*\", \"paintjobs/561/1.png\"},
        {\"*remap*\", \"paintjobs/561/2.png\"},
        {\"*remap*\", \"paintjobs/561/3.png\"}
    },
   
        [576] =
    {
        {\"*remap*\", \"paintjobs/576/1.png\"},
        {\"*remap*\", \"paintjobs/576/2.png\"},
        {\"*remap*\", \"paintjobs/576/3.png\"},
        {\"*remap*\", \"paintjobs/576/4.png\"}
    },
   
        [587] =
    {
        {\"*remap*\", \"paintjobs/587/1.png\"},
        {\"*remap*\", \"paintjobs/587/2.png\"},
        {\"*remap*\", \"paintjobs/587/3.png\"},
        {\"*remap*\", \"paintjobs/587/4.png\"}
    },
   
        [496] =
    {
        {\"*remap*\", \"paintjobs/496/1.png\"},
        {\"*remap*\", \"paintjobs/496/2.png\"},
        {\"*remap*\", \"paintjobs/496/3.png\"},
        {\"*remap*\", \"paintjobs/496/4.png\"}
    },
   
        [580] =
    {
        {\"*remap*\", \"paintjobs/580/1.png\"},
        {\"*remap*\", \"paintjobs/580/2.png\"},
        {\"*remap*\", \"paintjobs/580/3.png\"},
        {\"*remap*\", \"paintjobs/580/4.png\"},
        {\"*remap*\", \"paintjobs/580/5.png\"},
        {\"*remap*\", \"paintjobs/580/6.png\"}
    },
   
}

 
SouceS.lua
 

local mysql = exports.mysql:kapcsolatCallback()
function addVehiclePaintJob(veh, model, id)
if id > 0 then
   triggerClientEvent(\"addVehiclePaintJob\", root, veh, model, id)
else
   triggerClientEvent(\"destroyShaderCache\", root, veh)
end
if getElementData(veh, \"dbid\") > 0 then
   dbExec(mysql, \"UPDATE vehicles SET sticker = ? WHERE id = ?\", id, getElementData(veh, \"dbid\"))
end
end
addEvent(\"addVehiclePaintJob\", true)
addEventHandler(\"addVehiclePaintJob\", getRootElement(), addVehiclePaintJob)
function addVehicleLightJob(veh, model, id)
if id > 0 then
   triggerClientEvent(source, \"addVehicleLightJob\", source, veh, model, id)
else
   triggerClientEvent(source, \"destroyShaderCache\", source, veh)
end
if getElementData(veh, \"dbid\") > 0 then
   dbExec(mysql, \"UPDATE vehicles SET lj = ? WHERE id = ?\", id, getElementData(veh, \"dbid\"))
end
end
addEvent(\"addVehicleLightJob\", true)
addEventHandler(\"addVehicleLightJob\", root, addVehicleLightJob)

 

Előre is köszönöm mindenki segítségét :)

Paintjob hiba modolt autónál
« Válasz #1 Dátum: 2018. augusztus 17. - 07:48:14 »
0 Show voters
Próbáld úgy,hogy txdws-al megnyitod az adott jármű txd-t és az ott lévő textura nevet írd be . remapelegybody és ehhez hasonló neveken szokott futni.

Nem elérhető Atesz

Paintjob hiba modolt autónál
« Válasz #2 Dátum: 2018. szeptember 01. - 22:09:16 »
0 Show voters
Próbáltam de sajna semmi :(
 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal