I have tried it. It works only when I'm not in a vehicle. When I'm in a vehicle, it spawns ramps with the static rotation, and it depends on the rotation what I have, when I entered the car. So, if I turn, and then spawn the ramp, I can't jump, because the rotation is wrong.
This script is fully working:
ffunction createRamp ( player, command )
local x, y, z = getElementPosition ( player )
local theVehicle = getPlayerOccupiedVehicle ( player )
local a,b,r = getVehicleRotation ( theVehicle )
x = x - math.sin ( math.rad(r) ) * 20
y = y + math.cos ( math.rad(r) ) * 20
ramp = createObject ( 1655, x, y, z, 0, 0, r )
setTimer ( RemoveRamp, 8000, 1 )
end
function RemoveRamp ()
destroyElement(ramp)
end
addCommandHandler ( "r", createRamp )