Jump to content

ColShapeLeave


Axel

Recommended Posts

So, i want to make a huge colshape over LS and when someone leaves it, they get killed..

colArea = createColRectangle( 41.2666015625, -2812.1865234375,2900,2200 )  
setElementDimension(colArea,0) 
setElementInterior(colArea,0) 
  
function elementColShapeLeave( colShapeLeft ) 
    if colShapeLeft == colArea then  
        outputChatBox( "Nu ai voie sa iesi din LS!",source,255,255,255 )  
        killPed ( source) 
    end 
end 
addEventHandler( "onElementColShapeLeave", getRootElement(), elementColShapeLeave ) 

The problem is that when someone goes in some interiors they get killed..

Link to comment
colArea = createColRectangle( 41.2666015625, -2812.1865234375,2900,2200 ) 
setElementDimension(colArea,0) 
setElementInterior(colArea,0) 
  
function elementColShapeLeave( colShapeLeft ) 
    if colShapeLeft == colArea and getElementInterior(source) == 0 then 
        outputChatBox( "Nu ai voie sa iesi din LS!",source,255,255,255 ) 
        killPed ( source) 
    end 
end 
addEventHandler( "onElementColShapeLeave", getRootElement(), elementColShapeLeave ) 

Link to comment
uShapeArea = createColRectangle( 41.2666015625, -2812.1865234375, 2900, 2200 )  
setElementDimension( uShapeArea,0 ) 
setElementInterior( uShapeArea,0 ) 
  
function fLeaveShape( uShape, bDim ) 
    if uShape == uShapeArea and bDim and getElementInterior( source ) == 0  then  
        outputChatBox( "Nu ai voie sa iesi din LS!", source, 255, 255, 255 )  
        killPed ( source ) 
    end 
end 
addEventHandler( 'onElementColShapeLeave', root, fLeaveShape ) 

Edited by Guest
Link to comment
uShapeArea = createColRectangle( 41.2666015625, -2812.1865234375, 2900, 2200 ) 
setElementDimension( uShapeArea,0 ) 
setElementInterior( uShapeArea,0 ) 
  
function fLeaveShape( uShape, bDim ) 
    setTimer(function(source) 
         if uShape == uShapeArea and bDim and getElementInterior( source ) == 0  then 
             outputChatBox( "Nu ai voie sa iesi din LS!", source, 255, 255, 255 ) 
             killPed ( source ) 
         end 
     
    end, 2000, 1,source) 
end 
addEventHandler( 'onElementColShapeLeave', root, fLeaveShape ) 

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