Jump to content

اذا كان اللاعب داخل الكول شيب


Saud

Recommended Posts

اذا تبيه يوم يخش الكول شيب لازم يجلس 3 دقائق بالكول شيب عشان تجيه الفلوس !

جرب هذا

ColShape = COL -- بإسم الكول شيب حقك COL استبدل 
Money = 1000 -- استبدل 1000 بالفلوس الي تبي تعطي اللاعب 
addEventHandler("onColShapeHit", root, 
function (    element    ) 
      if source == ColShape then 
          if getElementType(element) == "player" then 
                timer = setTimer( function (    ) 
                if isElementWithinColShape ( element, ColShape ) then 
                    givePlayerMoney( element, Money ) 
                else 
                    return killTimer( timer ) 
                end 
                return killTimer( timer ) 
                end, 1000*60*3, 1  ) 
            end 
       end 
end ) 

 

واذا تبيه كل 3 دقائق يجيب اللاعبين الي بالماركر ويعطيهم فلوس

 

جرب هذا

 

ColShape = COL -- بإسم الكول شيب حقك COL استبدل 
Money = 1000 -- استبدل 1000 بالفلوس الي تبي تعطي اللاعب 
  
setTimer(  
    function(         ) 
         for _, players in ipairs ( getElementsByType("player") ) do 
              if isElementWithinColShape ( players, ColShape ) then 
                     givePlayerMoney( players, Money ) 
             end 
        end 
end, 1000*60*3, 0 ) 

كلها الاكواد سيرفر *

Link to comment

Server Side

col = createColRectangle(x, y, width, height) -- ضع الاحداثيات 
Money = 10000 -- غير المبلغ لو تبي 
  
setTimer(function( ) 
    for k,v in ipairs(getElementsByType("player")) do 
        if isElementWithinColShape(v, col) then 
            givePlayerMoney(v, Money) 
        end 
    end 
end, 60000, 0) 
Link to comment

عليكم السلام

-- Server Side ( not tested ) 
local ColShape = COL -- بإسم الكول شيب حقك COL استبدل 
local Money = 1000 -- استبدل 1000 بالفلوس الي تبي تعطي اللاعب 
local Timer 
  
givePlayersMoney = function ( player, amount ) 
    givePlayerMoney ( player, amount ) 
    outputChatBox ( "* You have got $"..amount, player, 255, 255, 0, true ) 
end 
  
checkColShape = function ( ) 
    local players = getElementsWithinColShape ( ColShape, "player" ) 
    if #players > 0 then 
        for i, v in ipairs ( players ) do 
            givePlayersMoney ( v, tonumber(Money) or 0 ) 
        end 
    else 
        if isTimer ( Timer ) then 
            killTimer ( Timer ) 
        end 
    end 
end 
  
addEventHandler ( "onColShapeHit", ColShape, 
    function ( element ) 
        if getElementType ( element ) == "player" then 
            if not isTimer ( Timer ) then 
                Timer = setTimer ( checkColShape, 60000, 0 ) 
            end 
        end 
    end 
, false ) 

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