Please,help me with this FAST!!!
#11

GetVehicleVelocity just doesn't work like that. You need to parse them together to get a usable result (speed).
Use this function to determine the speed of a vehicle:
pawn Код:
stock GetPlayerSpeed(playerid, bool:kmh = true)
{
    new
        Float:xx,
        Float:yy,
        Float:zz,
        Float:pSpeed;

    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid),xx,yy,zz);
    }
    else
    {
        GetPlayerVelocity(playerid,xx,yy,zz);
    }

    pSpeed  = floatsqroot((xx * xx) + (yy * yy) + (zz * zz));
    return kmh ? floatround((pSpeed * 195.12)) : floatround((pSpeed * 121.9));
}
Use:
For km/h: new speed = GetPlayerSpeed(playerid);
for mph: new speed = GetPlayerSpeed(playerid, false);
Reply


Messages In This Thread
Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 07:57
Re: Please,help me with this FAST!!! - by Markx - 19.04.2011, 07:58
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 08:00
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 08:03
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 08:05
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 08:48
Re : Please,help me with this FAST!!! - by Vukilore - 19.04.2011, 08:51
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 09:00
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 09:08
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 10:24
Re: Please,help me with this FAST!!! - by Vince - 19.04.2011, 11:27
Re: Please,help me with this FAST!!! - by Gertin - 19.04.2011, 12:25
Re: Please,help me with this FAST!!! - by alpha500delta - 19.04.2011, 13:18
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 14:02
Re: Please,help me with this FAST!!! - by Cjgogo - 19.04.2011, 14:26

Forum Jump:


Users browsing this thread: 1 Guest(s)