Jump to content

hazard lights ?


#Selly

Recommended Posts

Posted

Hello, Is there functions to make hazard lights in mta sa ? , Cause i saw it on a server, and if there is can you give me the functions to make them

Posted

If this is the server you saw it in: mtasa://lon.404rq.com:22005 then you'll find the script here: https://github.com/404rq/GTW-RPG/tree/master/%5Bresources%5D/GTWturnsignals

setVehicleLightState is one way of doing it but it's not perfect as all vehicles doesn't have their light ID's positioned in the same corners. The other way is to make your own lights, no idea how to do that tho.

function be_remove() {

        printf("Too much gaming and too little sleep makes Olle wanna kill...");

        be_remove();

}

  • Moderators
Posted

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

Hazard lights are simply recreated with vehicle lights why use custom lights?

Hazard lights:

3aa2458b-e5af-4222-b5ba-37b0a9206776.png

Because it gives a nice effect when doing that.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
Sorry for the late reply, But can i do it with shaders ?

If you understand shaders, YES else NO.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

    myShader = dxCreateShader( "Shader.fx" ) 
    Texture = dxCreateTexture("Skin.png") 
    dxSetShaderValue(myShader, "Skin", Texture) 
      
    addEventHandler("onClientVehicleEnter", root, 
        function(thePlayer, seat) 
            local theVehicle = source 
            if seat == 0 and thePlayer == localPlayer then 
                engineApplyShaderToWorldTexture( myShader, "vehiclelightson128", theVehicle ) 
           if ( isPedInVehicle ( thePlayer ) ) and ( getVehicleOverrideLights ( getPedOccupiedVehicle ( thePlayer ) ) ~= 2 ) then 
                setVehicleOverrideLights ( getPedOccupiedVehicle ( thePlayer ), 2 ) 
            else 
                setVehicleOverrideLights ( getPedOccupiedVehicle ( thePlayer ), 1 ) 
             end 
           end 
        end 
) 
  
  

    texture gTexture; 
      
    technique hello 
    { 
        pass P0 
        { 
            Texture[0] = gTexture; 
        } 
    } 

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