How to check is car moving?
#3

All i found was this
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;
}
It only checks if the vehicle is reversing. Perhaps you could change that code to see if the vehicle is moving forwards.
Reply


Messages In This Thread
How to check is car moving? - by Banditukas - 25.10.2014, 10:33
Re: How to check is car moving? - by DavidBilla - 25.10.2014, 11:50
Re: How to check is car moving? - by Steel_ - 25.10.2014, 11:50
Re: How to check is car moving? - by sammp - 25.10.2014, 12:14
Re: How to check is car moving? - by Anzipane - 25.10.2014, 13:21

Forum Jump:


Users browsing this thread: 2 Guest(s)