MasterTobi Posted February 4, 2010 Share Posted February 4, 2010 start = createColTube (1978.11328125, -2494.826171875,13,1,5) function startcheck() if (isElementWithinColShape(source ,start)) then end end addEventHandler ( "onElementColShapeHit", getRootElement(), startcheck ) wtf my Server says: " Bad Argument @ isElementwithinColShape " Link to comment
NeonBlack Posted February 4, 2010 Share Posted February 4, 2010 Try printing out the elements' types by using getElementType on start and source. Link to comment
madis Posted February 4, 2010 Share Posted February 4, 2010 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
MasterTobi Posted February 4, 2010 Author Share Posted February 4, 2010 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
madis Posted February 4, 2010 Share Posted February 4, 2010 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
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