[Ajuda]Getar ACELERAЗГO
#1

existe alguma funзгo para obter aceleraзгo do carro?
Reply
#2

Dъvida:

O Que Й Getar ?
Reply
#3

http://www.brasilescola.com/matemati...a-um-movel.htm

Agora faзa o sistema.


Quote:
Originally Posted by shadauer
Посмотреть сообщение
Dъvida:

O Que Й Getar ?
Ele se expressou errado. O correto й "Obter".
Reply
#4

valeu =)
Reply
#5

Pegar Velocidade do carro do player:
pawn Код:
stock GetPlayerVehicleVelocity(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)) * 179.28625;
    return floatround(ST[3]);
}


Pegar Velocidade do Player
pawn Код:
stock GetPlayerSpeed(playerid)
{
    if(playerid != INVALID_PLAYER_ID)
    {
        new Float:Pos[3],Float:PS;
        GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
        PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
        return floatround(PS,floatround_round);
    }
    return INVALID_PLAYER_ID;
}
Reply
#6

Basta dividir a velocidade pelo tempo que ele chegou naquela velocidade.
Reply
#7

pawn Код:
new var = GetPlayerVehicleVelocity(playerid) / 3;
printf("A Aceleraзгo do carro й: %f", var);

#Edit:

Pegar Aceleraзгo do veiculo/player
pawn Код:
new var = GetPlayerAcceleration(5);
printf("A Aceleraзгo dele й :%d", var);


Fonte:
https://sampwiki.blast.hk/wiki/Useful_Fu...erAcceleration
download da include > http://www.mediafire.com/?b74ixr65o4ff32a
Reply
#8

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
pawn Код:
new var = GetPlayerVehicleVelocity(playerid) / 3;
printf("A Aceleraзгo do carro й: %f", var);

#Edit:

Pegar Aceleraзгo do veiculo/player
pawn Код:
new var = GetPlayerAcceleration(5);
printf("A Aceleraзгo dele й :%d", var);


Fonte:
https://sampwiki.blast.hk/wiki/Useful_Fu...erAcceleration
download da include > http://www.mediafire.com/?b74ixr65o4ff32a
Quote:
Returns the player accelaration in MPH as an integer, it requires the uftimer to be implemented in the gamemode

Se ele quiser em KM/h vai ter que dar uma olhada na include.
Reply
#9

Quote:
Originally Posted by Los
Посмотреть сообщение
Se ele quiser em KM/h vai ter que dar uma olhada na include.
KM/H = Quilфmetros por hora
MP/H = Milhas Por hora

й sу usar matemбtica, KM/H Multiplicar 1x de KM/H e vice versa.
Exemplo:

Queremos Milhas por hora:
Imaginamos que estamos hб 20 milhas por hora,
como convertemos 20 milhas por quilфmetros ?
Simples:
PHP код:
1,60 20 =  32 Quilфmetros
Converter Quilфmetros por Milhas
Agora vamos a situaзгo acima,
estamos a 15 Quilфmetros por hora,
como converteremos para Milhas ?
Mais simples ainda:
PHP код:
15 1,60  9,375 
*Observaзгo: o valor real de milha й 1,609344

Espero ter ajudado.
Reply
#10

Aceleraзгo deve ser obtida em metros por segundo ao quadrado (m/sІ), de acordo com o SI.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)