SA-MP Forums Archive
[Ajuda] KMH - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] KMH (/showthread.php?tid=388366)



KMH - mau.tito - 28.10.2012

Galera alguem me da uma base pra mim fazer KMH to carro nao precisa salvamento.


Re: KMH - Joao Pedro - 28.10.2012

Ta aн meu jovem https://sampwiki.blast.hk/wiki/GetVehicleVelocity


Re: KMH - mau.tito - 28.10.2012

Vlw! isso msm que eu queria !


Re: KMH - Rodney Francalim - 28.10.2012

Sim, mas existem funзхes criadas por outras pessoas para te ajudar mais nisso. Como a GetPlayerSpeed. Com base nisso, use TextDraw, se й que vocк quer fazer com que seja mostrado constantemente, tipo um velocнmetro.


Re: KMH - mau.tito - 28.10.2012

ja vi essa funзao GetPlayerSpeed mas creio que ele e usada pra velocidade!


Re: KMH - netogba - 28.10.2012

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]);
}



Re: KMH - mau.tito - 28.10.2012

tem como diminuar as info pois fico muito grande!
olha