Mr.Mostafa Posted August 20, 2018 Share Posted August 20, 2018 سلام عليكم آلحين آنآ آبي لو كتبت كومآند يسوي مآركر , ولو دخلت آلمآركر هآدآ يطلع آسم آلي دخل فيه آلمشكلة كيف آعرف آلمآركر ؟؟ addCommandHandler("mark", function ( player ) local x,y,z = getElementPosition( player ) local testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function( hiter ) if source == testMarker then outputChatBox(""..getPlayerName(hiter).." joined to marker",root,0,255,0,true) end end ) Link to comment
N3xT Posted August 20, 2018 Share Posted August 20, 2018 شيل اللوكل اللي قبل اسم الماركر Link to comment
Mr.Mostafa Posted August 20, 2018 Author Share Posted August 20, 2018 17 minutes ago, N3xT said: شيل اللوكل اللي قبل اسم الماركر يب بعدين؟ كيف بعرف آلمآركر؟ Link to comment
Berko Posted August 20, 2018 Share Posted August 20, 2018 12 minutes ago, Mr.Mostafa said: سلام عليكم آلحين آنآ آبي لو كتبت كومآند يسوي مآركر , ولو دخلت آلمآركر هآدآ يطلع آسم آلي دخل فيه آلمشكلة كيف آعرف آلمآركر ؟؟ addCommandHandler("mark", function ( player ) local x,y,z = getElementPosition( player ) local testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function( hiter ) if source == testMarker then outputChatBox(""..getPlayerName(hiter).." joined to marker",root,0,255,0,true) end end ) addCommandHandler("mark", function ( player ) local x,y,z = getElementPosition(player) local testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function ( hit ) outputChatBox(""..getPlayerName(hit).." joined to marker",player,0,255,0,true) end ) تفضل Link to comment
Mr.Mostafa Posted August 20, 2018 Author Share Posted August 20, 2018 34 minutes ago, Berko said: addCommandHandler("mark", function ( player ) local x,y,z = getElementPosition(player) local testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function ( hit ) outputChatBox(""..getPlayerName(hit).." joined to marker",player,0,255,0,true) end ) تفضل يب بس انت الحين ما عرفت اي ماركر الي الاعب دخله افرض انا ابي اسوي اكتر من ماركر Link to comment
iMr.WiFi..! Posted August 20, 2018 Share Posted August 20, 2018 1 hour ago, Mr.Mostafa said: يب بعدين؟ كيف بعرف آلمآركر؟ ي حبيب قلبي , لما تسوي اللوكال التعريف راح ينحصر داخل الوظيفة الي تم وضع فيه التعريف بس بدون اللوكال التعريف بيكون عام والجميع بيقدر يتعرف عليه .. 1 Link to comment
TAPL Posted August 20, 2018 Share Posted August 20, 2018 2 hours ago, Mr.Mostafa said: يب بس انت الحين ما عرفت اي ماركر الي الاعب دخله افرض انا ابي اسوي اكتر من ماركر استخدم جدول Link to comment
+Source|> Posted August 20, 2018 Share Posted August 20, 2018 3 hours ago, TAPL said: استخدم جدول +1 Link to comment
KillerX Posted August 20, 2018 Share Posted August 20, 2018 (edited) 5 hours ago, Berko said: addCommandHandler("mark", function ( player ) local x,y,z = getElementPosition(player) local testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function ( hit ) outputChatBox(""..getPlayerName(hit).." joined to marker",player,0,255,0,true) end ) تفضل اول شئ مسوي الماركر لوكل ثاني شئ في الاوتبوت شات بوكس مسوي player في الحاله دي player = nil لانوا مو معرف addCommandHandler("mark", function ( player ) x,y,z = getElementPosition(player) testMarker = createMarker ( x,y,z -1, "cylinder", 1.5, 255, 255, 0, 170 ) outputChatBox("done create marker",player,0,255,0,true) end ) addEventHandler( "onMarkerHit", root, function ( hit ) if source == testMarker then outputChatBox(getPlayerName(hit).." joined to marker",hit,0,255,0,true) end end ) Edited August 20, 2018 by KillerX 1 Link to comment
Abdul KariM Posted August 20, 2018 Share Posted August 20, 2018 ضيف حدث دخول الماركر تحت وظيفة انشاء الماركر Link to comment
^iiEcoo'x_) Posted August 20, 2018 Share Posted August 20, 2018 (edited) addCommandHandler ( 'Marker' , function ( Player ) Marker = createMarker ( Vector3 ( getElementPosition ( Player ) ) , 'arrow' ) addEventHandler ( 'onMarkerHit' , Marker , function ( Hit ) outputChatBox ( getElementType ( Hit ) ) end , false ) end ) Edited August 20, 2018 by #_iMr,[E]coo Link to comment
Rockyz Posted August 20, 2018 Share Posted August 20, 2018 21 minutes ago, #_iMr,[E]coo said: addCommandHandler ( 'Marker' , function ( Player ) Marker = createMarker ( Vector3 ( getElementPosition ( Player ) ) , 'arrow' ) addEventHandler ( 'onMarkerHit' , Marker , function ( Hit ) outputChatBox ( getElementType ( Hit ) ) end , false ) end ) مايحتاج اكثر من افنت واحد ولا يحتاج جداول تقدرون تسوون كذا بكل بساطة: local markersParent = createElement('markersParent'); addCommandHandler('mark', function(player) local x, y, z = getElementPosition(player) local testMarker = createMarker(x, y, z -1, 'cylinder', 1.5, 255, 255, 0, 170) setElementParent(testMarker, markersParent) outputChatBox('done create marker', player, 0, 255, 0, true) end) addEventHandler('onMarkerHit', markersParent, function(hiter) if isElement(hiter) and getElementType(hiter) == 'player' then outputChatBox(getPlayerName(hiter)..' joined to marker', root, 0, 255, 0, true) end end) 1 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