SA-MP Forums Archive
Speedometer system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speedometer system (/showthread.php?tid=310917)



Speedometer system - Typhome - 14.01.2012

Hello!
I have speedometer system (and i didnt created this) - I copyed from FS to GM and used it.
But this speedometer have bit unrealistic, like im driving with infernus and max km/h is showing that 120, but must be +200 km/h...
And i dont know how edit this km/h, so please help.


Re: Speedometer system - Typhome - 14.01.2012

Can anyone help about this?


Re: Speedometer system - Mean - 14.01.2012

Mess around with this line:
pawn Код:
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0);



Re: Speedometer system - Typhome - 14.01.2012

Do i edit 100.0 to 200.0 or what? I dont know how make km/h realistic..


Re: Speedometer system - Virtual1ty - 14.01.2012

I made this to match spookie's Speedometer Mod for San Andreas:
pawn Код:
stock GetVehicleSpeed( vehicleid )
{
    // Function: GetVehicleSpeed( vehicleid )
   
    new
        Float:x,
        Float:y,
        Float:z,
        vel;

    GetVehicleVelocity( vehicleid, x, y, z );
   
    // Always returns the vehicle speed in KM/H
    vel = floatround( floatsqroot( x*x + y*y + z*z ) * 180 );
    return vel;
}
So you can mess with that if you want, because it's better than what you have, floatpower tends to be slower than just multiplying the values itself.


Re: Speedometer system - iGetty - 14.01.2012

Try and change 100.0 to something like, 180.0.

If that doesn't work, then try 200.0.

Thanks.