WASSIm. Posted January 15, 2013 Share Posted January 15, 2013 1-nhabo ya5dm il script awal mana3ml start mouch wa9t ili narkab fil karahba local shaders = {} 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/"..image..".jpg","dxt3") local shader = dxCreateShader("lights.fx") dxSetShaderValue(shader,"gTexture",texture) shaders[image] = shader end engineApplyShaderToWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end function unloadVehicleLights (vehicle) local controller = getVehicleController(vehicle) if not controller then return end local image = getElementData(controller,"vehiclelight") if not image then return end engineRemoveShaderFromWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end 2- nhab nrodo had mainajam ichofo kima haka (exm) LuaQ @client.lua E ¤ € ‡@ …À Å@ AA œ€ ‡€ € localPlayer discoLight discoTimer setTimer pw@ X @ @€@ D € € €€€ D € € EÀ € Á \@€E@ € Å€ ÆÀÁ Ü€ ÁAA E FÁÁ \ \@ E@ € Á€ \@ E@ € ÁÀ Á \@ E@ € Á \@ E@ € Á Á \@ B H @€@ D € € €€ D € € EÀ € Á \@€E@ € ÁÀ \@ E@ € Á€ Á \@ E@ € Á \@ E@ € Á Á \@ B € H € isPedInVehicle getPedOccupiedVehicle setVehicleOverrideLights @ setVehicleHeadLightColor math random ào@ setVehicleLightState ð? @ X theVehicle 4 theVehicle = W right thePlayer right thePlayer Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 1) badel: addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights(source) end ) to: addEventHandler("onClientResourceStart",root, function () loadVehicleLights(source) end ) 2) - online compiler: http://mta.dzek.eu/compiler - I'm not using this compiler, but i use another i found on the net, you can download it by this link (i uploaded it to mediafire)http://www.mediafire.com/?08ul44zogde48s5 Link to comment
Baseplate Posted January 16, 2013 Share Posted January 16, 2013 esta3mel fileDelete lel client files/scripts fileDelete("filename.lua") addEventHandler("onClientResourceStart", resourceRoot, function () loadVehicleLights(source) end ) Link to comment
WASSIm. Posted January 16, 2013 Author Share Posted January 16, 2013 1) badel: addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights(source) end ) to: addEventHandler("onClientResourceStart",root, function () loadVehicleLights(source) end ) 2) - online compiler: http://mta.dzek.eu/compiler - I'm not using this compiler, but i use another i found on the net, you can download it by this link (i uploaded it to mediafire)http://www.mediafire.com/?08ul44zogde48s5 esta3mel fileDelete lel client files/scripts fileDelete("filename.lua") addEventHandler("onClientResourceStart", resourceRoot, function () loadVehicleLights(source) end ) debugscript 3 wa kamal ma3adch ihab ya5dem il script mbadla wala lé Link to comment
sckatchof Posted January 16, 2013 Share Posted January 16, 2013 Jareb hetha Client side : local shaders = {} addEventHandler("onClientElementStreamIn",root, function () if getElementType(localplayer ) == "vehicle" then loadVehicleLights(localplayer ) end end ) addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights() end ) function loadVehicleLights () local controller = getVehicleController(localplayer ) 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/"..image..".jpg","dxt3") local shader = dxCreateShader("lights.fx") dxSetShaderValue(shader,"gTexture",texture) shaders[image] = shader end engineApplyShaderToWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end function unloadVehicleLights () local controller = getVehicleController(localplayer ) if not controller then return end local image = getElementData(controller,"vehiclelight") if not image then return end engineRemoveShaderFromWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end Link to comment
WASSIm. Posted January 16, 2013 Author Share Posted January 16, 2013 Jareb hetha Client side : local shaders = {} addEventHandler("onClientElementStreamIn",root, function () if getElementType(localplayer ) == "vehicle" then loadVehicleLights(localplayer ) end end ) addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights() end ) function loadVehicleLights () local controller = getVehicleController(localplayer ) 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/"..image..".jpg","dxt3") local shader = dxCreateShader("lights.fx") dxSetShaderValue(shader,"gTexture",texture) shaders[image] = shader end engineApplyShaderToWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end function unloadVehicleLights () local controller = getVehicleController(localplayer ) if not controller then return end local image = getElementData(controller,"vehiclelight") if not image then return end engineRemoveShaderFromWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end Link to comment
Sparrow Posted January 16, 2013 Share Posted January 16, 2013 "localPlayer" not "localplayer" Link to comment
WASSIm. Posted January 16, 2013 Author Share Posted January 16, 2013 "localPlayer" not "localplayer" Link to comment
Vanlot Posted January 16, 2013 Share Posted January 16, 2013 "localPlayer" not "localplayer" Jareb local controller = getVehicleController(getLocalPlayer()) Link to comment
WASSIm. Posted January 16, 2013 Author Share Posted January 16, 2013 "localPlayer" not "localplayer" Jareb local controller = getVehicleController(getLocalPlayer()) p9at kima hiya Link to comment
abu5lf Posted January 16, 2013 Share Posted January 16, 2013 local shaders = {} addEventHandler("onClientElementStreamIn",root, function () if getElementType( source ) == "vehicle" then loadVehicleLights( ) end end ) addEventHandler("onClientVehicleEnter",root, function () loadVehicleLights() end ) function loadVehicleLights () local controller = getVehicleController( localPlayer ) 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/"..image..".jpg","dxt3") local shader = dxCreateShader("lights.fx") dxSetShaderValue(shader,"gTexture",texture) shaders[image] = shader end engineApplyShaderToWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) end function unloadVehicleLights () local controller = getVehicleController(localPlayer ) if not controller then return end local image = getElementData(controller,"vehiclelight") if not image then return end engineRemoveShaderFromWorldTexture(shaders[image],"vehiclepoldecals128",vehicle) 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