AhmeD~9MoD Posted June 7, 2013 Posted June 7, 2013 (edited) السلام عليكم .. اليوم حبيت اسوي شرح للمبتدئين في موضوع اختصار حدث onClientGUIClick نبدي على بركة لله : اول شي نسوي الحدث onClientGUIClick ثم نخلي الوظيفة addEventHandler ( "onClientGUIClick", root, -- حدث function () -- وظيفة بعدين نسوي لكل زر تحقق اول زر if ثاني زر و الباقي كامل يكونون كذا elseif addEventHandler ( "onClientGUIClick", root, -- حدث function () -- وظيفة if source == GUIEditor.staticimage[4] then -- تحقق طبعاً لكل تحقق اند .. بس elseif مالها اند مثال : addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end -- اند if end -- اند الوظيفة ) او addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) end -- اند if elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end -- اند الوظيفة ) اتمنى ان الشرح مفهوم .. وان المعلومة وصلت تحياتي Edited June 7, 2013 by Guest
فاّرس Posted June 7, 2013 Posted June 7, 2013 لول؟ غلطان ي حلو ! if يحتاج اند, بس elseif ما يحتاج, لانهم حطوا elseif تكون اختصار, Sha67 سابقاً
AhmeD~9MoD Posted June 7, 2013 Author Posted June 7, 2013 لول؟غلطان ي حلو ! if يحتاج اند, بس elseif ما يحتاج, لانهم حطوا elseif تكون اختصار, مافهمت ؟ قصدك ان elseif ماتحتاج اند ولا وش بالضبط ؟؟
فاّرس Posted June 7, 2013 Posted June 7, 2013 ايه ما تحتاج ! اكوادك تصير كذآ , addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end end) addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) end elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end) Sha67 سابقاً
Booo Posted June 8, 2013 Posted June 8, 2013 وعليكم السلام ورحمة الله وبركاته بيض الله وجهك على الشرح تم التعديل ^ + Thx ^.^ إمسح الكود هذا لإنه خطآ addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) end elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end) تذكر عند تصفحك للأنترنت قوله تعالى: (( وهو معكم أين ما كنتم والله بما تعملون بصير )) ا
AhmeD~9MoD Posted June 8, 2013 Author Posted June 8, 2013 وعليكم السلام ورحمة الله وبركاتهبيض الله وجهك على الشرح تم التعديل ^ + Thx ^.^ إمسح الكود هذا لإنه خطآ addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) end elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end) ذا ؟ addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) end -- اند if elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end -- اند الوظيفة )
AhmeD~9MoD Posted June 8, 2013 Author Posted June 8, 2013 ملاحظة ي شباب : الرجاء عدم نسخ الكودات الي في الموضوع فقط خذها كـ مثال , اتمنى عدم استعمالها ... وشكراً
فاّرس Posted June 8, 2013 Posted June 8, 2013 بدل اكوادك بـ هذي , -- Client Side # ThePositions = { -- الاحداثيات (جدول) # [1] = { 1382.1093,9421.13953,10.2942 }, [2] = { 1992.1928,9382.10392,50.1928 }, [3] = { 1928.2901,1834.2729,1.19372 } } addEventHandler("onClientGUIClick",button, -- اذا ضغط على الزر # function() -- وظيفه PosX,PosY,PosZ = unpack(ThePositions[math.random(#ThePositions)]) -- نحضر جميع القيم داخل الجدول ونخليها عشوائيه # setElementPosition(localPlayer,PosX,PosY,PosZ) -- اختيار عشوائي للانتقال # end -- اغلاق # ) -- اغلاق # -- مثال ثآني -- -- Client Side # addEventHandler("onClientGUIClick",button, -- اذا ضغط على الزر # function() -- وظيفه for i,v in ipairs (getElementsByType ("player")) do -- نجيب جميع اللاعبين ونضيفها للوب # setElementCollidableWith(localPlayer,v,false) -- نخلي اللاعب مخفي عند الكل (Ghost) # end -- اغلاق # end -- اغلاق # ) -- اغلاق # Sha67 سابقاً
AhmeD~9MoD Posted June 9, 2013 Author Posted June 9, 2013 بدل اكوادك بـ هذي , -- Client Side # ThePositions = { -- الاحداثيات (جدول) # [1] = { 1382.1093,9421.13953,10.2942 }, [2] = { 1992.1928,9382.10392,50.1928 }, [3] = { 1928.2901,1834.2729,1.19372 } } addEventHandler("onClientGUIClick",button, -- اذا ضغط على الزر # function() -- وظيفه PosX,PosY,PosZ = unpack(ThePositions[math.random(#ThePositions)]) -- نحضر جميع القيم داخل الجدول ونخليها عشوائيه # setElementPosition(localPlayer,PosX,PosY,PosZ) -- اختيار عشوائي للانتقال # end -- اغلاق # ) -- اغلاق # -- مثال ثآني -- -- Client Side # addEventHandler("onClientGUIClick",button, -- اذا ضغط على الزر # function() -- وظيفه for i,v in ipairs (getElementsByType ("player")) do -- نجيب جميع اللاعبين ونضيفها للوب # setElementCollidableWith(localPlayer,v,false) -- نخلي اللاعب مخفي عند الكل (Ghost) # end -- اغلاق # end -- اغلاق # ) -- اغلاق # انا قصدي اختصار , كذا تسوي لكل زر كود , قصدي ان اجمع كل الازرار في حدث واااحد + لاتركز على الاخطاء في الكود الفهم في السآلفة كيف تختصر الازرار وتخليهم في كود واحد وخلاص
./BlackBird# Posted June 17, 2013 Posted June 17, 2013 ذا ؟ addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[1] then outputChatBox("تم ادخالك إلى عصابة 1",255,0,0,true) triggerServerEvent("Setting",localPlayer) elseif source == GUIEditor.button[2] then outputChatBox("تم ادخالك إلى عصابة 2",255,0,0,true) triggerServerEvent("Setting2",localPlayer) elseif source == GUIEditor.button[3] then outputChatBox("تم ادخالك إلى عصابة 3",255,0,0,true) triggerServerEvent("Setting3",localPlayer) end -- if اند الـ end -- اند الوظيفة ) #~BlackBird~#
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