[Ajuda] KMH
#6

pawn Код:
esse й para os veнculos.
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,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)) * 165.0;
    return floatround(ST[3]);
}

esse й para as bicicletas.
stock GetPlayerSpeedVelocity(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,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)) * 30.0;
    return floatround(ST[3]);
}
Reply


Messages In This Thread
KMH - by mau.tito - 28.10.2012, 14:10
Re: KMH - by Joao Pedro - 28.10.2012, 14:12
Re: KMH - by mau.tito - 28.10.2012, 14:17
Re: KMH - by Rodney Francalim - 28.10.2012, 14:18
Re: KMH - by mau.tito - 28.10.2012, 14:32
Re: KMH - by netogba - 28.10.2012, 14:35
Re: KMH - by mau.tito - 28.10.2012, 15:01

Forum Jump:


Users browsing this thread: 1 Guest(s)