Jump to content

Recommended Posts

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

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
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

bugmo.png

wa kamal ma3adch ihab ya5dem il script mbadla wala lé :cry:

Link to comment

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
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 

bugyc.png

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...