XPro Posted August 13, 2015 Share Posted August 13, 2015 السلام عليكم ذا الكود local hillArea1 = createColRectangle ( 165.5,399.79998779297,80 , 60 ) local radar1 = createRadarArea ( 165.5,399.79998779297 ,80 , 60, 166, 7, 216, 155 ) local hillArea2 = createColRectangle ( 249.19999694824,434.5,5 , 6 ) local radar2 = createRadarArea ( 249.19999694824,434.5,5 , 6, 166, 7, 216, 155 ) function getPlayersInColShape(col) local players = 0 if col and getElementType(col) == "colshape" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player,col) then players = players + 1 end end end return players end function hillEnter1 ( thePlayer )--- ذا شغال if (getElementType(thePlayer) == "player") then if (getPlayersInColShape( hillArea1 ) >= 3 ) then moveObject ( T1, 1500, 249.5,437.20001220703,4.0999999046326 ) end end end addEventHandler ( 'onColShapeHit', hillArea1, hillEnter1 ) function hillEnter2 ( thePlayer )---- ذا لا if (getElementType(thePlayer) == "player") then if (getPlayersInColShape( hillArea1 ) >= 3 ) and getPlayersInColShape( hillArea2 ) then setElementHealth (thePlayer,0) end end end addEventHandler ( 'onColShapeHit', hillArea2, hillEnter2 ) الكود هو لو تعرف على عدد الاعبين في الكود شيب 1 عددهم 3 يغلق باب ذا تمام الكود الثاني لوو تعرف على عدد الاعبين الي داخل الكول شيب 1 عددهم 3 هنا يروح يشوف اذا لاقي لاعبين داخل الكول شيب 2 يقتلهم ارجو التصحيح Link to comment
iMr.SFA7 Posted August 13, 2015 Share Posted August 13, 2015 سوي لوب واستخدم فيه كودك ذا getPlayersInColShape وأنصحكك بدل ما تحط دمهم صفر أستخدم killPed Link to comment
XPro Posted August 13, 2015 Author Share Posted August 13, 2015 وش تقصد باللوب قوله انجليزي عادي لا تعطيني الكود قولي بس وش تقصد باللوب و انا اصحح Link to comment
XPro Posted August 13, 2015 Author Share Posted August 13, 2015 يب شف مواضيع القديمة كانو يعطوني الفنكشات و انا اسوي و شكرا الحين ذكرتو وش هو و بقولك من شروحو لي بضبط من قبل شخص اسمو ادهم عادي نسيت لان من مده ما سويت شي من برمجة Link to comment
iMr.SFA7 Posted August 13, 2015 Share Posted August 13, 2015 كودكك يصير كذا local hillArea1 = createColRectangle ( 165.5,399.79998779297,80 , 60 ) local radar1 = createRadarArea ( 165.5,399.79998779297 ,80 , 60, 166, 7, 216, 155 ) local hillArea2 = createColRectangle ( 249.19999694824,434.5,5 , 6 ) local radar2 = createRadarArea ( 249.19999694824,434.5,5 , 6, 166, 7, 216, 155 ) function getPlayersInColShape(col) local players = 0 if col and getElementType(col) == "colshape" then for i,player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player,col) then players = players + 1 end end end return players end function hillEnter1 ( thePlayer )--- ذا شغال if (getElementType(thePlayer) == "player") then if (getPlayersInColShape( hillArea1 ) >= 3 ) then moveObject ( T1, 1500, 249.5,437.20001220703,4.0999999046326 ) end end end addEventHandler ( 'onColShapeHit', hillArea1, hillEnter1 ) function hillEnter2 ( thePlayer )---- ذا لا if (getElementType(thePlayer) == "player") then if (getPlayersInColShape( hillArea1 ) >= 3 ) then for _,v in ipairs(getPlayersInColShape(hillArea2)) do killPed ( v ) end end end addEventHandler ( 'onColShapeHit', hillArea2, hillEnter2 ) Link to comment
XPro Posted August 13, 2015 Author Share Posted August 13, 2015 اوك مشكور انا للحين عندي اشياء مو فاهمها مثلا اللوب انا اعرف انه يجيب يعني كل لاعبين السيرفر بس وش فرقهم بين بعض ذول for _,v for i,player for k,v يعني في كتير لما اسوي كود كيف اعرف الي استخدمها بضبط زي الي استخدمتها انت الحين و اعطيني مكان شرحهم زي الويكي يعني و شكرا على مساعدتك Link to comment
iMr.SFA7 Posted August 13, 2015 Share Posted August 13, 2015 اللوب تجيب به اي شيء موب اللاعبين بس مافي فرق من انك تحط k,v او i,v تقدر تحط اي شيء بدالهم k = المفتاح v = القيمة viewtopic.php?f=160&t=84626 Link to comment
XPro Posted August 13, 2015 Author Share Posted August 13, 2015 مشكور اخوي ساعدتني كتير و اكدلك على شي واحد اعرف انك ظن ان الكود مو لي بس شوف موضعاتي السابقة تفهم اللوب ذا اعطاني ياه جاهز اما الباقي سويت Link to comment
iMr.SFA7 Posted August 13, 2015 Share Posted August 13, 2015 مشكور اخوي ساعدتني كتيرو اكدلك على شي واحد اعرف انك ظن ان الكود مو لي بس شوف موضعاتي السابقة تفهم اللوب ذا اعطاني ياه جاهز اما الباقي سويت 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