Author Topic: Server-Sided Speedometer (Bottom print)  (Read 1034 times)

I would like a server-sided speedometer print for cars only. Basically this mod, except only for land vehicles and only speed. I have seen speed measured multiple ways: Strato's way and most everyone else's way. I would like it done the latter way, as this mod has done. Any questions, comments, hate, criticism, etc, you are welcome to comment. This doesn't seem too difficult, and it would be extremely useful. This should have been made a while ago.

TL;DR: Displays speed as a bottom print when you are in a land vehicle.
« Last Edit: February 17, 2014, 11:58:30 PM by Who Cares99 »

This should have been made a while ago.

Obviously, which is why it already exists.

Hmm, I searched for a while and couldn't find a server-sided one. I'll try again...

Edit: Yeah I still couldn't find one, could you link me to the one that you found please?
« Last Edit: January 24, 2014, 09:13:59 PM by Who Cares99 »

I do not think there is one made, so I would appreciate it if a scripter does make it. It doesn't seen like it would be too hard if you know how to script.


Obviously, which is why it already exists.
real helpful there bucko
Never seen one myself either, though I imagine it would be relatively simple to make?

real helpful there bucko
Never seen one myself either, though I imagine it would be relatively simple to make?
Yeah, it would be very easy to make and extremely helpful.

Yeah, it would be very easy to make and extremely helpful.
yeah it would be kinda cool too

yeah it would be kinda cool too
And it would take about thirty seconds to make

That old Box Train vehicle has a SpeedCheck script that has a brick per second speedometer, you could use that for various vehicles

I gave it a shot, i can't seem to get it to work, but it also returns no errors in the console
Code: [Select]
package VehicleSpeedometer
{
   function VehicleSpeedometer(%data, %obj)
   {
if(!isObject(%obj))
return;
%vehicle = %obj;
%speed = vectorLen(%obj.getVelocity());
if(!%vehicle.oldSpeed)
    %vehicle.oldSpeed = %speed;

if(%speed < 0)
    %speed = 0;
%vehicle.oldSpeed = %speed;
commandtoclient(%vehicle.getControllingClient(),'bottomprint', mFloor(%speed *2) @"<color:FFFF00>BPS", 1);
   
      schedule(500,0,"VehicleSpeedometer",%data,%obj);
   }
};
activatePackage(VehicleSpeedometer);

function vehicle::onadd(%data, %obj)
{
   parent::onadd(%data,%obj);
   VehicleSpeedometer(%data, %obj);
}
I've also tried putting the function in the package, same results
« Last Edit: February 08, 2014, 02:51:07 AM by Masterlegodude »

That old Box Train vehicle has a SpeedCheck script that has a brick per second speedometer, you could use that for various vehicles

I gave it a shot, i can't seem to get it to work, but it also returns no errors in the console
Code: [Select]
package VehicleSpeedometer
{
   function VehicleSpeedometer(%data, %obj)
   {
if(!isObject(%obj))
return;
%vehicle = %obj;
%speed = vectorLen(%obj.getVelocity());
if(!%vehicle.oldSpeed)
    %vehicle.oldSpeed = %speed;

if(%speed < 0)
    %speed = 0;
%vehicle.oldSpeed = %speed;
commandtoclient(%vehicle.getControllingClient(),'bottomprint', mFloor(%speed *2) @"<color:FFFF00>BPS", 1);
   
      schedule(500,0,"VehicleSpeedometer",%data,%obj);
   }
};
activatePackage(VehicleSpeedometer);

function vehicle::onadd(%data, %obj)
{
   parent::onadd(%data,%obj);
   VehicleSpeedometer(%data, %obj);
}
I've also tried putting the function in the package, same results

I'm aware of that, but I'm wondering if there's an easier way to make it work with all land vehicles than to copy-paste that script into all land vehicles.

I would really like to see this made. It doesn't seem like it would take too long and it would be an enormous help.