كودكك يصير كذا
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 )