Jump to content

فكشنات


Recommended Posts

السلام عليكم

شباب ممكن فاكشنات

مثلا اذا ذهبت الى ماركر يدخلني للمهمة والمهمة عبارة عن سباق توصل للماركر انت الاول تربح وتأخذ فلوس

والماركر اللي يدخل للمهمة يبدأ كل 5 دقائق

وشكرا

Link to comment

حسب ما فهمت إنه جري بين اللاعبين !

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
)

 

Link to comment
23 hours ago, #_iMr.[E]coo said:

حسب ما فهمت إنه جري بين اللاعبين !


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
)

 

ناسي إيند لـ سطر 57 :": 
@#_iMr.[E]coo

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...