حسب ما فهمت إنه جري بين اللاعبين !
local aTable_ = { }
local aMarker_ = createMarker ( ... )
local aMissionJoin_ = false
function openMission_ ( )
local aTimer_ = setTimer ( function ( )
outputChatBox ( ' Mission Has Been Opend ' , root )
aMissionJoin = true
end , 1000*60*5 , 1 )
end
openMission_ ( )
function getPlayerTable(player, Table)
for i, v in ipairs (Table) do
if (v == player) then
return true
end
end
end
addEventHandler ( 'onMarkerHit' , root ,
function ( aPlayer_ )
if ( source == aMarker_ ) then
if ( getElementType ( aPlayer_ ) == 'player' ) and ( not isPedInVehicle ( aPlayer ) ) then
if ( aMissionJoin_ == false ) then return outputChatBox ( ' Mission Close ' , aPlayer_ ) end
table.insert ( aTable_ , aPlayer_ )
setElementPosition ( aPlayer_ , x , y , z )
setElementFrozen ( aPlayer_ , true )
outputChatBox ( ' Your Join To Mission ', aPlayer_ )
setTimer ( function ( )
for _ , v in ipairs ( getElementsByType ( 'player' ) ) do
if ( getPlayerTable ( v , aTable_ ) ) then
setElementFrozen ( v , false )
outputChatBox ( ' Mission Started ' , root )
setElementData ( aMarker2_ , 'Data' , false )
aMissionJoin_ = false
end
end
end , 1000*30 , 1 )
end
end
end
)
local aMarker2_ = createMarker ( ... )
setElementData ( aMarker2_ , 'Data' , true )
addEventHandler ( 'onMarkerHit' , root ,
function ( aPlayer_ )
if ( source == aMarker2_ ) then
if ( getElementType ( aPlayer_ ) == 'player' ) and ( not isPedInVehicle ( aPlayer ) ) then
if ( getElementData ( aMarker2_ , 'Data' ) == true ) then return end
givePlayerMoney ( aPlayer_ , 1000 )
setElementData ( aMarker2_ , 'Data' , true )
outputChatBox ( ' * [ '.. getPlayerName ( aPlayer_ ) .. ' ] فاز في المهمة ' , root )
for _ , v in ipairs ( getElementsByType ( 'player' ) ) do
if ( getPlayerTable ( v , aTable_ ) ) then
table.remove ( aTable , v )
killPed ( v )
end
end
openMission_ ( )
end
end
end
)