Mefisto_PL Posted December 30, 2011 Posted December 30, 2011 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
Castillo Posted December 30, 2011 Posted December 30, 2011 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 )
Mefisto_PL Posted December 30, 2011 Author Posted December 30, 2011 Again it give possibility to fly to everyone vehicle ;x
Castillo Posted December 30, 2011 Posted December 30, 2011 What do you mean? I tested it and works fine. I spawned a vehicle ID 402 and I could fly, then spawned a Banshee and I couldn't.
Xeno Posted December 30, 2011 Posted December 30, 2011 I think he wants it so the left shift makes it fly? When I press Left Shift
Mefisto_PL Posted December 30, 2011 Author Posted December 30, 2011 Oh okey I give vehicle from admin panel , but can you make bind to this ? ///EDIT My little failed, it's no bug Castillo , but i want to bind flying..
Castillo Posted December 30, 2011 Posted December 30, 2011 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)
Mefisto_PL Posted December 30, 2011 Author Posted December 30, 2011 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 .
Castillo Posted December 30, 2011 Posted December 30, 2011 Why don't you make that? you think you can come here and request things? one thing is help, another is give you whatever you want. P.S: Is not a bug, is because you enabled "hovercars".
Mefisto_PL Posted December 30, 2011 Author Posted December 30, 2011 (edited) 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 December 30, 2011 by Guest
Castillo Posted December 30, 2011 Posted December 30, 2011 What do you mean by wheels status? disable hover and the wheels should be fine.
Mefisto_PL Posted December 30, 2011 Author Posted December 30, 2011 Eh.. Nothing I have problem with this chatbox msg only.
Castillo Posted December 30, 2011 Posted December 30, 2011 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)
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