//_Dragon Posted May 7, 2017 Share Posted May 7, 2017 انا عملت الكود دا لما تيجي تدوس على button اسمها Engine On / Off المحرك بتاع السيارة بيطفا و لما دوس كليك عليه تاني بشتغل المحرك بس الكود دا فيه غلط علشان خرب لوحة السيارة addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, function switchEngine ( playerSource ) local theVehicle = getPedOccupiedVehicle ( playerSource ) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController ( theVehicle ) == playerSource then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end end ) الأصلي function turnEngineOff ( theVehicle, leftSeat, jackerPlayer ) -- if it's the driver who got out, and he was not jacked, if leftSeat == 0 and not jackerPlayer then -- turn off the engine setVehicleEngineState ( theVehicle, false ) end end -- add 'turnEngineOff' as a handler for "onPlayerExitVehicle" addEventHandler ( "onPlayerVehicleExit", getRootElement ( ), turnEngineOff ) Link to comment
#DRAGON!FIRE Posted May 7, 2017 Share Posted May 7, 2017 وضح لي المشكلة بالضبط ما فهمت ! Link to comment
coNolel Posted May 7, 2017 Share Posted May 7, 2017 3 minutes ago, Abdul KariM said: switchEngine سطر 3 شيل وجرب function switchEngine ( playerSource ) local theVehicle = getPedOccupiedVehicle ( playerSource ) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController ( theVehicle ) == playerSource then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end end addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, switchEngine) Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 (edited) 19 hours ago, coNolel said: function switchEngine ( playerSource ) local theVehicle = getPedOccupiedVehicle ( playerSource ) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController ( theVehicle ) == playerSource then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end end addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, switchEngine) غلط مش رادي يشتغل 20 hours ago, #ZA7F //= said: وضح لي المشكلة بالضبط ما فهمت ! انا عملت كود يقدر يخليك طفي محرك السيارة و تشغل بضغطة زر المشكلة لما تضغط ، المحرك يبقا شغال ، يعني الكود مش شغال فيه مشكلة انا عايز اخلي الكود شغال يعني لما اجي اضغط على الزر المحرك بيطفا و لما اضغط تاني بيشتغل المحرك Edited May 8, 2017 by Droam|Oussez Link to comment
Ahmed Ly Posted May 8, 2017 Share Posted May 8, 2017 addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, function switchEngine () local theVehicle = getPedOccupiedVehicle (source) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController (theVehicle) == source then local state = getVehicleEngineState ( theVehicle ) if state == false then setVehicleEngineState (theVehicle,true) else setVehicleEngineState (theVehicle,false) end end end ) Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 44 minutes ago, Ahmed Ly said: addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, function switchEngine () local theVehicle = getPedOccupiedVehicle (source) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController (theVehicle) == source then local state = getVehicleEngineState ( theVehicle ) if state == false then setVehicleEngineState (theVehicle,true) else setVehicleEngineState (theVehicle,false) end end end ) مش شغال Link to comment
MR.StoRm Posted May 8, 2017 Share Posted May 8, 2017 1 minute ago, #Soking said: احذف switchEngine ما يحتاج تكرر عبد الكريم قال كذا .. @#Soking Link to comment
#Soking Posted May 8, 2017 Share Posted May 8, 2017 Just now, MR.StoRm said: ما يحتاج تكرر عبد الكريم قال كذا .. @#Soking طيب انا رجعت اكرر المعلومه بعد تعديله الكود وش مشكلتك اننت Link to comment
MR.StoRm Posted May 8, 2017 Share Posted May 8, 2017 Just now, #Soking said: طيب انا رجعت اكرر المعلومه بعد تعديله الكود وش مشكلتك اننت ولشيء مشكلتي بس خلص ما يحتاج تكرار , شفيك عصبت خلاص 1 Link to comment
#Soking Posted May 8, 2017 Share Posted May 8, 2017 Just now, Droam|Oussez said: شغالة شكرا حياك Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 طيب انا عايز اعمل outputchatbox لما تضغط على Engine On المحرك بيشتغل و بيجيلك في الشات [Vehicle SySTEM] Engine on و لما تضغط تاني المحرك بيطفا و بيجيلك في الشات [Vehicle SySTEM] Engine off Link to comment
#Soking Posted May 8, 2017 Share Posted May 8, 2017 Just now, Droam|Oussez said: طيب انا عايز اعمل outputchatbox لما تضغط على Engine On المحرك بيشتغل و بيجيلك في الشات [Vehicle SySTEM] Engine on و لما تضغط تاني المحرك بيطفا و بيجيلك في الشات [Vehicle SySTEM] Engine off شكلي بفتح الكمبيوتر مخصوص Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 (edited) Edited May 8, 2017 by Droam|Oussez 1 Link to comment
Ahmed Ly Posted May 8, 2017 Share Posted May 8, 2017 addEvent( 'VehiclesSystem;off/onPersonalVehicle', true ) addEventHandler( 'VehiclesSystem;off/onPersonalVehicle', root, function () local theVehicle = getPedOccupiedVehicle (source) -- Check if the player is in any vehicle and if he is the driver if theVehicle and getVehicleController (theVehicle) == source then local state = getVehicleEngineState ( theVehicle ) if state == false then setVehicleEngineState (theVehicle,true) outputChatBox("[Vehicle SySTEM] Engine on ",source,0,255,0,true) else setVehicleEngineState (theVehicle,false) outputChatBox("[Vehicle SySTEM] Engine off ",source,0,255,0,true) end end end ) Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 addEvent("FixMyVehicle", true) addEventHandler("FixMyVehicle", root, function(id) if (getElementData(source, "Money") or 0) >= tonumber(5000) then setElementData(source, "Money", getElementData(source, "Money") - 5000) local vehicle = getVehicleByID(id) if isElement(vehicle) then fixVehicle(vehicle) setVehicleEngineState(vehicle, true) if isVehicleDamageProof(vehicle) then setVehicleDamageProof(vehicle, false) end end dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND ID = ?", 1000, getAccountName(getPlayerAccount(source)), id) updateVehicleInfo(source) exports["Notice"]:outputNotice(source,"#58FAF4Your Vehicle #00FF00has been fixed.", "success", true) outButDxChat ("[Vehicle System] #58FAF4Your Vehicle #00FF00has been fixed.", source, 255, 85, 0, true) else exports["Notice"]:outputNotice(source,"#FF0000You don't have enough money to fix the vehicle.", "error", true) outButDxChat ("[Vehicle System] #FF0000You don't have enough money to fix the vehicle.", source, 255, 85, 0, true) end end) جديدة لما تكون عاوز تصلح السيارة و هي مش موجودة معاك outButDxChat عايز احط else outButDxChat ("[Vehicle System] #FF0000Your vehicle is not spawned", source, 255, 85, 0, true) لو حطتها ، السكريبت مش بيشتغل ايه هو الغلط ؟ Link to comment
#BrosS Posted May 8, 2017 Share Posted May 8, 2017 حطها outputChatBox او حاول تجيب سورس الفنكشن او عرفه Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 Just now, #BrosS said: حطها outputChatBox او حاول تجيب سورس الفنكشن او عرفه لا مش لازم Link to comment
#BrosS Posted May 8, 2017 Share Posted May 8, 2017 Just now, Droam|Oussez said: لا مش لازم شنو مو لازم ؟ Link to comment
//_Dragon Posted May 8, 2017 Author Share Posted May 8, 2017 Just now, #BrosS said: شنو مو لازم ؟ او الكود فيه مشكلة شوف انت الكود لي حطيتو و حتفهم المشكلة 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