GetVehicleVelocity help
#2

You could use:
pawn Код:
stock IsVehicleDrivingBackwards(vehicleid)
{
    new Float:Float[3];
    if(GetVehicleVelocity(vehicleid, Float[1], Float[2], Float[0]))
    {
        GetVehicleZAngle(vehicleid, Float[0]);
        if(Float[0] < 90)
        {
            if(Float[1] > 0 && Float[2] < 0) return true;
        }
        else if(Float[0] < 180)
        {
            if(Float[1] > 0 && Float[2] > 0) return true;
        }
        else if(Float[0] < 270)
        {
            if(Float[1] < 0 && Float[2] > 0) return true;
        }
        else if(Float[1] < 0 && Float[2] < 0) return true;
    }
    return false;
}
To see if the vehicle is going backwards.
Reply


Messages In This Thread
GetVehicleVelocity help - by Metallica502 - 13.10.2011, 20:19
Re: GetVehicleVelocity help - by Stigg - 13.10.2011, 20:40
Re: GetVehicleVelocity help - by Metallica502 - 13.10.2011, 21:01
Re: GetVehicleVelocity help - by Stigg - 13.10.2011, 21:02
Re: GetVehicleVelocity help - by Metallica502 - 13.10.2011, 21:10
Re: GetVehicleVelocity help - by Metallica502 - 13.10.2011, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)