Jump to content

???? WTF isElementWithinColShape


MasterTobi

Recommended Posts

You're doing it wrong.

start = createColTube(1978.11328125, -2494.826171875, 13, 1, 5)
 
function startcheck(colShape)
-- source is the player, vehicle etc
 
if colShape == start then
if (isElementWithinColShape(source ,start)) then
 
end
end
end
 
addEventHandler("onElementColShapeHit", getRootElement(), startcheck)

Link to comment

hm mom

why go this code ?

stadt= createMarker (1219, -1812, 16,"arrow", 1.5, 255, 255, 0, 170 )
stadtin= createColCircle (1219, -1812,2)
stadtout =createColCircle (288,167, 2)
stadto= createMarker (288,167,1007,"arrow", 1.5, 255, 255, 0, 170 )
 
function stadt()
if  (isElementWithinColShape(source,stadtin)) then
setElementInterior(source,3, 	  	288.745971,169.350997,1007.171875   )
end
 
if  (isElementWithinColShape(source,stadtout))then
setElementInterior ( source,0, 1223.9,-1817.09,16.6 )
end
 
end
addEventHandler( "onElementColShapeHit", getRootElement(), stadt )

;)

Link to comment

Yeah, it's quite interesting when the code is going somewhere, though I'm not sure about it's personal life, I always suspect there must be opposite sex code to go to.

Anyway, your issue is that you should add the first argument to the handler function, which is the collision that was hit, so you don't even have to use isElementWithinColShape.

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