I want to get vehicles colShape and if the vehicles colshape hits the cuboid it should display "hit"!
cuboid = createColCuboid ( 2043.2, -2608, 12.6, 0.4, 13.5, 1 )
function test()
veh = getPedOccupiedVehicle( source )
setElementCollisionsEnabled ( veh, true )
col1 = getElementColShape( veh )
end
addEventHandler("onPlayerVehicleEnter", getRootElement(), test)
function hit1( box )
if (box == cuboid) then
if (isElementWithinColShape (col1 , cuboid) == true) then
outputChatBox("hit", root)
end
end
end
addEventHandler ("onElementColShapeHit", getRootElement(), hit1)