KinG_DrifT Posted July 13, 2013 Share Posted July 13, 2013 السلام عليكم شباب ابي اعرف كيف ياخذ التيم, اذا كان هذا التيم يقدر ياخذ الماركر اما اذا كان في تيم ثاني مايقدر ---- وابي كيف اخلي ماركر مايطلع الا لشخص واحد, اللى ضغط الزر Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 getPlayerTeam getTeamName + الماركر بس للي ضغط الزر حسب ما اعرف ما تقدر , Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 طيب, انا عارف اني استخدم هـ الكودين , بسس ماعرف كيف ترتيبهم؟ ممكن تشرح لي؟ Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 if getPlayerTeam(element) and (getTeamName(getPlayerTeam(element)) == 'TeamName' ) then element = على حسب الفنكشن , ان كان كلنت والفنكشن فاضي - funtion() - فـ تحط localPlayer TeamName = اسم التيم, Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 يَ لببى قللبكك, بسس عندي سؤال, خارج عن التيم ض1 اذا لاعب ضغط الزر, ابيه مايقدر يضغطه مرة ثانية الا اذا طلع من تيم معين Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 سوي حدث , onClientGUIClick وتحقق من التيم قبل ما يضغط الزر , واذا ضغط الزر سوي , guiSetEnabled وسوي مخالفه للشرط - else وسوي تحقق , if not getPlayerTeam.... وسوي guiSetEnabled Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 getPlayerTeam(source) Bad Argument Link to comment
AHMAD1234 Posted July 13, 2013 Share Posted July 13, 2013 if ( getTeamName( getPlayerTeam( source ) ) == "اسم الفريق" ) then Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 getPlayerTeam(source) Bad Argument السورس معرف ؟ Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 (edited) شوف هذا المثال , local marker = createMarker(...) -- نسوي ماركر # addEventHandler('onMarkerHit',marker, -- اذا لمس الماركر # function(player) -- نظيف العنصر للفنكشن # if getElementType(player) == 'player' then -- نعرف العنصر انه لاعب # if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Blue' ) then -- تحقق اذا كان اللاعب في الفريق # (Blue) setElementPosition(player,x,y,z) -- نرسله لإحداثيات محدده # end -- اغلاق # end -- اغلاق # end,false -- اغلاق # ) -- اغلاق # اذا تبي الي لمس الماركر يكون اللاعب لازم تتحقق , والسورس على حسب الايفنت , نشوف السورس حق onMarkerHit : The source of this event is the marker that got hit by the element. يعني السورس هو الماركر الي انلمس على كذا لازم نعرف اللاعب ذذ, مثال ثاني , addEventHandler('onPlayerWasted',root, -- اذا مات اللاعب # function() -- وظيفه # if getPlayerTeam(source) and (getTeamName(getPlayerTeam(source)) == 'Grove') then -- نتحقق اذا اللاعب في التيم (Grove) # setPlayerTeam(source ,nil) -- نحذف اللاعب من التيم # end -- اغلاق # end -- اغلاق # ) -- اغلاق # هنا السورس هو اللاعب الي مات , كيف عرفت ؟ نشوف الايفنت onPlayerWasted : The source of this event is the player that died or got killed. إن شاء الله فهمت , Edited July 13, 2013 by Guest Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 "onClientGUIClick" --The source of this event is the GUI element that was clicked. يعني احط اسم الزر؟ لان هو قال حط اسم العنصر الى انضغط ض1 Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 مو شرط يكون زر , يمكن يكون جريد ليست او لبل او زر او صوره ...الخ, وتقدر تستخدمه بطريقتين , الطريقه الاولى اذا كان ما معك الا زر واحد فقط , addEventHandler('onClientGUIClick',Button, -- اذا ضغط على الزر # function() -- وظيفه # -- كودك # end,false -- اغلاق # ) -- اغلاق # الطريقه الثانيه اذا كان عندك مثلا اكثر من زر , مثال مثلا عندك زر وصوره وما تبي تكرر الحدث , addEventHandler('onClientGUIClick',root, -- اذا ضغط على العنصر # function() if source == Button then -- اذا ضغط على العنصر وهو الزر # -- كودك # elseif source == Image then -- اذا ضغط على الصوره # -- كودك # end -- اغلاق # end -- اغلاق # ) -- اغلاق # Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 طيب وش احط هنا؟ addEventHandler ( "onClientGUIClick", root, function() if source == GUIEditor.button[1] then if getPlayerTeam(source) and (getTeamName(getPlayerTeam(source)) == 'Civilian' ) then --وشش احط هنا؟؟؟؟ guiSetEnabled ( GUIEditor.window[1], false ) else if not getPlayerTeam(source) == 'Civilian' then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end end end end Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 آسف غلطت ذذ , ما يحتاج تحط if not... + تبي تجيب تيم الزر .؟ addEventHandler ( "onClientGUIClick", root, function() if source == GUIEditor.button[1] then if getPlayerTeam(localPlayer) and (getTeamName(getPlayerTeam(localPlayer)) == 'Civilian' ) then guiSetEnabled ( GUIEditor.window[1], false ) else guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) guiSetEnabled ( GUIEditor.window[1], true ) end end end ) + كذا اذا ضغط الزر راح يتقفل , واذا كان مو في التيم راح ينفتح الزر وتختفي النافذه ويختفي السهم ( الماوس) Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 (edited) هذا الكود كامل, مو عارف له job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) function showUserPanel ( hitPlayer ) if hitPlayer == localPlayer then if guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) else guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) if getPlayerTeam(localPlayer) and (getTeamName(getPlayerTeam(localPlayer)) == 'Civilian' ) then guiSetEnabled ( GUIEditor.window[1], false ) showCursor ( false ) end end end end addEventHandler ( "onClientMarkerHit", job, showUserPanel ) Edited July 13, 2013 by Guest Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 وش تبي تسوي بالضبط؟ لان الكود ملخبط حدث بدون فنكشن ... Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 ارجع شوف الكود, انا عطيتك كود ثاني ماله دخل, الكود هذا ابيه مايطلع النافذ اذا كان مو في تيم Clivian Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 الي فهمته انك تبي النافذه اذا لمس الماركر ما تفتح الا لتيم محدد , job = createMarker ( -2168.5, 243.39999389648, 34.299999237061, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler('onClientMarkerHit',job, function(player) if player == localPlayer then if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'Clivian') then if not guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) else outputChatBox('* You Must be in team (Clivian) ') end end end end,false ) Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 عندي تيم ,اذا ضغطت زر يدخلك هـ التيم, ابي اللي داخل هـ التيم مايقدر يدخل الماركر مرة ثانية Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 نفسها , انت سوي تحقق , اذا مثلا اللاعب في تيم محدد , if getPlayerTeam(player) and (getTeamName(getPlayerTeam(player)) == 'اسم الفريق') then return end وبكذا ما راح ينفذ الوظيفه , طبعا player على حسب الفنكشن او الايفنت مثل ما قلت لك ذذ اما اذا كان قصدك انه تبيه اول مره يدخل ينفذ الوظيفه ومره ثانيه يدخل ما ينفذها , فـ استخدم الداتا, setElementData getElementData Link to comment
KinG_DrifT Posted July 13, 2013 Author Share Posted July 13, 2013 You're The Best <3 Thank you very much ! :] Link to comment
فاّرس Posted July 13, 2013 Share Posted July 13, 2013 You're The Best <3Thank you very much ! :] You're welcome 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