[Question] stop vehicle
#9

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_CROUCH))
    {
        if(IsPlayerInAnyVehicle(playerid)) // checks if playrid in a vehicle
        {
            new
                Float:x,
                Float:y,
                Float:z,
                playerveh = GetPlayerVehicleID(playerid); // gets the id of the player's vehicle and store it into playerveh so we can use it in Get/SetVehiclePos
                GetVehiclePos(playerveh, x, y, z);
                SetVehiclePos(playerveh, x, y, z + 2.0);
        }
    }
    return 1;
}

Edit:

Quote:
Originally Posted by BlackBank3
Посмотреть сообщение
Why you want to use TogglePlayerControllable for it? You know that if you freeze a player, the vehicle is still going forward... So the best way to stop a vehicle, is using SetVehicleVelocity...
No, the vehicle won't go forward actually it will stop (That's tested).
Reply


Messages In This Thread
topic can delete - by mickos - 09.06.2012, 08:58
Re: [Question] stop vehicle - by [KHK]Khalid - 09.06.2012, 09:00
Re: [Question] stop vehicle - by mickos - 09.06.2012, 09:02
Re: [Question] stop vehicle - by [KHK]Khalid - 09.06.2012, 09:08
topic can delete - by mickos - 09.06.2012, 09:37
Re: [Question] stop vehicle - by [KHK]Khalid - 09.06.2012, 09:47
topic can delete - by mickos - 09.06.2012, 09:55
Re: [Question] stop vehicle - by BlackBank - 09.06.2012, 10:05
Re: [Question] stop vehicle - by [KHK]Khalid - 09.06.2012, 10:05
Re: [Question] stop vehicle - by FalconX - 09.06.2012, 10:13

Forum Jump:


Users browsing this thread: 1 Guest(s)