The online racing simulator
Hy Sinanju,

How the things are ? I didnt posted any questions but now i do. What I need the rewrite in driftmeter to show the driftbox after my speed is reached 20 KM/h so if I stop and my speed is 0 I want to dissapear and if i reach again the 20KM/h to show again.

ThX friend !
Quote from sarxes :What I need the rewrite in driftmeter to show the driftbox after my speed is reached 20 KM/h so if I stop and my speed is 0 I want to dissapear and if i reach again the 20KM/h to show again.

Firstly, change $MinimumDriftSpeed to


<?php 
$MinimumDriftSpeed 
20
?>


This will be in the driftmeter.lpr configuration file.

It may also appear in the LFSLapper.lpr file - if it is, either delete the line or change it too.

Do you want the score to disappear, or do you want the whole scorebox to disappear?

Whichever, it would mean inclusion of an IF-THEN-ELSE-ENDIF.

For example;


<?php 
IF ($MinimumDriftSpeed <20)
THEN
....
.. 
code in here to hide score or whole scorebox
....
ELSE
....
.. 
code in here to show score or whole scorebox
....
ENDIF
?>

Driftmeter.lpr already uses IF-ENDIF for lots of things - you just need an additional one.

Good luck!
I made this but its doesnt show nothing


<?php 
CatchEvent OnDriftScore
$userName # This is the section for displaying the Drift Meter and Drift Messages
    
    

    
$AngleVelocity GetCurrentPlayerVar"AngleVelocity" );
    
$DriftScore GetCurrentPlayerVar"DriftScore" );
    
$LastDriftScore GetCurrentPlayerVar"LastDriftScore" );
    

    IF (
$MinimumDriftSpeed <25)
    
THEN
    closePrivButton
"mylogo",5,138,22,3,1,-1,16,langEngine"%{driftmeter_mylogo}%" ));
    
closePrivButton"driftboxback",5,137,22,35,4,-1,16," ");
    
closePrivButton"driftanglebox",6,146,10,20,4,-1,16," ");
    
closePrivButton"driftcombbox",16,146,10,10,3,-1,16," ");
    
closePrivButton"driftscorebox",16,156,10,10,3,-1,16," ");
    
closePrivButton"driftangleboxtext",6,146,10,5,3,-1,0,langEngine"%{driftmeter_driftangleboxtext}%" ));
    
closePrivButton"driftcomboboxtext",16,146,10,5,3,-1,0,langEngine"%{driftmeter_driftcomboboxtext}%" ));
    
closePrivButton"driftscoreboxtext",16,156,10,5,3,-1,0,langEngine"%{driftmeter_driftscoreboxtext}%" ));

    
closePrivButton"TDSM",6,140,20,4,2,-1,16,langEngine"%{driftmeter_TDSM}%" ) );

    
closePrivButton"driftcomboboxtexttop",85,1,30,7,4,-1,96,langEngine"%{driftmeter_driftcomboboxtexttop}%" $DriftScore ) );
    ELSE
    
    
openPrivButton"mylogo",5,138,22,3,1,-1,16,langEngine"%{driftmeter_mylogo}%" ));
    
openPrivButton"driftboxback",5,137,22,35,4,-1,16," ");
    
openPrivButton"driftanglebox",6,146,10,20,4,-1,16," ");
    
openPrivButton"driftcombbox",16,146,10,10,3,-1,16," ");
    
openPrivButton"driftscorebox",16,156,10,10,3,-1,16," ");
    
openPrivButton"driftangleboxtext",6,146,10,5,3,-1,0,langEngine"%{driftmeter_driftangleboxtext}%" ));
    
openPrivButton"driftcomboboxtext",16,146,10,5,3,-1,0,langEngine"%{driftmeter_driftcomboboxtext}%" ));
    
openPrivButton"driftscoreboxtext",16,156,10,5,3,-1,0,langEngine"%{driftmeter_driftscoreboxtext}%" ));

    
openPrivButton"TDSM",6,140,20,4,2,-1,16,langEngine"%{driftmeter_TDSM}%" ) );

    
openPrivButton"driftcomboboxtexttop",85,1,30,7,4,-1,96,langEngine"%{driftmeter_driftcomboboxtexttop}%" $DriftScore ) );
    
    ENDIF
?>

When closing a button, you only use the button name - not the placement, dimensions, etc., of the button.

So instead of

closePrivButton( "mylogo",5,138,22,3,1,-1,16,langEngine( "%{driftmeter_mylogo}%" ));
closePrivButton( "driftboxback",5,137,22,35,4,-1,16," ");
etc., etc.

you would use

closePrivButton( "mylogo&driftboxback");

The bit after the first open bracket (shown here in red), and between quotes, is the button name.

If you wanted to close further buttons, you separate them with an ampersand (&) symbol.

Apart from that, not sure if your code would work anyway.

Haven't looked at my code, but you may be trying to close buttons that haven't already been placed on screen.

Maybe try code other way round, so instead of something like

IF ($MinimumDriftSpeed <25)
THEN
closePrivButton( "mylogo&driftboxback");
ELSE
openPrivButton( "mylogo",5,138,22,3,1,-1,16,langEngine( "%{driftmeter_mylogo}%" ));
openPrivButton( "driftboxback",5,137,22,35,4,-1,16," ");

ENDIF

try

IF ($MinimumDriftSpeed >25)
THEN
openPrivButton( "mylogo",5,138,22,3,1,-1,16,langEngine( "%{driftmeter_mylogo}%" ));
openPrivButton( "driftboxback",5,137,22,35,4,-1,16," ");

ELSE

ENDIF

If buttons are already on screen when doing less than 25kph, then between ELSE and ENDIF, add
closePrivButton( "mylogo&driftboxback");

IF closePrivButton isn't needed then don't use it - why risk getting errors with lapper trying to close non existent buttons?
Quote from sinanju :

[/COLOR][/COLOR]try

IF ($MinimumDriftSpeed >25)
THEN
openPrivButton( "mylogo",5,138,22,3,1,-1,16,langEngine( "%{driftmeter_mylogo}%" ));
openPrivButton( "driftboxback",5,137,22,35,4,-1,16," ");

ELSE

ENDIF

If buttons are already on screen when doing less than 25kph, then between ELSE and ENDIF, add
closePrivButton( "mylogo&driftboxback");

IF closePrivButton isn't needed then don't use it - why risk getting errors with lapper trying to close non existent buttons?

Its doesnt work :/

And how should I integrate the drift list like this racepos ? I added the button but I dont know how on continue ....
Attached images
list.jpg
Tried various ways of adding IF..ENDIF statements, then sub-routines if score was on or above set speed then show, and if not, don't show, but couldn't get anything to work.

Then had a look thru the list of Events that are allowed, and found


<?php 
# Actions to do when drift score is resette to zero when to low speed.
Event OnDriftResetScore$userName # Player event

EndEvent
?>


So basically, you just want to put the close button line(s) in between the event and endevent - or in this case, because it's an add-on, then it would be CatchEvent / EndCatchEvent.

To make it easier, I've renamed some of the buttons (adding 'drift' in front of name, so that I could use closeButtonRegex to close all buttons that start "drift.....", and attached new driftmeter that you can try.

Tried it, but although it seems to work ok, not big fan of it.

I can see some people complaining on your server that it keeps disappearing for no reason (when it drops below your set speed).

As an alternative, you could make additional button like

<?php 
    openPrivButton
"drift_explain",5,137,22,6,4,-1,32,"^1Too Slow%nl% %nl%Lost Scores" );
?>

and add that at the end of the CatchEvent OnDriftResetScore section.
Attached files
driftmeter.zip - 4.3 KB - 215 views
Quote from sarxes :And how should I integrate the drift list like this racepos ? I added the button but I dont know how on continue ....

On the image, it looks like the "Racepos" tab has been clicked and is showing the top driver time positions (as per Krayy's CIF module).

What happens if you click the "Drift List" tab?

Do you get a table like the 'Racepos' table, but driftscores instead of times?

If so, maybe you could ask server admins how it's done, as it's way way way beyond my meagre skills!
Quote from sinanju :

As an alternative, you could make additional button like

<?php 
    openPrivButton
"drift_explain",5,137,22,6,4,-1,32,"^1Too Slow%nl% %nl%Lost Scores" );
?>

and add that at the end of the CatchEvent OnDriftResetScore section.

There is something wrong in the new driftmeter :


<?php 
driftmeter_TDS01 
"^8?";

    
driftmeter_TDS11 "^0:(";

    
driftmeter_TDS21 "^2+";

    
driftmeter_TDS31 "^3++";

    
driftmeter_TDS41 "^4*";

    
driftmeter_TDS51 "^5**";

    
driftmeter_TDS61 "^6:)";
    
driftmeter_TDS62 "^6*";

    
driftmeter_TDS71 "^7!";

    
driftmeter_TDS81 "^8!!";

    
driftmeter_TDS91 "^1:)";
?>

These "icons" are wont show in the new driftmeter .... :/
Quote from sarxes :There is something wrong in the new driftmeter/

I've just re-loaded the file I zipped up, and it works ok for me (using in offline mode).

Did you change anything in the file?
Attached images
Driftmeter_amended.jpg
I've just updated my last driftmeter.lpr code with addition of 'Too Slow' message to replace scorebox when speed drops too low - see attached.
Attached images
Driftmeter_amended with Too Slow message.jpg
Attached files
Driftmeter.zip - 31 KB - 246 views

<?php 
3
/16/2012 8:05:35 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #232
    
Function not defined...closeButtonRegex
    
Function 'ondriftscore./includes/driftmeter.lpr-50' script aborted
3
/16/2012 8:05:39 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #116
    
Function not defined...closeButtonRegex
    
Function 'ondriftscore./includes/driftmeter.lpr-50' script aborted
3
/16/2012 8:05:40 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #232
    
Function not defined...closeButtonRegex
    
Function 'ondriftscore./includes/driftmeter.lpr-50' script aborted
3
/16/2012 8:05:43 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #116
    
Function not defined...closeButtonRegex
    
Function 'ondriftscore./includes/driftmeter.lpr-50' script aborted
3
/16/2012 8:05:45 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #116
    
Function not defined...closeButtonRegex
    
Function 'ondriftscore./includes/driftmeter.lpr-50' script aborted
3
/16/2012 8:05:45 PM -> Syntax error in cfg file "./includes/driftmeter.lpr" at line #349
    
Function not defined...closeButtonRegex
    
Function 'ondriftresetscore./includes/driftmeter.lpr-348' script aborted
?>


Quote from sinanju :I've just re-loaded the file I zipped up, and it works ok for me (using in offline mode).

Did you change anything in the file?

What version of lapper are you using?

The closeButtonRegex expression came out in version 5.926, so if you're getting these errors it would appear that you are using an earlier version.

I've just downloaded my new file and tried it on my other pc with lapper v6.012 and it's working fine.

So I would advise upgrading to version 6.012 or later.

Krayy's added a lot of cool stuff to the later versions of lapper via his CIF modules, so worth it just for them. And you've more chance of things working!
-
(sarxes) DELETED by sarxes
Yeah , okay I resolved So how should I do that I made route chackers on track and I want to spectate players who drive trough on a chacker tiwce !

I attached an ex. picture . So there is players who make a lot of circles around the red line what I suggest on the picture and they have a lot of drift points ! Or its good for me that if someone drive twice on a route chacker reset the drift point to zero

and my other question is that why

<?php 
CatchEvent OnSplit1
$userName # Player event
    
IF ( $DriftScore )
    
THEN
        $DriftScore
=0
    
ENDIF

    IF ( 
$LastDriftScore )
    
THEN
        $LastDriftScore
=0
    
ENDIF

EndCatchEvent
?>


this code doesnt work ...
Attached images
how.png
Quote from sarxes :

and my other question is that why

<?php 
CatchEvent OnSplit1
$userName # Player event
    
IF ( $DriftScore )
    
THEN
        $DriftScore
=0
    
ENDIF

    IF ( 
$LastDriftScore )
    
THEN
        $LastDriftScore
=0
    
ENDIF

EndCatchEvent
?>


this code doesnt work ...

Because you haven't told lapper what $DriftScore & $LastDriftScore are or what they mean.

On every Event (including CatchEvent), you need to define each of the variables you're going to use.

Try


<?php 
CatchEvent OnSplit1
$userName # Player event

    
$DriftScore GetCurrentPlayerVar"DriftScore" );
    
$LastDriftScore GetCurrentPlayerVar"LastDriftScore" );

    IF ( 
$DriftScore )
    
THEN
        $DriftScore
=0
    
ENDIF

    IF ( 
$LastDriftScore )
    
THEN
        $LastDriftScore
=0
    
ENDIF

EndCatchEvent
?>


Quote from sarxes :So how should I do that I made route chackers on track and I want to spectate players who drive trough on a chacker tiwce !

Route Checkers are automatic LFS events, and nothing to do with any InSims.

If someone goes thru route checkers in the wrong order, or the same checker twice, then they should be automatically spectated.
THX a lot for your help again , but the code doesnt work any more
lapper fault
guys need help on lapper when in lfs you have t!pwgui set pit window when this is set to 1 pit window with tyre change nothing is done am i missing something ?
Quote from paul88 :guys need help on lapper when in lfs you have t!pwgui set pit window when this is set to 1 pit window with tyre change nothing is done am i missing something ?

We're currently rewriting that module for the new lapper version, so we'll fix it in the next release
The tyre change part was never finished, since I couldn't get it to work in the older Lapper version. Maybe it would be working with the latest version of Lapper.
There is any way to run LFS lapper without dedicated host in single player ?
Quote from sarxes :There is any way to run LFS lapper without dedicated host in single player ?

LFS needs a lfs server to connect to, so technically you can run LFS on your PC and set it up as a local server then connect Lapper to that
hi guys i need help here...

about

###################################
#Authorization Options ( license )#
###################################

how i can Choose only Friends licenses Join to server<for Example


coz I've seen this before and the server kicked me because I did not register to website for drift team or something like that !! But I was not sure about the InSim lfslapper or somthing else !!
Quote from ViKTOOR-LFS :hi guys i need help here...

about

###################################
#Authorization Options ( license )#
###################################

how i can Choose only Friends licenses Join to server<for Example


coz I've seen this before and the server kicked me because I did not register to website for drift team or something like that !! But I was not sure about the InSim lfslapper or somthing else !!

To be honest I've never understood the Auth system myself.

What exactly are you wanting to acheive?
Quote from Krayy :To be honest I've never understood the Auth system myself.

What exactly are you wanting to acheive?

i need for exp. when someone or anyone try to join the server he get kick or ban already and Leave him a message or link to take my approved.If allowed to enter I put his name on lfslapper or admin.txt or somthing like that !! Because I have problems with some licenses users and I want to chose any licenses only allow to enter the server. i hope u you get my point


Lang "EN"
main_welc2 = "^7You are not allowed to join this server unless you have been approved by the server admin."
. "%nl%^2Please visit <this website> to apply for approval."
. "%nl%"
. "%nl%^4Approval is required as we have a problem with new users coming here and causing accidents, and not understanding the rules

^^
and when this message show i cant know how to do auto kick or ban. only when he press "OK" he get kicked >> me also i cant join i only have "ok" to kicked my self loool.. so i stop the lfslapper Until I find a solution to this problem
Attached images
NMA07861.jpg
What you really want is to set this:


Event OnNewPlayerJoin()
UserGroupFromFile( "authorised_ab_users", "./Authorisation.txt" );
$userName = GetCurrentPlayerVar ( "UserName" );
IF( UserInGroup( "authorised_ab_users",$userName ) != 1 )
THEN
cmdLFS("/spec " . GetCurrentPlayerVar("Nickname") );
cmdLFS("/msg " . GetCurrentPlayerVar("Nickname") . "^3 not allowed on this server");
ENDIF
EndEvent

This way only the people mentioned (you will need their LFS world names, instead of the nicknames they use) in your Authorisation.txt will have access to your server. If you are not on that list, you will get spectated (/spec) and get a message (/msg) that your not allowed on this server.
This thread is closed

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