Public feed
#722157
root = getRootElement ()function vehicleDrop ( source, command, x, y, z, id ) if ( not x or not y or not z or not id ) then outputConsole ( "Sorry pal, you are not using vehicleDrop(x, y, z, carid) correctly" ) else hitshape = createColCuboid ( tonumber(x), tonumber(y), tonumber(z), 10.0, 10.0, 2.0 ) chute = createObject ( 2903, 0, 0, 0 ) dropvehicle = createVehicle ( tonumber(id), tonumber(x), tonumber(y), tonumber(z)+20 ) attachElementToElement ( chute, dropvehicle, 0, 0, 8 ) setElementVelocity ( dropvehicle, 0, 0, 0.1 ) addEventHandler ( "onElementColShapeHit", hitshape, hit_shape ) endendfunction hit_shape ( dropvehicle, matchingInterior ) detachElementFromElement ( chute, dropvehicle ) destroyElement ( chute ) x2, y2, z2 = getElementPosition ( hitshape ) setElementPosition ( dropvehicle, tonumber(x2), tonumber(y2), tonumber(z2) ) setElementVelocity ( dropvehicle, 0, 0, 0.1 )endaddCommandHandler ( "vehicledrop", vehicleDrop )