Brad96 Posted August 14, 2013 Share Posted August 14, 2013 (edited) I wonder if I could give the functions, if They Want to or give me clues Also to try it .. this what comes to detailing the infernus or cars. Edited August 14, 2013 by Guest Link to comment
bandi94 Posted August 14, 2013 Share Posted August 14, 2013 I dont' get your point .. Explain better ?? Link to comment
InVision Posted August 14, 2013 Share Posted August 14, 2013 (edited) You want to edit the Infernus to make it have those custom lights? If so, you're going to need to download TXD Workshop, edit the Infernus's txd, and then replace the stock images with the custom ones. ED: Sorry for my lismeading information, I thought it was similar to replacing the textures of custom mods Edited August 15, 2013 by Guest Link to comment
Brad96 Posted August 15, 2013 Author Share Posted August 15, 2013 ye but the infernus do not have txd with lights for replace them for me sorry for my english Link to comment
50p Posted August 15, 2013 Share Posted August 15, 2013 You need to use a shader to replace texture of lights. Most if not all cars share the same lights texture and therefore there is no lights texture in cars' .txd's. Link to comment
bandi94 Posted August 15, 2013 Share Posted August 15, 2013 light's are in "vehicle.txd" , also you can use shader like 50p said. Link to comment
Brad96 Posted August 15, 2013 Author Share Posted August 15, 2013 as I found them but I need this script activate the lights when a player enters the server .. for now activated by a Panel .. how could I do that will be activated when entering the sv without panel or anything? local lights = { "vehiclelightson128" } local shaders = {} local currentLight = "vehiclelightson128" local drawLights = true addEventHandler("onClientResourceStart",resourceRoot, function () currentLight = getCookieOption("lights") or "high quality" setElementData(localPlayer,"vehiclelight",currentLight,true) if getCookieOption("draw") ~= "false" then for i,vehicle in ipairs (getElementsByType("vehicle")) do loadVehicleLights(vehicle) end end end ) addEventHandler("onClientElementStreamIn",root, function () if getElementType(source) == "vehicle" then loadVehicleLights(source) end end ) addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights(source) end ) function loadVehicleLights (vehicle) local controller = getVehicleController(vehicle) if not controller then return end local image = getElementData(controller,"vehiclelight") if not image then return end if not shaders[image] then local texture = dxCreateTexture("images/vehiclelightson128.jpg","dxt3") local shader = dxCreateShader("lights.fx") dxSetShaderValue(shader,"gTexture",texture) shaders[image] = shader end engineApplyShaderToWorldTexture(shaders[image],"vehiclelightson128",vehicle) -- needs messing with alpha end addEventHandler("onClientElementDataChange",root, function (key,oldvalue) if key == "vehiclelight" then local vehicle = getPedOccupiedVehicle(source) if vehicle then loadVehicleLights(vehicle) end end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now