Jump to content

تعديل كود


CRoW,,#

Recommended Posts

 Position = { 
                [1] = { 2066.60107, 1538.43542, 10.67188 }; 
                [2] = { 2080.86279, 1583.23364, 10.82031 }; 
                [3] = { 2072.40479, 1596.27515, 10.67188 }; 
                [4] = { 2064.46460, 1605.78015, 10.67188 }; 
                [5] = { 2051.22852, 1600.26282, 10.67188 }; 
            }; 
             
setTimer(function() 
local x, y, z = unpack ( Position [ math.random ( #Position ) ] ) 
pickup =  createPickup ( x, y, z, 3, 1274, 300000 ) 
attachElements ( blip, pickup ) 
 end, 1000, 1)           
  
  
addEventHandler ( "onPickupHit", pickup, 
    function ( player ) 
        givePlayerMoney( player, math.random ( 150, 300 ) )   
        destroyElement ( blip ) 
    end 
) 
  
addEventHandler ( "onPickupSpawn", pickup, 
    function ( ) 
        blip  =  createBlip ( 0, 0, 0, 52 ) 
        attachElements ( blip, pickup ) 
    end 
) 

الحين انا ابي البيك اب الثاني ما ينزل الا اذا واحد اخذ الاول

Link to comment

     Position = { 
                    [1] = { 2066.60107, 1538.43542, 10.67188 }; 
                    [2] = { 2080.86279, 1583.23364, 10.82031 }; 
                    [3] = { 2072.40479, 1596.27515, 10.67188 }; 
                    [4] = { 2064.46460, 1605.78015, 10.67188 }; 
                    [5] = { 2051.22852, 1600.26282, 10.67188 }; 
                }; 
                
    setTimer(function() 
    local x, y, z = unpack ( Position [ math.random ( #Position ) ] ) 
    pickup =  createPickup ( x, y, z, 3, 1274, 300000 ) 
    blip  =  createBlip ( 0, 0, 0, 52 ) 
    attachElements ( blip, pickup ) 
     end, 1000, 1)          
      
      
    addEventHandler ( "onPickupHit", pickup, 
        function ( player ) 
            givePlayerMoney( player, math.random ( 150, 300 ) )   
            destroyElement ( blip ) 
            destroyElement ( pickup ) 
            pickup1 =  createPickup ( x, y, z, 3, 1254, 300000 ) 
            blip2  =  createBlip ( x, y, z, 0, 0, 23 ) 
            attachElements ( blip2, pickup2 ) 
        end 
    ) 

غير مجرب ذذ

Link to comment
يعني تبية يعيد نفس الوظيفة ولا وظيفة جديدة للبيك اب الثاني؟

يعيد نفس الوظيفةة

مثلا اذا جا بيك اب وواحد اخذه

يختفي ويجي واحد ثاني وواحد ياخذ ويختفي وهكذا ..

Link to comment
addEventHandler( 'onResourceStart', resourceRoot, 
    function( ) 
        ceratePic( ) 
    end 
) 
  
aPos =  
{ 
    [1] = { 2066.60107, 1538.43542, 10.67188 }; 
    [2] = { 2080.86279, 1583.23364, 10.82031 }; 
    [3] = { 2072.40479, 1596.27515, 10.67188 }; 
    [4] = { 2064.46460, 1605.78015, 10.67188 }; 
    [5] = { 2051.22852, 1600.26282, 10.67188 }; 
} 
  
function ceratePic( ) 
    -- 
    local aX, aY, aZ = unpack( aPos[math.random( #aPos )] ) 
    local aPickup = createPickup( aX, aY, aZ, 3, 1274 ) 
    local aBlip = createBlipAttachedTo( aPickup, 52 ) 
    -- 
    addEventHandler( 'onPickupHit', aPickup, 
        function ( aPlayer ) 
            givePlayerMoney( aPlayer, math.random ( 150, 300 ) ) 
            if isElement( aPickup ) then destroyElement( aPickup ) end 
            if isElement( aBlip ) then destroyElement( aBlip ) end 
            ceratePic( ) 
        end   
    ) 
end 

Link to comment
addEventHandler( 'onResourceStart', resourceRoot, 
    function( ) 
        ceratePic( ) 
    end 
) 
  
aPos =  
{ 
    [1] = { 2066.60107, 1538.43542, 10.67188 }; 
    [2] = { 2080.86279, 1583.23364, 10.82031 }; 
    [3] = { 2072.40479, 1596.27515, 10.67188 }; 
    [4] = { 2064.46460, 1605.78015, 10.67188 }; 
    [5] = { 2051.22852, 1600.26282, 10.67188 }; 
} 
  
function ceratePic( ) 
    -- 
    local aX, aY, aZ = unpack( aPos[math.random( #aPos )] ) 
    local aPickup = createPickup( aX, aY, aZ, 3, 1274 ) 
    local aBlip = createBlipAttachedTo( aPickup, 52 ) 
    -- 
    addEventHandler( 'onPickupHit', aPickup, 
        function ( aPlayer ) 
            givePlayerMoney( aPlayer, math.random ( 150, 300 ) ) 
            if isElement( aPickup ) then destroyElement( aPickup ) end 
            if isElement( aBlip ) then destroyElement( aBlip ) end 
            ceratePic( ) 
        end   
    ) 
end 

يعطيكك الف عافيةةة ,,

ما قصرت يالغلاا ..

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