How can I show 3 le...
 
Notifications
Clear all

How can I show 3 letters of surname of drivers ahead and behind like F1 style?

2 Posts
2 Users
0 Likes
1,023 Views
(@jamespoly86)
Active Member
Joined: 2 years ago
Posts: 3
Topic starter  

In Simhub there is an option to show the short name as Lewis Hamilton (LHA) while I would like to have HAM like F1 style.

How can I build this with the driver ahead and behind?


   
Quote
(@duschmoll)
New Member
Joined: 2 years ago
Posts: 1
 

Hello, you need to put a text, in the text properties add a binding. (Check: Use JavaScript)

For Driver Ahead:

let driverAheadRaw = $prop('PersistantTrackerPlugin.DriverAhead_00_Name');
let driverAhead = (driverAheadRaw == null) ? '-' : driverAheadRaw.substr(driverAheadRaw.indexOf(' ') + 1,3).toUpperCase();
return driverAhead;

For Driver Behind:

let driverBehindRaw = $prop('PersistantTrackerPlugin.DriverBehind_00_Name');
let driverBehind = (driverBehindRaw == null) ? '-' : driverBehindRaw.substr(driverBehindRaw.indexOf(' ') + 1,3).toUpperCase();
return driverBehind;

 


   
ReplyQuote
Share: