The online racing simulator
Quote from emit-nl :...But I'd like to have a PlayerVar that can get the split or sector from your PB lap....Tim

I thought you'd be able to use something like
IF ( GetCurrentPlayerVar("IsBestSectorSplit1") == 1)
THEN
#do something
ENDIF


But of course, you could have made PB on another server.

Looking at the PlayerVars, there's a
ViewSPBSplit, // What split PB to Show, S = Session, P = PB, W = World record ( Can be SET )

Can't you use that?

Edit - bit more info

+-------------------------------+
|Changes from v5.920 to 5.921 |
+-------------------------------+

5. New player Var, this var can also be set
ViewSPBSplit, // What split PB to Show, S = Session, P = PB, W = World record
ShowSplitPb, // Does the split PB iare showed 1 = Yes, 0 = No
Hi,
Thanks for this PlayerVars, I diddn't noticed them.
Tough I have tried them and it doesn't work for me I think.
WhenShowSplitPB = 0 you just can't see any split messages so it has to be 1.
The ViewSPBSplit = S and = W isn't the right choice for me and P means the PB of the current sector, but not the sector you have driven in the PB lap.

Thanks for the help anyways, I tried it, but I think it just isn't possible with lapper yet.
Or is it possible to filter it our of the !stats command?
On the second line is something like this: '0.15.00 0.30.00 0.45.00'
Would it be possible to let LFSLapper find the [space] between this times?
Then it has also got to tell how many spaces there are in it, so you can see how many splits there are in this track.

Would this be possilbe?
Else I don't see any other solutions.

Thanks,
Tim
hi

is it possible to combine these functions in a sub??:


-U can go to a sub when u click on it:

Sub example( $KeyFlags,$id )
EndSub


-And u can go to a sub when u fill in a command like:


Sub example( $Username )
EndSub

CASE "!test":
example($Username);
BREAK;


i have have a other problem:

startIndex mag niet groter zijn dan de lengte van de tekenreeks.
Parameternaam: startIndex

startindex cant be bigger than the length of characterline ( sry i'm bad in translating of langauges )

how can i fix this.
here's the code below:
i have used a part of code from the GUI of TIM NL

GlobalVar $set_plusmin;
GlobalVar $charactercheck;
GlobalVar $set_car;
GlobalVar $current_car ;
$current_car = "?" ;

Sub selected_cars( $KeyFlags,$id )
IF(current_car == "?" )
THEN
$current_car = "" ;
ENDIF
$set_car = trim( subStr( $id,11 ) );
IF($current_car == "" )
THEN
$current_car=$current_car . $set_car;
ELSE
$charactercheck = trim( subStr( $current_car,StrLen($current_car) - 1 ) );
IF( $charactercheck == "+" || $charactercheck == "-")
THEN
$current_car=$current_car . $set_car;
ELSE
PrivMsg("Use + or - to before selecting a car.");
ENDIF
ENDIF
select_temp(0,0);
EndSub

Quote from Bass-Driver :<snip>


<?php 
Global $something;
CASE 
"!test1":
$something "blah";
example(0,$userName.$something);
BREAK;
CASE 
"!test2":
$something "hahaha";
example(0,$userName.$something);
BREAK;

Sub example$KeyFlags,$id  )
$username subStr$current_car,0,StrLen($something) );#test 1 will have strlen of 4 test 2 will have 6
privmsg("your username: ".$username);
EndSub
?>


there is something to start you off with ... has major limitation but it should work
i had 1 one question and 1 problem
pls dont combine them
Quote from Fire_optikz001 :

<?php 
Global $something;
CASE 
"!test1":
$something "blah";
example(0,$userName.$something);
BREAK;
CASE 
"!test2":
$something "hahaha";
example(0,$userName.$something);
BREAK;

Sub example$KeyFlags,$id  )
$username subStr$current_car,0,StrLen($something) );#test 1 will have strlen of 4 test 2 will have 6
privmsg("your username: ".$username);
EndSub
?>


there is something to start you off with ... has major limitation but it should work

Quote from Bass-Driver :i had 1 one question and 1 problem
pls dont combine them

i didn't... i used it as an example... god sorry for lending a little help maybe i wont next time >.>
Quote from Fire_optikz001 :i didn't... i used it as an example... god sorry for lending a little help maybe i wont next time >.>

Are u upset now because i didnt understood what u did.
i thought u was combine the 2 situations.
thx for helping

Global $something;
CASE "!test1":
$something = "blah";
example(0,$userName.$something);
BREAK;
CASE "!test2":
$something = "hahaha";
example(0,$userName.$something);
BREAK;

Sub example( $KeyFlags,$id )
$username = subStr( $current_car,0,StrLen($something) );#test 1 will have strlen of 4 test 2 will have 6
privmsg("your username: ".$username);
EndSub

StrLen = StringLength
see i learning

and i have discovered that this line caused the crashproblem

$set_car = trim( subStr( $id,11 ));
but i dont know where : trim( subStr( $id,11 )); stands for.
could u teach me what it means ??
Quote from Bass-Driver :Are u upset now because i didnt understood what u did.
i thought u was combine the 2 situations.
thx for helping

Global $something;
CASE "!test1":
$something = "blah";
example(0,$userName.$something);
BREAK;
CASE "!test2":
$something = "hahaha";
example(0,$userName.$something);
BREAK;

Sub example( $KeyFlags,$id )
$username = subStr( $current_car,0,StrLen($something) );#test 1 will have strlen of 4 test 2 will have 6
privmsg("your username: ".$username);
EndSub

StrLen = StringLength
see i learning

and i have discovered that this line caused the crashproblem

$set_car = trim( subStr( $id,11 ));
but i dont know where : trim( subStr( $id,11 )); stands for.
could u teach me what it means ??

trim removes spaces
thx Fire_optikz001

i have made some test with: trim( subStr( $id,11 )
and now i know how it works. and the code is works now.

but i still dont have a answer:

is it possible to combine these functions in a sub??:


-U can go to a sub when u click on it:

Sub example( $KeyFlags,$id )
EndSub


-And u can go to a sub when u fill in a command like:


Sub example( $Username )
EndSub

CASE "!test":
example($Username);
BREAK;
Quote from Fire_optikz001 :

<?php 
Global $something;
CASE 
"!test1":
$something "blah";
example(0,$userName.$something);
BREAK;
CASE 
"!test2":
$something "hahaha";
openPrivButton$userName.$something,25,28,150,10,5,-1,0,"^2Commands list"example );
BREAK;

Sub example$KeyFlags,$id  )
$username subStr$current_car,0,StrLen($something) );#test 1 will have strlen of 4 test 2 will have 6
privmsg("your username: ".$username);
EndSub
?>


there is something to start you off with ... has major limitation but it should work

^^^ thats the best code i could think of
Quote from Bass-Driver :thx Fire_optikz001

i have made some test with: trim( subStr( $id,11 )
and now i know how it works. and the code is works now.

but i still dont have a answer:

is it possible to combine these functions in a sub??:


-U can go to a sub when u click on it:

Sub example( $KeyFlags,$id )
EndSub


-And u can go to a sub when u fill in a command like:


Sub example( $Username )
EndSub

CASE "!test":
example($Username);
BREAK;

i found it

[I]Sub example( [/I][I] $KeyFlags,$id [/I][I] )
EndSub

CASE "!test":
example(0,0);
BREAK;[/I]

Quote from Bass-Driver :
StrLen = StringLength
see i learning

and i have discovered that this line caused the crashproblem

$set_car = trim( subStr( $id,11 ));
but i dont know where : trim( subStr( $id,11 )); stands for.
could u teach me what it means ??

Hi,

trim( subStr( $id,11 )); Remove the first part of a string to the 11nd character

Here some extra info about SubStr() ,Trim() and StrLen()


SubStr()
example:
$string = "example";
$example = substr( $string,0,3 ); #Start at the begining ( 0) and give the next 3 characters $example = "exa";
$example = substr( $string,4,2 ); #Start the the 4e character and give the next 2 characters $example = "pl";

StrLen()
example:
$string = "example";
$example = StrLen( $string ); #Gives the lenght of a string $example = 7;

Trim()
example:
$string = "example";
$example = trim( subStr( $string,2 ) ); #Remove the first part of a string to the 2nd character $example = "ample";

hi
wow thx tim
thank u very much for this

i will make some tests of it
-
(Bass-Driver) DELETED by Bass-Driver
hi i got a lil problem with the code below.
the button is jumping al over the place and gives a :
Time Out in Event or Sub 2000 ms error.

it seems the : $UI_HT1=$UI_HT1+4; code cause the error

$UI_HT1=46;
FOR ($i=1;$i<=40;$i=$i+1)
IF ($driverarray[$i,1] == "")
THEN
$driverarray[$i,1] = GetCurrentPlayerVar( "UserName" );
$UI_HT1=$UI_HT1+4;
openPrivButton($driverarray[$i,1],43,$UI_HT1,30,4,5,-1,32,GetCurrentPlayerVar( "NickName") ,Userinfopanel);
ENDIF
ENDFOR

Quote from Bass-Driver :hi i got a lil problem with the code below.
the button is jumping al over the place and gives a :
Time Out in Event or Sub 2000 ms error.

it seems the : $UI_HT1=$UI_HT1+4; code cause the error

$UI_HT1=46;
FOR ($i=1;$i<=40;$i=$i+1)
IF ($driverarray[$i,1] == "")
THEN
$driverarray[$i,1] = GetCurrentPlayerVar( "UserName" );
$UI_HT1=$UI_HT1+4;
openPrivButton($driverarray[$i,1],43,$UI_HT1,30,4,5,-1,32,GetCurrentPlayerVar( "NickName") ,Userinfopanel);
ENDIF
ENDFOR


I'm not sure I am on the right track here (been a long time since I did something with Lapper) but I think you need to put quotes around your $driverarray[$i,1] variable.
Like this:


$UI_HT1=46;

FOR ($i=1;$i<=40;$i=$i+1)
IF ($driverarray[$i,1] == "")
THEN
$driverarray[$i,1] = GetCurrentPlayerVar( "UserName" );
$UI_HT1=$UI_HT1+4;
openPrivButton("$driverarray[$i,1]",43,$UI_HT1,30,4,5,-1,32,GetCurrentPlayerVar( "NickName") ,Userinfopanel);
ENDIF
ENDFOR

no sry it doesnt work.

but ill give u the code of the whole sub.

privMsg("User:" . $userName); is just testing if he tokes the right username

Sub Userinfopanel( $KeyFlags,$userName)
$currPly = getPlayerInfo( $userName );
License ( $currPly );
Pointstogo ( $currPly );
privMsg("User:" . $userName);
openPrivButton( "uibgd",74,$UI_HT-1,52,94,5,-1,32, "");
openPrivButton( "uiname",75,$UI_HT,50,5,5,-1,32, $currPly["NickName"] . " ^7( ^8" . $currPly["UserName"] . " ^7)" );
openPrivButton( "uia1",75,$UI_HT+6,50,5,5,-1,80, "^7Current Car: ^2" . $currPly[Car]);
openPrivButton( "uia2",75,$UI_HT+11,50,5,5,-1,80, "^7Laps (" . $currPly[Car] . "/" . getLapperVar( "ShortTrackName" ) . "): ^2" .$currPly[LapsDone]);
openPrivButton( "uia3",75,$UI_HT+16,50,5,5,-1,80, "^7Driven Distance (" . $currPly[Car] . "/" . getLapperVar( "ShortTrackName" ) . "): ^2" . $currPly[Dist] ." km" );
openPrivButton( "uia4",75,$UI_HT+21,50,5,5,-1,80, "^7Total Distance: ^2" . Round(ToNum($currPly[totaldistance] / 1000),1) . " km");
openPrivButton( "uia5",75,$UI_HT+26,50,5,5,-1,80, "^7Current Distance: ^2" . Round(ToNum($currPly[TotDistMeter] / 1000),1) . " km");
openPrivButton( "uia6",75,$UI_HT+31,50,5,5,-1,80, "^7Split 1: ^2" . NumToMSH( GetCurrentPlayerVar("SectorSplit1")));
openPrivButton( "uia7",75,$UI_HT+36,50,5,5,-1,80, "^7Split 2: ^2" . NumToMSH( GetCurrentPlayerVar("SectorSplit2")));
openPrivButton( "uia8",75,$UI_HT+41,50,5,5,-1,80, "^7Split 3: ^2" . NumToMSH( GetCurrentPlayerVar("SectorSplit3")));
openPrivButton( "uia9",75,$UI_HT+46,50,5,5,-1,80, "^7Split Last: ^2" . NumToMSH( GetCurrentPlayerVar("SectorSplitLast")));
openPrivButton( "uia10",75,$UI_HT+51,50,5,5,-1,80, "^7PB (" . $currPly[Car] . "/" . getLapperVar( "ShortTrackName" ) . "): ^2" . NumToMSH($currPly[PBLapTime]));
openPrivButton( "uia11",75,$UI_HT+56,50,5,5,-1,80, "^7Max Speed: ^2" . $currPly[BestSpeed] ."^7 ". $currPly[UnitSpeed]);
openPrivButton( "uia12",75,$UI_HT+61,50,5,5,-1,80, "^7Avg Speed: ^2". ToPlayerUnit( GetCurrentPlayerVar("AvgSpeed")) ."^7 ". GetCurrentPlayerVar("UnitSpeed"));
openPrivButton( "uia13",75,$UI_HT+66,50,5,5,-1,80, "^7DriftPoints: ^2" . $currPly[DriftScore]);
openPrivButton( "uia14",75,$UI_HT+71,50,5,5,-1,80, "^7RaceLicense: ^2" . $currPly[license]);
openPrivButton( "uia15",75,$UI_HT+76,50,5,5,-1,80, "^7License Points: ^2" . $currPly[ps_points_total]);
openPrivButton( "uia16",75,$UI_HT+81,50,5,5,-1,80, "^7Points TOGO: ^2" . $currPly[ps_points_togo]);
openPrivButton( "uiclose",75,$UI_HT+87,50,5,5,-1,32, "^3CLOSE" ,Userinfoclose );

openPrivButton( "uibgd1",42,$UI_HT-1,32,94,5,-1,32, "");
openPrivButton( "uititle",43,$UI_HT,30,5,5,-1,32, "^3Users:");


$UI_HT1=46;
FOR ($i=1;$i<=40;$i=$i+1)
IF ($driverarray[$i,1] == "")
THEN
$driverarray[$i,1] = GetCurrentPlayerVar( "UserName" );
$UI_HT1=$UI_HT1+4;
openPrivButton($driverarray[$i,1],43,$UI_HT1,30,4,5,-1,32,GetCurrentPlayerVar( "NickName") ,Userinfopanel);
ENDIF
ENDFOR
EndSub

It seems like the for-loop runs 40 times and makes the button float around on your screen. So there's probably a problem with your IF-statement inside the FOR-loop.
Quote from Yisc[NL] :It seems like the for-loop runs 40 times and makes the button float around on your screen. So there's probably a problem with your IF-statement inside the FOR-loop.

i have also used the while function

$UI_HT1=46;
$i=1;
$driverarray = GetListOfPlayers("N");
WHILE($driverarray[$i] != "")
$UI_HT1=$UI_HT1+4;
openPrivButton($driverarray[$i],43,$UI_HT1,30,4,5,-1,32,GetCurrentPlayerVar( "NickName") ,Userinfopanel);
$i=$i+1;
ENDWHILE

i think i forgot something in teh code above , didnt test it \
but it happends the same
This reminds me of the code Krayy did for me condensing my acceleration messages,

Part of his code -


FOR ($j=0; $j<=$maxCars;$j=$j+1)
IF ( ToNum(IndexOf($accelData[$j], $PlayerCar)) >= 0 )
THEN
# globalMsg ("DEBUG: accelData = " . $accelData[$j]);
$aData = SplitToArray( $accelData[$j],"," );
dumpVar($aData);
# Do the following FOR loop in reverse (counting down), so that the buttons only get created once
FOR ( $i=$maxAccelerationTimes; $i >= 1; $i=$i-1)
IF( ToNum($PlayerTime) > ToNum( $aData[$i]) )
THEN
openPrivButton( "adjective",.......etc
openPrivButton( "acceleration",......etc
[B][COLOR=Blue]BREAK[/COLOR][/B]; # Break the FOR loop
ENDIF
ENDFOR
[B][COLOR=Blue]BREAK[/COLOR][/B]; # Break the FOREACH loop
ENDIF
ENDFOR

As you can see, he's put a BREAK in parts to stop the loops.

Maybe that's what you're missing?
hey sinanju
thx it works , now i go test if the code works with more than 2 users in the server.

EDIT

It works but i have changed the code. because the code in my post above didnt work for more than 2 users.
and in this code i dont have used the BREAK; but i guess this is normally in a while fuction


$UI_HT1=42;
$i=0;
$Users = GetListOfPlayers("N");
WHILE( $Users[$i] != "" )
$UI_HT1=$UI_HT1+4;
$currUserName = $Users[$i];
openPrivButton($Users[$i],43,$UI_HT1,30,4,5,-1,32,GetPlayerVar($currUserName,"NickName") ,Userinfopanel);
$i=$i+1;
ENDWHILE
ENDFOR

i'm running lapper 5.925
Lfslapper 6.0.1.1
I am currently running lfslapper, and it works great.
All I would like to do at this point is simply Rotate my tracks after so many races. For Example: After 3 races at SO1 auto change track.

Is there noway to create a GUI for Rotation of Tracks & Cars???

The simpler the better for me, I have looked at all the config files and
I am totally lost!



Thank you in advance for any help you or anyone can offer.

MadDogRhody

Administrator
www.rhodyracing.com
Tim [NL] made a GUI that will sort of do what you want, but you have to do the resets yourself manually.

When in game, type !gui and this will load the window with various choices, including tracks, cars, weather, qualifying laps and race laps.

Play around with it a bit - very easy to use.

Yisc [NL] also made something called ctrack; type !ctrack to open the gui window.

Both great at what they do.

If you can't remember the LFS short code for a track (e.g. AS4 = Aston Historic), the gui made by Yisc [NL] gives this detail - but doesn't allow you to change anything else but the track.
Gui
Yes thank you I am using that now.
Still would be super if we could have the same thing in !gui or !ctrack. but
have a button that would switch the track after so many races.
Then maybe have it reset to Qualify and or Race too!

I guess I can only dream at this point...

Thanks for the reply and information!

I bet someone out there knows how to make the tracks rotate automatically! in lfslapper!
There's a non-gui way to set it up in the LFSLapper.lpr file.

Search for "Race Control", then "$EnableRotation".

By default the enable rotation is set to false; change it to true, and change the tracks/cars to suit, and it should be done automatically.
Thanks Very Much!

So can I assume that this file lfslapper.lpr is the main file for editing or adding text messages also??

Thanks Again!

MadDogRhody
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG