Detect if vehicle moving or not.
#2

Код:
#define SPEED_OF_MOVING 3

GetVehicleSpeed(vehicleid)
{
    new Float:ST[4];
    GetVehicleVelocity(vehicleid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
    return floatround(ST[3]);
}

bool:IsVehicleMoving(vehicleid) return (GetVehicleSpeed(vehicleid) > SPEED_OF_MOVING);
I don’t claim credit for the vehicle speed function.
Reply


Messages In This Thread
Detect if vehicle moving or not. - by ZigGamerx - 28.10.2018, 17:49
Re: Detect if vehicle moving or not. - by RogueDrifter - 28.10.2018, 17:55
Re: Detect if vehicle moving or not. - by Calisthenics - 28.10.2018, 17:59

Forum Jump:


Users browsing this thread: 1 Guest(s)