Quote from Mustangman759 :im getting this error :/ Lang : en (id notfound) any ideas? (we purchased server recently from 500 servers)

You've got an error in your LFSLapper.lpr script.

Look in default/logs folder for file ending in err.log - that will give you a line number where the script has mistake (use something like PSPad, as that gives line numbers).
BMXTwins sent this to me o.o

7/3/2010 9:19:10 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:19:10 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:19:10 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:19:21 PM -> Syntax error in cfg file: Number of function argument not matche at line #658 in function 'onnewplayerjoin' script aborted
7/3/2010 9:19:27 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:20:16 PM -> Syntax error in cfg file :Content on file : "./includes/addonsused.lpr" at line #1
7/3/2010 9:20:16 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:20:17 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:20:17 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:20:17 PM -> Syntax error in cfg file: Number of function argument not matche at line #658 in function 'onnewplayerjoin' script aborted
7/3/2010 9:20:20 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:20:22 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:20:24 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:20:35 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:20:35 PM -> Syntax error in cfg file: Number of function argument not matche at line #669 in function 'ondisconnect' script aborted
7/3/2010 9:21:08 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:30 PM -> Syntax error in cfg file :Content on file : "./includes/addonsused.lpr" at line #1
7/3/2010 9:21:30 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:21:31 PM -> Syntax error in cfg file:

Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:21:31 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:21:34 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:36 PM -> Syntax error in cfg file: Number of function argument not matche at line #658 in function 'onnewplayerjoin' script aborted
7/3/2010 9:21:38 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:41 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:43 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:44 PM -> Syntax error in cfg file: Number of function argument not matche at line #415 in function 'onswearwords1' script aborted
7/3/2010 9:21:44 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:21:47 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:25:18 PM -> Syntax error in cfg file :Content on file : "./includes/addonsused.lpr" at line #1
7/3/2010 9:25:18 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:25:18 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:25:18 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:25:18 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:25:19 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:26:57 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:26:57 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:26:57 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:26:57 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:27:02 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:27:05 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:29:47 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:29:49 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:29:53 PM -> Syntax error in cfg file: Number of function argument not matche at line #669 in function 'ondisconnect' script aborted
7/3/2010 9:29:59 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:30:08 PM -> Syntax error in cfg file: Number of function argument not matche at line #658 in function 'onnewplayerjoin' script aborted
7/3/2010 9:30:17 PM -> Syntax error in cfg file: Number of function argument not matche at line #669 in function 'ondisconnect' script aborted
7/3/2010 9:32:33 PM -> Syntax error in cfg file :Content on file : "./includes/addonsused.lpr" at line #1
7/3/2010 9:32:34 PM -> Syntax error in cfg file "LFSLapper.lpr" at line #319
Command 'RegisterNodeAction' incorrect number of parameter
Function 'onlapperstart' script aborted
7/3/2010 9:32:34 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:32:34 PM -> Syntax error in cfg file: Number of function argument not matche at line #623 in function 'onconnect' script aborted
7/3/2010 9:32:35 PM -> Syntax error in cfg file: Number of function argument not matche at line #942 in function 'onmso' script aborted
7/3/2010 9:34:57 PM -> Syntax error in cfg file: Number of function argument no

Quote from Fire_optikz001 :BMXTwins sent this to me.....

Then I would suggest he checks his LFSLapper.lpr file at line 319 first, try find the error ther, then run lapper again, and check error file, and go for another common error line number, and search that, etc.

Notice that one of the errors is Command 'RegisterNodeAction' incorrect number of parameter.

I had this few times when I was working on earlier version of lapper script that didn't have 2nd parameter choice.

Early versions of lapper you would use
RegisterNodeAction( "AS1" , 137 , DisplaySpeed );

But later version, you would use
RegisterNodeAction( "AS1" , 137 , DisplaySpeed,"" );

If you put the comma and quotation marks in that line with earlier version of lapper, you get error.
i have 6.0.1.0 and UserIsAdmin( $userName ) no longer works o.o
-
(Fire_optikz001) DELETED by Fire_optikz001
i tried to make a function that replaces one string for another but it only takes the first letter of the $find string


<?php 
Sub StrReplace
$String$Find$Replace )
$SplitString splitToArray$String ,$Find );

$i 0;            
$total arrayCount$SplitString );

    WHILE (
$i <= $total)
$NewString $NewString $SplitString[$i] . $Replace;
        
$i $i 1;
    ENDWHILE

  return (
$NewString); 
EndSub
?>


Quote from Fire_optikz001 :i tried to make a function that replaces one string for another but it only takes the first letter of the $find string
...

Nice work as a starting point, just a few things missing. Put this in the utils.lpr:


<?php 
Sub StrReplace
$String$Find$Replace )
    
$DONE FALSE;
    
$NewString $String;
    WHILE ( 
$DONE == FALSE )
        
$FindIndex indexOf($NewString$Find);
        IF ( 
$FindIndex == -)
        
THEN
            $DONE 
TRUE;
        ELSE
            
$Split1 subStr$NewString ,0$FindIndex );
            
$SplitMid strLen($Split1) + strLen($Find);
            
$Split2 subStr$NewString ,$SplitMidstrLen($NewString) - $SplitMid );
            
$NewString $Split1 $Replace $Split2;
        ENDIF
    ENDWHILE
    return (
$NewString);
EndSub
?>


This will sub whole strings as well as chars.

Call like:

<?php 
Sub DoTest7
( )
    
$testStr "Here_it_is-mate";
    
privMsg ("testStr: " $testStr);
    
$newStr StrReplace($testStr,"_"," ");
    
privMsg ("newStr: " $newStr);
EndSub
?>


Hi,

A little question how to use closeButtonRegex.

I have for example serval GlobalButtons with all ID's start with "abcxxx"

"abc001" , "abc002" , "abc003" and i want them to close them all.

I use now closeGlobalButton("abc001&abc002&abc003"); but its earier to close them all with closeButtonRegex.

I treid
closeButtonRegex( GetCurrentPlayerVar( "UserName" ), "abc.*" );
But this not working in a Lapper event.

How do i get closeButtonRegex working in a Lapper event ?? ( like in Event OnRaceStart( $NumP ) # Lapper event )

Thanks in advance
Quote from Tim NL :Hi,

A little question how to use closeButtonRegex.

I have for example serval GlobalButtons with all ID's start with "abcxxx"

"abc001" , "abc002" , "abc003" and i want them to close them all.

I use now closeGlobalButton("abc001&abc002&abc003"); but its earier to close them all with closeButtonRegex.

I treid
closeButtonRegex( GetCurrentPlayerVar( "UserName" ), "abc.*" );
But this not working in a Lapper event.

How do i get closeButtonRegex working in a Lapper event ?? ( like in Event OnRaceStart( $NumP ) # Lapper event )

Thanks in advance

CloseButtonRegex is a Player event rather than a Lapper event, so it can't be used in any event that does not pass the UserName variable.

That being said, add this to your utils.lpr to close everyones buttons:

<?php 
Sub closeButtonRegexAll
$exp )
    
$LoP GetListOfPlayers( );
    FOREACH ( 
$Pid IN $LoP )
        
closeButtonRegex ($Pid["value"], $exp);
    ENDFOREACH
EndSub
?>


is there any way to make lfslapper catch some one typing /ai?
Quote from Krayy :This will sub whole strings as well as chars.

made a small update to your code


<?php 
Sub MultiStrReplace
$String$Find$Replace )
$Find splitToArray$Find,"|" );
$Replace splitToArray$Replace,"|" );
IF(
arrayCount($Find) == arrayCount($Replace) ) THEN
    $DONE 
FALSE;
    
$NewString $String;
    WHILE ( 
$DONE == FALSE )
        FOR (
$i=0;$i<=arrayCount($Find);$i=$i+1)
        
$FindIndex indexOf($NewString$Find[$i]);
        IF ( 
$FindIndex == -)
        
THEN
            $DONE 
TRUE;
        ELSE
            
$Split1 subStr$NewString ,0$FindIndex );
            
$SplitMid strLen($Split1) + strLen($Find[$i]);
            
$Split2 subStr$NewString ,$SplitMidstrLen($NewString) - $SplitMid );
            
$NewString $Split1 $Replace[$i] . $Split2;
        ENDIF
      ENDFOR
    ENDWHILE
    return (
$NewString);
ELSE
    return (
"^1ERROR: ^7Could Not Convert String");
ENDIF    
EndSub 
?>


Call:

<?php 
 MultiStrReplace
"Bob is a Cat Jack is also a Cat""Cat|Bob""Dog|Tom" )

# or another example

MultiStrReplace"Bob is a Cat Jack is also a Cat"" Jack is also a Cat|Bob|Cat""!|That Guy|Legend" )
?>

Quote from Krayy :CloseButtonRegex is a Player event rather than a Lapper event, so it can't be used in any event that does not pass the UserName variable.

That being said, add this to your utils.lpr to close everyones buttons:

<?php 
Sub closeButtonRegexAll
$exp )
    
$LoP GetListOfPlayers( );
    FOREACH ( 
$Pid IN $LoP )
        
closeButtonRegex ($Pid["value"], $exp);
    ENDFOREACH
EndSub
?>



Thx Krayy, works like a charm
Hey. So I've got this Lapper 5.7.1.6 and everything is fine ,accept two things I want to change.

First: When I get out of pit ,I need to make one lap before It starts to show my score to the others.
How can I fix it ,so It can show my score in the 1st Lap(after I get out of pit and go true the finish line) ?

Second: Everything saves in DriftPB.file and PB.file
,but when I type !drf or !top it shows me only one person which I think is just a demo/test to show that !top/!drf works.

Here:


Only this is showing ,but in DriftPB.file and PB.file there is more data(more people)...?
Quote from r3zp3k7 :Hey. So I've got this Lapper 5.7.1.6 and everything is fine ,accept two things I want to change.

First: When I get out of pit ,I need to make one lap before It starts to show my score to the others.
How can I fix it ,so It can show my score in the 1st Lap(after I get out of pit and go true the finish line) ?

Couple of things here - no score is saved to the database until you do one complete lap (outlaps/inlaps don't count as full laps). And as for your score, likely that it's showing in private buttons rather than global buttons, so a drivers score won't be visible to anyone but the driver.


Quote from r3zp3k7 :Second: Everything saves in DriftPB.file and PB.file
,but when I type !drf or !top it shows me only one person which I think is just a demo/test to show that !top/!drf works.

Only this is showing ,but in DriftPB.file and PB.file there is more data(more people)...?

Likely that this is $DefaultTopCar issue.

In your LFSLapper.lpr file, search for $DefaultTopCar.

You probably have something like $DefaultTopCar = "XRT";

Instead, make it
$DefaultTopCar = "UFR+XFR+RB4+RAC+FZR+XRR+FXR+FBM+LX4+LX6+XFG+XRG+XRT+FZ5+FXO+FO8+FOX+MRT+UF1+BF1";

or whatever cars you drift with, like $DefaultTopCar = "RB4+RAC+FZR+XRT+FZ5";
Thanks a lot sinanju.
If I learn a bit ,I might make "half" laps to tell the score like some other servers...
You helped me a lot ,and it works..
I was a bit blind ,because I tried early ,but now works 100%.
Sorry for the double post ,but its really badas$...

Is there a way to fix this ?
The Drift Score to be Saved in the Lapper's DB ?(1st lap > out of pit in Practice)

I really need it ,because its bothers everybody...
They always ask ,why isn't it saved..And im like

If you can just tell me where I should look or something.(in the script)
Quote from r3zp3k7 :Sorry for the double post ,but its really badas$...

Is there a way to fix this ?
The Drift Score to be Saved in the Lapper's DB ?(1st lap > out of pit in Practice)

I really need it ,because its bothers everybody...
They always ask ,why isn't it saved..And im like

If you can just tell me where I should look or something.(in the script)

I think it's hard wired into the coding, so nothing there you could change.

The alternative, is to "remind" people that the score isn't saved.

Something like

[COLOR=Navy]Event OnDriftScore( $userName ) # Player event
IF (GetCurrentPlayerVar( SessLaps ) <1)
[/COLOR][COLOR=Navy] [/COLOR][COLOR=Navy]THEN
openPrivButton( "drift_nosave",80,80,40,10,4,3,0,"^1> Scores not saved"
. "&on your outlap" );
[/COLOR][COLOR=Navy] [/COLOR][COLOR=Navy]ENDIF
EndEvent[/COLOR]

Haven't tested it, and long time since I used that version of code, so not sure if code syntax is exactly right.

I had something similar (also a speed related message too? drop below minimum speed and message appeared) in my circular driftmeter - look at code http://www.lfsforum.net/showthread.php?t=66124

Feel free to copy and change.
Hi,

I have a problem with my script to let users set their own language.
The purpose of the script is the same as in !myconfig, to set the language, but instead of doing this in !myconfig, i want to do this in my own menu.

This is the piece of my script that sets the language:

<?php 
Sub SetLang_en
($KeyFlags,$userName)
    
SetCurrentPlayerVar("IdLang","en");
    
DoMenu_Options($KeyFlags,$userName);
EndSub
Sub SetLang_fr
($KeyFlags,$userName)
    
SetCurrentPlayerVar("IdLang","fr");
    
DoMenu_Options($KeyFlags,$userName);
EndSub
Sub SetLang_nl
($KeyFlags,$userName)
    
SetCurrentPlayerVar("IdLang","nl");
    
DoMenu_Options($KeyFlags,$userName);
EndSub
Sub SetLang_no
($KeyFlags,$userName)
    
SetCurrentPlayerVar("IdLang","no");
    
DoMenu_Options($KeyFlags,$userName);
EndSub
?>


When the NL button is pushed, the Sub SetLang_nl will be executed.
The script does it's work and the language is changed to NL.
BUT! When I quit or !reload LFSLapper or when an user rejoins the host, the language is not saved..

When I change the language in !myconfig, I can see it is saved in the cfguser.txt file (lfslapper 'bin' folder). But when I use my own script, the language will be changed for that session, but it isn't saved in the cfguser.txt file.

How can I let my own script work, so the language selection is being saved?

I hope you guys can help me with this
Thanks in advance!

Kind regards,
Tim
I struggle on set and get variables, but one way to do it is to have sub-routine to run on connecting [Event OnConnect( $userName )] and/or connect close [Sub OnConnectClose($userName)].

e.g.
SetCurrentPlayerVar( "IdLang",GetStoredValue( $userName . "IdLang" ) );

Then maybe think about setting a default value if no value is loaded
IF ( GetCurrentPlayerVar( "IdLang" ) == "")
THEN
SetCurrentPlayerVar( "IdLang","nl" ); # Set default language to "nl" # dutch
ENDIF
Mate ,I typed some sh!t and it looks like this:

Quote :Event OnDriftScore()
privMsg( "Score: ^7" . $DriftScore . " ^3" . $LastDriftScore );
IF (GetCurrentPlayerVar( SessLaps ) <1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^1 Scores not saved" . "&^1on your outlap!" );
IF (GetCurrentPlayerVar( SessLaps ) >1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^2 Scores is being saved." . "&^2in the database!" );
EndEvent

Can you fix it so I't can work ?
When its 1 = Not Saved ,if 1+ = Saved.. :X ?
I can't handle it + I typed stupid stuff..
And got confused.

p.s. I tried adding "Else" and stuff... But really wen't confused..
Quote from sinanju :I struggle on set and get variables, but one way to do it is to have sub-routine to run on connecting [Event OnConnect( $userName )] and/or connect close [Sub OnConnectClose($userName)].

e.g.
SetCurrentPlayerVar( "IdLang",GetStoredValue( $userName . "IdLang" ) );

Then maybe think about setting a default value if no value is loaded
IF ( GetCurrentPlayerVar( "IdLang" ) == "")
THEN
SetCurrentPlayerVar( "IdLang","nl" ); # Set default language to "nl" # dutch
ENDIF

Edit: It does work! Thanks!! This is what I have done:

For all languages AND for the Speed Unit and Show/Hide split info settings I coded like this:

<?php 
Sub SetLang_nl
($KeyFlags,$userName)
    
SetCurrentPlayerVar("IdLang","nl");
    
setUserStoredValue("IdLang","nl");
    
DoMenu_Options($KeyFlags,$userName);
EndSub
?>


So the setting will be saved immediately in the 'storedvalue' database after the option is selected. First I had the setUserStoredValue in the OnDisConnect event, but then the data will be lost when Lapper restarts or closes. So I think this is the best option for it

After this, I made LFSLapper load the data when the player joins the server.
Therefor I did this:

<?php 
### Load settings on connect (IdLang, UnitSpeedKmh and ShowSplitPb) ###
CatchEvent OnConnect$userName )
    
$StoredIdLang getUserStoredValue("IdLang");
    
SetCurrentPlayerVar("IdLang",$StoredIdLang);
    
    
$StoredSpeedUnitKmh getUserStoredValue("UnitSpeedKmh");
    
SetCurrentPlayerVar("UnitSpeedKmh",$StoredSpeedUnitKmh);
    
    
$StoredShowSplitPb getUserStoredValue("ShowSplitPb");
    
SetCurrentPlayerVar("ShowSplitPb",$StoredShowSplitPb);
EndCatchEvent
?>


I've also overwritten the !myconfig command, so the settings can't be stored on 2 different places. (cfguser.txt and storedvalue.dbs)

Many thanks, because of you I tried the get/setUserStoredValue variable and now it works!
The !myconfig command now points to my own options menu.

<?php 
        
CASE "!myconfig":
            
DoMenu_Options($KeyFlags,$userName);
            BREAK;
?>

Kind regards,
Tim
Quote from r3zp3k7 :Mate ,I typed some .. "Else" and stuff... But really wen't confused..

When you use a IF statement, you have to finish with an ENDIF.

And instead of using IF twice, you could maybe use an ELSE.

And you haven't defined $DriftScore or $LastDriftScore.

These 2 aren't player variables - they're shorthand.

Instead of writing GetCurrentPlayerVar("DriftScore") you can tell lapper that
$DriftScore = GetCurrentPlayerVar("DriftScore")
then put $DriftScore as part of your code.

So
Event OnDriftScore()
$DriftScore = GetCurrentPlayerVar("DriftScore");
$LastDriftScore = GetCurrentPlayerVar("LastDriftScore");
....
#do something like
privMsg( "Score: ^7" . $DriftScore . " ^3" . $LastDriftScore );
....
EndEvent

And when using IF-ENDIF statements, then

Event OnDriftScore()
$DriftScore = GetCurrentPlayerVar("DriftScore");
$LastDriftScore = GetCurrentPlayerVar("LastDriftScore");

privMsg( "Score: ^7" . $DriftScore . " ^3" . $LastDriftScore );
IF (GetCurrentPlayerVar( SessLaps ) <1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^1 Scores not saved" . "&^1on your outlap!" );
ENDIF

IF (GetCurrentPlayerVar( SessLaps ) >1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^2 Scores is being saved." . "&^2in the database!" );
ENDIF
EndEvent

or

Event OnDriftScore()
$DriftScore = GetCurrentPlayerVar("DriftScore");
$LastDriftScore = GetCurrentPlayerVar("LastDriftScore");

privMsg( "Score: ^7" . $DriftScore . " ^3" . $LastDriftScore );
IF (GetCurrentPlayerVar( SessLaps ) <1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^1 Scores not saved" . "&^1on your outlap!" );
ELSE
IF (GetCurrentPlayerVar( SessLaps ) >1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^2 Scores is being saved." . "&^2in the database!" );
ENDIF
ENDIF
EndEvent

2 IF statements in above code, and 2 ENDIF's at end.

You might even be able to shorten it to

Event OnDriftScore()
$DriftScore = GetCurrentPlayerVar("DriftScore");
$LastDriftScore = GetCurrentPlayerVar("LastDriftScore");

privMsg( "Score: ^7" . $DriftScore . " ^3" . $LastDriftScore );
IF (GetCurrentPlayerVar( SessLaps ) <1)
THEN
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^1 Scores not saved" . "&^1on your outlap!" );
ELSE
openPrivButton( "drift_nosave",20,9,38,10,5,4,5,"^2 Scores is being saved." . "&^2in the database!" );
ENDIF
EndEvent

Bit of trial and error and you should get there.

Good luck.
Quote from sinanju :

Event OnDriftScore()
$DriftScore = GetCurrentPlayerVar("DriftScore")[COLOR=Red];[/COLOR]
$LastDriftScore = GetCurrentPlayerVar("LastDriftScore")[COLOR=Red]; [/COLOR]
EndEvent


well none of these codes will work unless you add what i added in red
Hi,

Is it possible to get the splits from your PB separately?
Now you can get your PB splits by typing '!stats'. Then in the second line your PB splits will be shown, like this: '0.19.01 0.42.02 1.17.91'.

The reason I'd like to have these splits separately is because I wanted to extend the DefPitInfo.lpr a bit. I wanted to give an extra line at every split where you can see how many time you are in red or green from your PB.
Then you can easily see if you can get a new PB when you are by split 3 or something like that.
I think it would be cool, but I don't know how to do this because I haven't found a PlayerVar for the separate PB splits. (or PB sectors)

Thanks in advance!

Regards,
Tim
There's various PlayerVar's you can probably use, like

Split1, // Last First Split, updated when doing new Split1
Split2, // Last Second Split, erased when doing Split1
Split3, // Last third Split, erased when doing Split1
SectorSplit1, // Last First sector Time, updated when doing new Split1
SectorSplit2, // Last Second sector Time, updated when doing new Split2
SectorSplit3, // Last third sector Time, updated when doing new Split3
SectorSplitLast, // Last Last sector Time, erased when doing Split1
BestSectorSplit1, // Best Split duration for the sector 1
BestSectorSplit2, // Best Split duration for the sector 2
BestSectorSplit3, // Best Split duration for the sector 3
BestSectorSplitLast, // BestSplit duration for the last sector
DiffSectorSplit1, // SectorSplit1 - BestSectorSplit1
DiffSectorSplit2, // SectorSplit2 - BestSectorSplit2
DiffSectorSplit3, // SectorSplit3 - BestSectorSplit3
DiffSectorSplitLast, // SectorSplitLast - BestSectorSplitLast
IsBestSectorSplit1, // 1 if this sector split is best than previous Best, otherwise 0
IsBestSectorSplit2, // 1 if this sector split is best than previous Best, otherwise 0
IsBestSectorSplit3, // 1 if this sector split is best than previous Best, otherwise 0
IsBestSectorSplitLast, // 1 if this sector split is best than previous Best, otherwise 0
I know this PlayerVar exist, but for what I'm trying to do I can't use them, I think.

With this PlayerVar's you can get the last split, last sector, best split, best sector, eg.
But I'd like to have a PlayerVar that can get the split or sector from your PB lap.

Regards,
Tim
This thread is closed

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