I wrote a resource that replaces vehiclelights128 but ran into a problem.
I need to replace the vehiclelights128 file for each model separately
(for each car its own vehiclelights128).
What can I do?
local myShader_raw_data = [[
texture Tex0;
technique simple
{
pass P0
{
Texture[0] = Tex0;
}
}
]]
local theTechnique = dxCreateShader(myShader_raw_data)
local myShader_raw_data_on = [[
texture Tex1;
technique simple
{
pass P0
{
Texture[0] = Tex1;
}
}
]]
local theTechniqueon = dxCreateShader(myShader_raw_data_on)
local texture = dxCreateTexture("vehlights.png")
local texture = dxCreateTexture("vehlightson.png")
function applyShader(thePlayer, seat)
local theVehicle = source
if seat == 0 and thePlayer == localPlayer then
dxSetShaderValue(theTechnique,"Tex0",texture)
dxSetShaderValue(theTechniqueon,"Tex1",texture)
engineApplyShaderToWorldTexture(theTechnique, "vehiclelights128", theVehicle)
engineApplyShaderToWorldTexture(theTechniqueon, "vehiclelightson128", theVehicle)
end
end
addEventHandler("onClientVehicleEnter", getRootElement(), applyShader)