Axel Posted March 8, 2012 Share Posted March 8, 2012 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
JR10 Posted March 8, 2012 Share Posted March 8, 2012 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
Kenix Posted March 8, 2012 Share Posted March 8, 2012 (edited) 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 March 8, 2012 by Guest Link to comment
Axel Posted March 8, 2012 Author Share Posted March 8, 2012 Hmm.. now when i warp to a player that is in an interior i get killed.. Is there a way to fix that? Link to comment
JR10 Posted March 8, 2012 Share Posted March 8, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now