Skripta koju koristim:N/A
Detaljan opis problema: Pa brzinomjer se zamrzne kad sjedem u vozilo i krenem vozit odbroji par KM/h i zaustavi se tako
Dio skripte: TRAZITE STA TREBA!
Neke slike/video za lakse dobivanje pomoci(neobavezno):N/A
Brzinomjer
857
pregleda
9
postova
10. Jun 2017.
stock GetSpeed(playerid)
{
new Float:ST;
if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST,ST,ST);
else GetPlayerVelocity(playerid,ST,ST,ST);
ST = floatsqroot(floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround(ST);
}
Ide preko tog
11. Jun 2017.
stock GetSpeed( 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), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround( ST[ 3 ] );
}11. Jun 2017.
Dodaj pod OnPlayerUpdate, meni nekako najbolje/najljepÅ¡e kad se update-uje odma td. 😄
new zuriosm;
format(zuriosm, sizeof(zuriosm), "%d km/h", GetSpeed(playerid));
PlayerTextDrawSetString(playerid, NazivTDa, zuriosm);FUNCTION: GetSpeed(playerid)
{
new Float:ST;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), ST, ST, ST);
else GetPlayerVelocity(playerid, ST, ST, ST);
ST = floatsqroot(floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround(ST);
}11. Jun 2017.
Muma wrote on June 11, 2017, 7:12 pm:
Dodaj pod OnPlayerUpdate, meni nekako najbolje/najljepÅ¡e kad se update-uje odma td. 😄
new zuriosm;
format(zuriosm, sizeof(zuriosm), "%d km/h", GetSpeed(playerid));
PlayerTextDrawSetString(playerid, NazivTDa, zuriosm);FUNCTION: GetSpeed(playerid)
{
new Float:ST;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), ST, ST, ST);
else GetPlayerVelocity(playerid, ST, ST, ST);
ST = floatsqroot(floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround(ST);
}Već i stoji pod onplayerupdate
11. Jun 2017.
Arkoo wrote on June 11, 2017, 7:12 pm:
Dodaj pod OnPlayerUpdate, meni nekako najbolje/najljepÅ¡e kad se update-uje odma td. 😄
new zuriosm;
format(zuriosm, sizeof(zuriosm), "%d km/h", GetSpeed(playerid));
PlayerTextDrawSetString(playerid, NazivTDa, zuriosm);FUNCTION: GetSpeed(playerid)
{
new Float:ST;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), ST, ST, ST);
else GetPlayerVelocity(playerid, ST, ST, ST);
ST = floatsqroot(floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround(ST);
}Već i stoji pod onplayerupdate
Onda bi ovako trebalo da radi. 🙂
11. Jun 2017.
Muma wrote on June 11, 2017, 7:12 pm:
Dodaj pod OnPlayerUpdate, meni nekako najbolje/najljepÅ¡e kad se update-uje odma td. 😄
new zuriosm;
format(zuriosm, sizeof(zuriosm), "%d km/h", GetSpeed(playerid));
PlayerTextDrawSetString(playerid, NazivTDa, zuriosm);FUNCTION: GetSpeed(playerid)
{
new Float:ST;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), ST, ST, ST);
else GetPlayerVelocity(playerid, ST, ST, ST);
ST = floatsqroot(floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0) + floatpower(floatabs(ST), 2.0)) * 178.8617875;
return floatround(ST);
}Već i stoji pod onplayerupdate
Onda bi ovako trebalo da radi. 🙂
Nekim Äudom radi xD Hvala.
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava
