Joker_Mta Posted July 28, 2012 Posted July 28, 2012 السلام عليكم ورحمة الله وبركاته انا اريد اعمل نيون يعني ابي اعرف اربط الماركر تحت السياره + يشتغل الماركر عند ضغط الزر ومشكورين ياريت ماكان الطلب طويل
Tete omar Posted July 28, 2012 Posted July 28, 2012 استخدم attachElements عشان تربط شي بشي حتى ولو كان عماره
TAPL Posted July 28, 2012 Posted July 28, 2012 https://wiki.multitheftauto.com/wiki/CreateMarker https://wiki.multitheftauto.com/wiki/AttachElements https://wiki.multitheftauto.com/wiki/GuiCreateButton https://wiki.multitheftauto.com/wiki/OnClientGUIClick https://wiki.multitheftauto.com/wiki/SetElementVisibleTo
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 مشكورين سويت الي اقدر عليه function MarkerHat(button, state, absoluteX, absoluteY) if source == Neoon1 then local Marker = createMarker ( x, y, z, "arrow", 5, 255, 0, 0, 170 ) Marker = createVehicle ( ID, x, y, z + 5 ) attachElements ( Marker, Vehicle, x, y, 2 ) local anotherguy = getPlayerFromName ( "anotherguy" ) setElementVisibleTo ( Marker, anotherguy, true ) end end addEventHandler("onClientGUIClick", root, Marker, MarkerHat, anotherguy )
3NAD Posted July 28, 2012 Posted July 28, 2012 x, y, z انت حاط إختصار لكن وين الككود الأسساسي حقها ؟ local x, y, z = ????
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 x, y, z انت حاط إختصار لكن وين الككود الأسساسي حقها ؟ local x, y, z = ???? مافهمت يابعدي
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 ما يحرمون, برضو , ينقلون من الويكي ياخلي خلنا نتعلم منا مناك افشل مره احاول مره ثانيه مو يأس السالفه
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 (edited) function MarkerHat(button, state, absoluteX, absoluteY) if source == Neoon1 then local Marker = createMarker ( x, y, z, "arrow", 5, 255, 0, 0, 170 ) local ID, x, y, z = Marker = createVehicle ( ID, x, y, z + 5 ) attachElements ( Marker, Vehicle, x, y, 2 ) local anotherguy = getPlayerFromName ( "anotherguy" ) setElementVisibleTo ( Marker, anotherguy, true ) end end addEventHandler("onClientGUIClick", root, Marker, MarkerHat, anotherguy ) هاادا الي تقصده يعناد ؟ Edited July 28, 2012 by Guest
Tete omar Posted July 28, 2012 Posted July 28, 2012 x, y, z انت حاط إختصار لكن وين الككود الأسساسي حقها ؟ local x, y, z = ???? مافهمت يابعدي هنا جيب المنطقة ال position x, y, z
Tete omar Posted July 28, 2012 Posted July 28, 2012 function MarkerHat(button, state, absoluteX, absoluteY) if source == Neoon1 then local Marker = createMarker ( x, y, z, "arrow", 5, 255, 0, 0, 170 ) local x, y, z = Marker = createVehicle ( ID, x, y, z + 5 ) attachElements ( Marker, Vehicle, x, y, 2 ) local anotherguy = getPlayerFromName ( "anotherguy" ) setElementVisibleTo ( Marker, anotherguy, true ) end end addEventHandler("onClientGUIClick", root, Marker, MarkerHat, anotherguy ) هاادا الي تقصده يعناد ؟ غلط X غلط شوف التعليق الي فوق
3NAD Posted July 28, 2012 Posted July 28, 2012 طيب قولي وش الغلط وبحاول اصلحه ذا إيشش ؟؟ local x, y, z = Marker = createVehicle ( ID, x, y, z + 5 ) debugscript 3 أنت لآزمم تججربه بـ سيرفر و تششوف الأخططاء في و تححآول تصلحه بـ نفسسكـ وإذا كآن ششيء صعب تفضضل هنا
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 طيب قولي وش الغلط وبحاول اصلحه ذا إيشش ؟؟ local x, y, z = Marker = createVehicle ( ID, x, y, z + 5 ) debugscript 3 أنت لآزمم تججربه بـ سيرفر و تششوف الأخططاء في و تححآول تصلحه بـ نفسسكـ وإذا كآن ششيء صعب تفضضل هنا اوك
Sora Posted July 28, 2012 Posted July 28, 2012 مشكورين سويت الي اقدر عليه function MarkerHat(button, state, absoluteX, absoluteY) if source == Neoon1 then local Marker = createMarker ( x, y, z, "arrow", 5, 255, 0, 0, 170 ) Marker = createVehicle ( ID, x, y, z + 5 ) attachElements ( Marker, Vehicle, x, y, 2 ) local anotherguy = getPlayerFromName ( "anotherguy" ) setElementVisibleTo ( Marker, anotherguy, true ) end end addEventHandler("onClientGUIClick", root, Marker, MarkerHat, anotherguy ) اخوي الاغلاط الي ب كودك كثيره انا بعطيك كود مع شرح مفصل للعمليات الي فيه local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, 0 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) ملاحظة انا مبرمج مبتدىء هاذي مساعدة بسيطه لين يجي مبرمج محترف ويساعدك إذا لزم الامر
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 اخوي الاغلاط الي ب كودك كثيره انا بعطيك كود مع شرح مفصل للعمليات الي فيه local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, 0 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) ملاحظة انا مبرمج مبتدىء هاذي مساعدة بسيطه لين يجي مبرمج محترف ويساعدك إذا لزم الامر والله ماقصرت خويا جميل وممتاز جدا لاكن واحد يصحح ويخليه تحت السياره
Tete omar Posted July 28, 2012 Posted July 28, 2012 اخوي الاغلاط الي ب كودك كثيره انا بعطيك كود مع شرح مفصل للعمليات الي فيه local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, 0 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) ملاحظة انا مبرمج مبتدىء هاذي مساعدة بسيطه لين يجي مبرمج محترف ويساعدك إذا لزم الامر والله ماقصرت خويا جميل وممتاز جدا لاكن واحد يصحح ويخليه تحت السياره local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, -5 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) هذا يخليه تحت السيارة, بس ما جربته عالعموم هذي الي غيرتها في الكود كله attachElements ( Marker, Vehicle, 0, 0, -5 )
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 اخوي الاغلاط الي ب كودك كثيره انا بعطيك كود مع شرح مفصل للعمليات الي فيه local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, 0 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) ملاحظة انا مبرمج مبتدىء هاذي مساعدة بسيطه لين يجي مبرمج محترف ويساعدك إذا لزم الامر والله ماقصرت خويا جميل وممتاز جدا لاكن واحد يصحح ويخليه تحت السياره local root = getRootElement() function onClick(button, state, absoluteX, absoluteY) if source == Neoon1 then -- اذا ضغط اللاعب على الزر Neoon1 أفعل مايلي local x,y,z = getElementPosition (getLocalPlayer()) -- اخذ مكان (موقع) اللاعب local Marker = createMarker ( x, y, z, "corona", 5, 255, 0, 0, 170 ) -- إنشاء ماركر -- x,y,z مكان الماركر -- 5 حجم الماركر -- 255 اللون الاحمر -- 0 اللون الاخضر -- 0 اللون الازرق -- 170 الوضوح Vehicle = getPedOccupiedVehicle(getLocalPlayer()) -- اخذ سيارة اللاعب attachElements ( Marker, Vehicle, 0, 0, -5 ) -- ربط الماركر بالسيارة setElementVisibleTo ( Marker,root, true ) -- تمكين اللاعبين من رؤيه الماركر end end addEventHandler("onClientGUIClick", root,onClick) هذا يخليه تحت السيارة, بس ما جربته عالعموم هذي الي غيرتها في الكود كله attachElements ( Marker, Vehicle, 0, 0, -5 ) ماينفع يختفي
Joker_Mta Posted July 28, 2012 Author Posted July 28, 2012 هههه يعني مايبين الأحداثيات زايده او ناقصه
Tete omar Posted July 29, 2012 Posted July 29, 2012 أفضل حل function attachMarkerToVehicle ( theVehicle ) -- create the marker to attach local arrowMarker = createMarker ( 0, 0, 0, "arrow", 1.5, 0, 0, 255, 255 ) -- attach the marker above the vehicle attachElements ( arrowMarker, theVehicle, 0, 0, 2 ) -- add an event handler for when the vehicle blows up addEventHandler ( "onVehicleExplode", theVehicle, onMarkedCarExplode ) end function onMarkedCarExplode () -- get the elements attached to the vehicle local attachedElements = getAttachedElements ( source ) -- loop through the table of elements for i,v in ipairs ( attachedElements ) do -- detach the element from the vehicle detachElements ( v, source ) end -- remove the event handler removeEventHandler ( "onVehicleExplode", source, onMarkedCarExplode ) end للمعلومية جايبها من detachElements
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