Jump to content

طلب تصحيح كود


XPro

Recommended Posts

السلام عليكم

ذا الكود

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

يب شف مواضيع القديمة كانو يعطوني الفنكشات و انا اسوي

و شكرا الحين ذكرتو وش هو و بقولك من شروحو لي بضبط من قبل شخص اسمو ادهم

عادي نسيت لان من مده ما سويت شي من برمجة

^_^

Link to comment

كودكك يصير كذا

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

اوك مشكور انا للحين عندي اشياء مو فاهمها مثلا اللوب انا اعرف انه يجيب يعني كل لاعبين السيرفر بس

وش فرقهم بين بعض ذول

for _,v

for i,player

for k,v

يعني في كتير لما اسوي كود كيف اعرف الي استخدمها بضبط زي الي استخدمتها انت الحين

و اعطيني مكان شرحهم زي الويكي يعني

و شكرا على مساعدتك

Link to comment

مشكور اخوي ساعدتني كتير

و اكدلك على شي واحد اعرف انك ظن ان الكود مو لي بس شوف موضعاتي السابقة تفهم اللوب ذا اعطاني ياه جاهز

اما الباقي سويت

Link to comment
مشكور اخوي ساعدتني كتير

و اكدلك على شي واحد اعرف انك ظن ان الكود مو لي بس شوف موضعاتي السابقة تفهم اللوب ذا اعطاني ياه جاهز

اما الباقي سويت

You 're Welcome .

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...