28.12.2011, 17:41
(
Последний раз редактировалось DrTHE; 28.12.2011 в 18:38.
)
existe alguma funзгo para obter aceleraзгo do carro?
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]);
}
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;
}
new var = GetPlayerVehicleVelocity(playerid) / 3;
printf("A Aceleraзгo do carro й: %f", var);
new var = GetPlayerAcceleration(5);
printf("A Aceleraзгo dele й :%d", var);
pawn Код:
#Edit: Pegar Aceleraзгo do veiculo/player pawn Код:
Fonte: https://sampwiki.blast.hk/wiki/Useful_Fu...erAcceleration download da include > http://www.mediafire.com/?b74ixr65o4ff32a |
Returns the player accelaration in MPH as an integer, it requires the uftimer to be implemented in the gamemode |
1,60 * 20 = 32 Quilфmetros.
15 / 1,60 = 9,375