Hello Guys,
I have a problem with my helicopters. When I try to rappel from a helicopter (I have a ressource that spawns the helicopter, warp me into the last seats where I can rapple, and spawn a npc in the driver seat. Then there come the ropes and when they reach the ground my character just jumps out of the helicopter. I don`t know why and how to fix, but may you will do
let isActive = false;
let pilot;
let aircraft;
setInterval(() => {
if(IsControlJustReleased(0, 51)) {
RequestModel(GetHashKey("s_m_y_pilot_01"))
RequestModel(GetHashKey("maverick"))
setTimeout(() => {
if(!isActive) {
aircraft = CreateVehicle("maverick", GetEntityCoords(PlayerPedId())[0], GetEntityCoords(PlayerPedId())[1], GetEntityCoords(PlayerPedId())[2] + 15, 0.0, true, false)
pilot = CreatePedInsideVehicle(aircraft, 1, GetHashKey("s_m_y_pilot_01"), -1, true, false)
TaskWarpPedIntoVehicle(PlayerPedId(), aircraft, 1);
FreezeEntityPosition(aircraft, true)
setTimeout(() => {
TaskRappelFromHeli(PlayerPedId(), true)
}, 5000)
isActive = true
}else{
isActive = false
DeleteEntity(pilot)
TaskWarpPedIntoVehicle(PlayerPedId(), aircraft, -1)
FreezeEntityPosition(aircraft, false)
}
}, 250)
}
}, 3)
Thanks for every help !
Juli3n