GetVehicleVelocity help
#1

well you know how you use

if isplayertopoint or in range of point

well i kinda of need to know how to use the if function with GetVehicleVelocity im making a back up beeper for trucks and i want it to only go off only if the player is going backwards

please help,
metallica
Reply
#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
#3

OMG thanks dude your a life saver
Reply
#4

Quote:
Originally Posted by Metallica502
Посмотреть сообщение
OMG thanks dude your a life saver
No prob's, glad i could help.
Reply
#5

btw i want ur internet provider xD
Reply
#6

and will you please take a look at the pm i sent you id appreciate it grately
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)