The online racing simulator
leaderboard.lpr - Testers Required
Hi

I've been playing around with making a Lapper leaderboard (actually it's a pitboard but as Yisc[NL] has already used that name for what is really a leaderboard! ).

Coding works ok.

But (as usual), use at your own risk.

If you know what you're doing, you'll be fine.

Cut and paste into Splitting (general action when passing split) section, in the Event OnLap() part.

There's a bit at bottom of text file that needs to be copied into your LANG section.

CODING HELP WANTED.

I've been trying different IF....ENDIF statements to get this code to ONLY show when the pitboard is OFF.

IF ( $enable_pitboard == "[COLOR=Blue]true[/COLOR]" )
THEN
# do nothing
ELSE
#put code here
END IF

or

IF ( $enable_pitboard == "[COLOR=Blue]false[/COLOR]" )
THEN
#put code here
ELSE
# do nothing
END IF

but everything I do just seems to switch the leaderboard off.

I'm currently using without IF coding.

However, I'd like to have it that if people don't use the pitboard, they have the leaderboard, and vice versa.

(If you want to have both, you'll need to change coding so that it's higher up the screen, otherwise the leaderboard will overlay on top of the pitboard - I'd suggest moving 30 or 40 up - for instance, where it has openPrivButton( "leaderboardback",1,70,30,34,12,7,16......", change this to openPrivButton("leaderboardback",1,30,30,34,12,7,16....." - adjust second number of all buttons accordingly - - 2nd last number in the line means that it will show for 7 seconds - you could change to -1 so never closes)

Anyone help?
Attached images
leaderboard examples.PNG
Attached files
leaderboard.txt - 3.4 KB - 214 views
try this ?


$NickName = GetCurrentPlayerVar("NickName");
$Position = GetCurrentPlayerVar("Pos");
$Laps = GetCurrentPlayerVar("LapsDone");
$nickNameFront = GetCurrentPlayerVar( "UNameBefore");
$nickNameBack = GetCurrentPlayerVar( "UNameBehind");
$DriftScore = GetCurrentPlayerVar( "DriftScore" );
$GapBefore = GetCurrentPlayerVar( "GapBefore");
$GapBehind = GetCurrentPlayerVar( "GapBehind");
$LapTime = NumToMSH(GetCurrentPlayerVar("LapTime"));

IF ( $enable_pitboard != "true" )
THEN
$diffLapTimeToPB = NumToMSH( GetCurrentPlayerVar("diffLapTimeToPB"));


openPrivButton( "leaderboardback",1,70,30,34,12,7,16,langEngine("%{main_linespace}%" ));
openPrivButton( "leaderboardname",2,71,28,5,4,7,32,langEngine("%{main_leaderboard}%" )); # This says : LEADERBOARD :

openPrivButton( "leaderboardhandle1",3,77,2,9,12,7,32," "); # This is to make board look like it has slots/handles
openPrivButton( "leaderboardhandle1a",3,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle1b",3,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2a",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle2b",3,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3a",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle3b",27,77,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4",27,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4a",27,87,2,9,12,7,32," ");
openPrivButton( "leaderboardhandle4b",27,87,2,9,12,7,32," ");

openPrivButton( "playernameback",2,76,28,6,5,7,32," ");
openPrivButton( "playername",6,77,20,5,5,7,16, $NickName); # player who will see board

openPrivButton( "leaderboardtimeback",2,81,28,6,5,7,32," ");
openPrivButton( "leaderboardtimes",5,81,22,5,5,7,0,langEngine("%{main_leaderboardtimes}%",$LapTime, $diffLapTimeToPB)); # laptime + diff to pb

openPrivButton( "pos_lap_backing",2,86,28,6,5,7,32," ");
openPrivButton( "position",7,86,4,6,5,7,0,"P");
openPrivButton( "lap",16,86,4,6,5,7,0,"L");
openPrivButton( "whatposition",10,86,5,6,5,7,32,langEngine("%{main_position}%",$Position)); # P1, P2, P3, etc
openPrivButton( "whatlap",19,86,5,6,5,7,32,langEngine("%{main_lapnumber}%",$Laps)); # L1, L2, L3, etc

openPrivButton( "who_front_backing",2,91,28,6,5,7,32," ");
openPrivButton( "who_front",5,91,24,5,5,7,64,langEngine("%{main_whofrontofme}%",$nickNameFront, $GapBefore)); # Name of driver in front along with gap

openPrivButton( "who_back_backing",2,96,28,6,5,7,32," ");
openPrivButton( "who_back",5,96,24,5,5,7,64,langEngine("%{main_whobackofme}%",$nickNameBack, $GapBehind)); # Name of driver behind along with gap
ENDIF

Hi,
Your Leaderboard have a small bug ,it shows the usernames incase of the nicknames from who is infront or behind you.
Leaderboard works fine.

The next lines must be

$nickNameFront = GetPlayerVar( GetCurrentPlayerVar( "UNameBefore" ),"nickName" );
$nickNameBack = GetPlayerVar( GetCurrentPlayerVar( "UNameBehind" ),"nickName" );
Quote from Tim NL :Hi,
Your Leaderboard have a small bug ,it shows the usernames incase of the nicknames from who is infront or behind you.
Leaderboard works fine.

The next lines must be

$nickNameFront = GetPlayerVar( GetCurrentPlayerVar( "UNameBefore" ),"nickName" );
$nickNameBack = GetPlayerVar( GetCurrentPlayerVar( "UNameBehind" ),"nickName" );

i got those frome the default lapper script so don't bombard me with that bug
leaderboard.lpr add-on script (for 5.914+) - Testers required
I've just amended my leaderboard script so that it could become a .lpr add-on, like Pitboard, GUI, etc.

However, I am only able to test it on local pc, without anyone connected, and my server hosts don't have the newer version of lapper available.

Can people please test and let me know if it works properly?

To use it, you'll need to add following separate line of code to your addonsused.lpr file (..\bin\default\includes\ directory)

include( "./leaderboard.lpr");

Tried it running with AI, but all sort of weird issues.

Many thanks.
Attached images
Leaderboard.PNG
Attached files
leaderboard.zip - 971 B - 183 views

FGED GREDG RDFGDR GSFDG