Jump to content

Flying Delorean


Mefisto_PL

Recommended Posts

Hi, I want to make flying delorean. When I press Left Shift Delorean can flying, when I press it again it can't flying. But my code give all vehicles possibility to fly.

txd = engineLoadTXD("files/delorean.txd") 
engineImportTXD(txd, 402) 
dff = engineLoadDFF("files/delorean.dff", 402) 
engineReplaceModel(dff, 402) 
  
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
  
  
  
addEventHandler("onClientVehicleEnter", getRootElement(), 
    function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() then 
            if (getElementModel(source)==402) then 
                setWorldSpecialPropertyEnabled ( "hovercars", true ) 
                setWorldSpecialPropertyEnabled ( "aircars", true ) 
            else 
                setWorldSpecialPropertyEnabled ( "hovercars", false ) 
                setWorldSpecialPropertyEnabled ( "aircars", false ) 
  
            end 
        end 
    end 
) 
addEventHandler("OnClientVehicleExit", getRootElement(), 
    function(thePlayer, seat) 
        if thePlayer == getLocalPlayer() and getElementModel(source)==402 then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        end 
    end 
) 

Plz help me :C

Link to comment
txd = engineLoadTXD("files/delorean.txd") 
engineImportTXD(txd, 402) 
dff = engineLoadDFF("files/delorean.dff", 402) 
engineReplaceModel(dff, 402) 
  
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
  
addEventHandler("onClientVehicleEnter", getRootElement(), 
    function(thePlayer, seat) 
        if (thePlayer == getLocalPlayer() and getElementModel(source) == 402) then 
            setWorldSpecialPropertyEnabled ( "hovercars", true ) 
            setWorldSpecialPropertyEnabled ( "aircars", true ) 
        else 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        end 
    end 
) 
addEventHandler("onClientVehicleExit", getRootElement(), 
    function(thePlayer, seat) 
        if (thePlayer == getLocalPlayer() and getElementModel(source) == 402) then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        end 
    end 
) 

Link to comment
txd = engineLoadTXD("files/delorean.txd") 
engineImportTXD(txd, 402) 
dff = engineLoadDFF("files/delorean.dff", 402) 
engineReplaceModel(dff, 402) 
  
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
  
addEventHandler("onClientVehicleEnter", getRootElement(), 
    function(thePlayer, seat) 
        if (thePlayer == getLocalPlayer() and getElementModel(source) == 402) then 
            setWorldSpecialPropertyEnabled ( "hovercars", true ) 
            setWorldSpecialPropertyEnabled ( "aircars", true ) 
        else 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        end 
    end 
) 
addEventHandler("onClientVehicleExit", getRootElement(), 
    function(thePlayer, seat) 
        if (thePlayer == getLocalPlayer() and getElementModel(source) == 402) then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        end 
    end 
) 
  
bindKey("lshift","down", 
function () 
    if (isPedInVehicle(localPlayer) and getElementModel(getPedOccupiedVehicle(localPlayer)) == 402) then 
        if isWorldSpecialPropertyEnabled("aircars") then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
        else 
            setWorldSpecialPropertyEnabled ( "hovercars", true ) 
            setWorldSpecialPropertyEnabled ( "aircars", true )   
        end 
    end 
end) 

Link to comment

Okey it's working, but when I enter the car flying is enabled, but when I press shift is disabled. I want to make it that when I enter the car flying is disabled, but when I press shift is enabled and can you add chatbox msg when it's enabled and disabled?

///EDIT

And I find a bug. When the vehicle touch the ground , wheels is complex, when you flying wheels is normal . :/

Link to comment

So I can't make another wheels status?

bindKey("lshift","down", 
function () 
    if (isPedInVehicle(localPlayer) and getElementModel(getPedOccupiedVehicle(localPlayer)) == 402) then 
        if isWorldSpecialPropertyEnabled("aircars") then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
            outputChatBox ( "Latanie Deloreanem: Włączone", source, 255, 0, 0, true ) 
        else 
            setWorldSpecialPropertyEnabled ( "hovercars", true ) 
            setWorldSpecialPropertyEnabled ( "aircars", true ) 
            outputChatBox ( "Latanie Deloreanem: Wyłączone", source, 255, 0, 0, true ) 
        end 
    end 
end) 

My outputChatBox is not colourful ;x Why?!

Edited by Guest
Link to comment

Is a client-side outputChatBox, it doesn't require the 'player' argument.

bindKey("lshift","down", 
function () 
    if (isPedInVehicle(localPlayer) and getElementModel(getPedOccupiedVehicle(localPlayer)) == 402) then 
        if isWorldSpecialPropertyEnabled("aircars") then 
            setWorldSpecialPropertyEnabled ( "hovercars", false ) 
            setWorldSpecialPropertyEnabled ( "aircars", false ) 
            outputChatBox ( "Latanie Deloreanem: Włączone", 255, 0, 0, true ) 
        else 
            setWorldSpecialPropertyEnabled ( "hovercars", true ) 
            setWorldSpecialPropertyEnabled ( "aircars", true ) 
            outputChatBox ( "Latanie Deloreanem: Wyłączone", 255, 0, 0, true ) 
        end 
    end 
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...