[HELP]How to stop vehicle in mid air
#1

like the player is flying in his car using bounce
and when he presses numpad 6
his vehicle get's flipped and he stop's in mid air
i have already did the flip part
but i have no idea how to stop vehicle in mid air
Reply
#2

set you can try to get his vehicle pos and set it back again or try to get the vehicle velocity then set it back again. I've this in my server before something like a handbrake system, but later i removed it.
Reply
#3

Can you please post teh code?
i cant clearly understand what you said
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new
                Float:vx,
                Float:vy,
                Float:vz,
                Float: va
            ;
            GetVehicleZAngle(GetPlayerVehicleID(playerid), va);
            GetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);
            SetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), va);
        }
    }
    return 1;
}
When you press the horn button (h - caps lock).
Note: it stops the car and then the car is falling down.
Reply
#5

That's what i wanted
ty +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)