☠ RaZeR ☠ Posted August 14, 2015 Share Posted August 14, 2015 ليه مايدخلني داخل السياره عن طريق warpPedIntoVehicle يقولي في الديبوق expected Ped ؟؟ addEventHandler("onClientGUIClick",root, function () if source == StarTech then local x, y, z = getElementPosition( getLocalPlayer ( ) ) local StarTech = createVehicle( 405, x, y, z ) warpPedIntoVehicle ( source, StarTech ) end end ) Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 تمت الافاده مشكور Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 (edited) -- Client addEventHandler("onClientGUIClick",root, function () if source == StarTech then triggerServerEvent ( "warp", localPlayer) end end ) -- Server addEvent('warp',true) addEventHandler('warp',root, function ( ) if ( isElement(theVehicle) ) then destroyElement(theVehicle) end local x,y,z = getElementPosition ( source ) theVehicle = createVehicle(405,x,y,z) warpPedIntoVehicle(source,theVehicle) end) Edited August 14, 2015 by Guest Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 تمت الافاده مشكور العفو حيأك الله , اذا تبي تصحيح وكذا خلك بـ موضوع واحد لاهنت Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 طيب ابيه بس يطلع سياره وحده يعني مثلا بسوي سيارتين في لوحة اذا ضغط على الزر الاول ينزل السياره ( عادي ) واذا ضغط على الزر الثاني يسحب السياره الاولى وينزل الثانيه addEventHandler("onClientGUIClick",root, function () if source == Star2 then triggerServerEvent ( "warp2", localPlayer) end end ) ------------------ addEvent('warp2',true) addEventHandler("warp2",root, function ( ) if ( isElement(theVehicle) ) then destroyElement(theVehicle) end local x,y,z = getElementPosition ( source ) theVehicle = createVehicle(350,x,y,z) warpPedIntoVehicle(source,theVehicle) end) Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 اذا انت مسوي نفس الكود الي قبل غير المتغير حق السيأرة .. Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 # شوف انا عندي زرين زر سياره وزر دراجه اذا ضغط على السياره وبعدين ضغط على الدراجه تنحذف السياره وتطلع الدراجه واذا ضغط مرتين على الزر ماابيه ينزل سيارتين فوق بعض Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 اطرح الكلنت والسيرفر كأمل مخي آنلحس . Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 كلنت StarTech = guiCreateStaticImage(9, 30, 202, 35, "StarTech.png", false) Wagon = guiCreateStaticImage(9, 81, 201, 35, "Wagon.png", false) addEventHandler("onClientGUIClick",root, function () if source == StarTech then triggerServerEvent ( "warp", localPlayer) end end ) --------------------------------------------- الزر الثاني------------------ addEventHandler("onClientGUIClick",root, function () if source == Wagon then triggerServerEvent ( "warp2", localPlayer) end end ) سيرفر : addEvent( "warp", true ) function warp () if ( isElement(StarTech) ) then destroyElement(StarTech) end local x, y, z = getElementPosition( source ) local StarTech = createVehicle( 405, x, y, z ) warpPedIntoVehicle ( source, StarTech ) end addEventHandler ( "warp", getRootElement(), warp ) addEvent( "warp2", true ) function warp2 () if ( isElement(Wagon) ) then destroyElement(Wagon) end local x, y, z = getElementPosition( source ) local Wagon = createVehicle( 499, x, y, z ) warpPedIntoVehicle ( source, Wagon ) end addEventHandler ( "warp2", getRootElement(), warp2 ) Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 --- Client addEventHandler('onClientGUIClick',root, function ( ) if ( source == Car ) then triggerServerEvent('Warp',localPlayer) elseif ( source == Car2 ) then triggerServerEvent('Warp2',localPlayer) end end ) -- Server addEvent('Warp',true) addEventHandler('Warp',root, function ( ) if ( isElement(car2) ) then destroyElement(car2) end local x,y,z = getElementPosition ( source ) car2 = createVehicle(id,x,y,z) warpPedIntoVehicle(source,car2) end ) addEvent('Warp2',true) addEventHandler('Warp2',root, function ( ) if ( isElement(car) ) then destroyElement(car) end local x,y,z = getElementPosition ( source ) car = createVehicle(id,x,y,z) warpPedIntoVehicle(source,car) end ) id = الايدي Car = اسم الزر Car2 = اسم الزر جرب .. Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 اسمع صح اذا ضغط الزر ينزل سياره طيب اذا ضغط الزر مره ثانيه يجيب سياره فوق سياره ليه ؟؟ Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 local Veh = { } addCommandHandler('Naif', function ( player ) if ( isElement(Veh[player]) ) then destroyElement(Veh[player]) end local x,y,z = getElementPosition ( player ) Veh[player] = createVehicle(411,x,y,z) warpPedIntoVehicle(player,Veh[player]) end) ^ شوفه وطبقه على الي انت تبي تسويه .. Link to comment
The Killer Posted August 14, 2015 Share Posted August 14, 2015 (edited) Client side # StarTech = guiCreateStaticImage(9, 30, 202, 35, "StarTech.png", false) Wagon = guiCreateStaticImage(9, 81, 201, 35, "Wagon.png", false) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == StarTech) then triggerServerEvent ("warp", localPlayer) end if (source == Wagon) then triggerServerEvent ("warp2", localPlayer) end end ) Server side # local Vehicles = { } addEvent ("warp", true) addEventHandler ("warp", root, function () if isElement (Vehicles [source]) then destroyElement (Vehicles [source]) Vehicles [source] = nil end local x,y,z = getElementPosition (source) Vehicles [source] = createVehicle (405, x,y,z) warpPedIntoVehicle (source, Vehicles [source]) end ) addEvent ("warp2", true) addEventHandler ("warp2", root, function () if isElement (Vehicles [source]) then destroyElement (Vehicles [source]) Vehicles [source] = nil end local x,y,z = getElementPosition (source) Vehicles [source] = createVehicle (499, x,y,z) warpPedIntoVehicle (source, Vehicles [source]) end ) addEventHandler ("onVehicleExplode", resourceRoot, function () destroyElement (source) end ) addEventHandler ("onPlayerQuit", root, function () if isElement (Vehicles [source]) then destroyElement (Vehicles [source]) Vehicles [source] = nil end end ) Edited August 14, 2015 by Guest Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 soure "" source line 11,24 Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 يب الحمدلله مشكورين والله يسعدكم!! Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 ممكن اعرف ليه مايشتغل ذا اذا ضغط مره على الزر يخفي الشات واذا ضغط مره ثانيه يظهر الشات addEventHandler("onClientGUIClick", root, function () if source == chat then showChat(false) else showChat(true) end end ) Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 chat1 = true addEventHandler("onClientGUIClick", root, function () if source == chat then chat1 = not chat1 showChat(chat1) end end ) Link to comment
☠ RaZeR ☠ Posted August 14, 2015 Author Share Posted August 14, 2015 طيب لو ابيها فتح اغلاق ابواب السياره كذا ؟ addEventHandler("onClientGUIClick", root, function () if source == doors then playervehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( playervehicle ) then if isVehicleLocked ( playervehicle ) then setVehicleLocked ( playervehicle, true ) = not setVehicleLocked ( playervehicle, false ) end end end end ) Link to comment
Naif Posted August 14, 2015 Share Posted August 14, 2015 (edited) addEventHandler('onClientGUIClick',root, function ( ) if ( source == Locked ) then if ( getPedOccupiedVehicle(localPlayer) ) then if ( isVehicleLocked(getPedOccupiedVehicle(localPlayer)) ) then setVehicleLocked(getPedOccupiedVehicle(localPlayer),false) else setVehicleLocked(getPedOccupiedVehicle(localPlayer),true) end end end end ) جرب وشوف Edited August 14, 2015 by Guest 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