Speedo - big intervals
#1

HEy guys,
can you help me about big intervals/differences on my speedo

http://prntscr.com/hpowa6

Its doing like: 0 - 15, then 40 (full throttle)

How to make it going: 0,1,2,3,4.....38,39,40....

Код:
				format(lstring,sizeof(lstring),"~b~Vozilo ~w~%s~n~~b~Zdravlje: ~w~%.2f~n~~b~GPS: ~w~%s~n~~g~KM/H: ~w~%d",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i)) - 400],L_VehHealth,LuxZone,GetPlayerSpeed(i,true));
				TextDrawSetString(LFunc[i], lstring);
				if(L_VehHealth <= 500){
					format(lstring,sizeof(lstring),"~b~Vozilo: ~w~%s~n~~b~Zdravlje: ~w~%.2f~n~~b~GPS: ~w~%s~n~~g~KM/H: ~w~%d",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i)) - 400],L_VehHealth,LuxZone,GetPlayerSpeed(i,true));
					TextDrawSetString(LFunc[i], lstring);
				}
				if(GetPlayerSpeed(i,true) >= VehicleMaxSpeed)
				{
					format(lstr,sizeof(lstr),"~n~~g~KM/H: ~r~%d",GetPlayerSpeed(i,true));
     				TextDrawSetString(Lmph[i], lstr);
				}
Код:
GetPlayerSpeed(playerid,bool:kmh) // by misco
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Reply
#2

PHP код:
stock GetPlayerSpeed(carid,bool:kmh)
{
    new 
Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    
GetVehicleVelocity(carid,Vx,Vy,Vz);
    
rtn floatsqroot(floatabs(floatpower(Vx Vy Vz,2)));
    return 
kmh?floatround(rtn 100 1.61):floatround(rtn 100);

PHP код:
new car GetPlayerVehicleID(i);
format(lstr,sizeof(lstr),"~n~~g~KM/H: ~r~%d"GetPlayerSpeed(car,true));
TextDrawSetString(Lmph[i], lstr); 
bite it like this.....
Reply
#3

EDITED: NVM EmpireSk was faster!
Reply
#4

Код:
				format(lstring,sizeof(lstring),"~b~Vozilo ~w~%s~n~~b~Zdravlje: ~w~%.2f~n~~b~GPS: ~w~%s~n~~g~KM/H: ~r~%d",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i)) - 400],L_VehHealth,LuxZone,GetPlayerSpeed(car,true));
				TextDrawSetString(LFunc[i], lstring);
				format(lstr,sizeof(lstr),"~n~~g~KM/H: ~r~%d",GetPlayerSpeed(car,true));
				TextDrawSetString(Lmph[i], lstr);
It still shows same big intervals in speeds ...

Код:
stock GetPlayerSpeed(carid,bool:kmh)
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    GetVehicleVelocity(carid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)