Jump to content

(Help) onColShape


Hero192

Recommended Posts

Hello guys,im trying to make an DM system that if a player entred the ColShape he get message "You have entered the DM area" and if he left it he'll have an message with you have left the DM area, i made an code about that but it doesn't working

Here's my code: when i hit the dm zone i dont get anymessage please try to help me out of it

    local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) 
    local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 40, -40, 0, 255, 0, 0 ) -- i want to set it invisible 
      
      
    function hill_Enter ( thePlayer, matchingDimension ) 
            if (getElementType(thePlayer) == "player") then 
                    outputChatBox( "DM system: You have entered the DM Area.", getRootElement(), 255, 255, 109 ) 
            end 
    end 
    addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) 
    function hill_Exit ( thePlayer, matchingDimension ) 
            if (getElementType(thePlayer) == "player") then 
                    if isPedDead ( thePlayer ) ~= true then 
                            outputChatBox ( "DM system:You have left the DM Area.", getRootElement(), 255, 255, 109 ) 
                    end 
            end 
    end 
    addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) 

Link to comment
local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) 
local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 40, -40, 0, 255, 0, 0 ) 
      
function ColEnter ( thePlayer, matchingDimension ) 
    if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
        outputChatBox( "DM system: You have entered the DM Area.",thePlayer, 255, 255, 109 ) 
    end 
end 
addEventHandler ( "onColShapeHit", hillArea, ColEnter ) 
  
function ColExit ( thePlayer, matchingDimension ) 
    if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
        outputChatBox ( "DM system:You have left the DM Area.",thePlayer, 255, 255, 109 ) 
    end 
end 
addEventHandler ( "onColShapeLeave", hillArea,ColExit ) 

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