The online racing simulator
Quote from sinanju :You can't have 2 versions of lapper running at same time, which is what you're trying to do with one LFS server.

Stop one, and restart the other.

Unless there's something specific that you want in Krayy's V6.013, then I'd advise stopping that one, and leaving your original lapper running, as that's likely to be setup the way you want it and have developed it over last few months or so.

I would also advise that for any lapper changes you want to make, you try them on your local pc (127.0.0.1), then if you're happy everything appears to be working, then copy the amended files onto 500Servers.

i do like u say. but still not starting

i think is there proplem from 500servers.

see this email
..................
So I think I have to wait until they replay me everying is working Cleary or somthing like that .
Attached images
lol.jpg
Hello all,

There is any way to that player couldn't use knobly tires ? If they are using they cant pit out until they change the tire to normal or super ... Like a handicap option

THX !
Haven't tested it, but you could try something like


<?php 
Event OnNewPlayerJoin
$userName )  # Player event

    
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" )

    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
    ENDIF

EndEvent
?>


Quote from sinanju :Haven't tested it, but you could try something like


<?php 
Event OnNewPlayerJoin
$userName )  # Player event

    
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" )

    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
    ENDIF

EndEvent
?>



I added but it's doesnt work ... :S
Just noticed that I missed a semi-colon at the end of a line - should be

$TFR = ( GetCurrentPlayerVar( "TyreFrontRight" );

Amended code:

<?php 
Event OnNewPlayerJoin
$userName )  # Player event

    
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );

    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
    ENDIF

EndEvent
?>



My code looks like is !


<?php 
##########################################
#New PLayer joining race or leaving pits)#
##########################################

Event OnNewPlayerJoin$userName )  # Player event

openPrivButton"label_lfslogo",147,25,60,5,1,-1,0,langEngine"%{label_lfslogo}%" ));
openPrivButton"label_logo",165,12,30,14,1,-1,128,langEngine"%{label_logo}%" )); 


 
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );
 
$TFL = ( GetCurrentPlayerVar"TyreFrontLeft" );
 
$TRR = ( GetCurrentPlayerVar"TyreRearRight" );
 
$TRL = ( GetCurrentPlayerVar"TyreRearLeft" );

    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
        
    IF (
$TFL == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
        
    IF (
$TRR == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
        
    IF (
$TRL == "TYRE_KNOBBLY" )
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
privRcm"You have been spectated for using ^1Knobbly ^8tyres");
        
privRcm"Please change to ^4Normal ^8or ^4Super ^8tyres" );
        
    ENDIF

EndEvent
?>


Do you see any problem ?
An IF statement always have to end with ENDIF
So you are basicly missing 3 ENDIFs
Quote from Yisc[NL] :An IF statement always have to end with ENDIF
So you are basicly missing 3 ENDIFs

Im added but noting ....
What have you done to debug your code?
Have you tried to see if $TFR etc do have a value by echoing them on the console or in the LFS chat?
If they have a value, have you checked that you really go into an IF-statement?
I've been doing some testing with the following;


<?php 
Event OnExitPitLane
(  $userName # Player event
    
$OTFR = ( GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );

    
openPrivButton"otfr",50,25,100,15,5,8,32"^1Pre IF statement: OLD tyres being used at front are:  ",GetCurrentPlayerVar("OldTyreRearRight"));
    
openPrivButton"tfr",50,50,100,15,5,8,32"^1Pre IF statement: NEW tyres being used at front are:  ",GetCurrentPlayerVar("TyreRearRight")    
        
    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
    openPrivButton
"otfr",50,75,100,15,5,8,32"IF statement: OLD tyres being used at front are:  " $OTFR);
    
openPrivButton"tfr",50,100,100,15,5,8,32"IF statement: NEW tyres being used at front are:  " $TFR); 
        
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
    
openPrivButton"tyrespec",50,125,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
    
openPrivButton"tyrechange",50,150,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );        
    ENDIF
EndEvent
?>


I changed the EVENT from OnNewPlayerJoin to OnExitPitLane, and changed prvMsg to openPrivButton.

Some of the code is working, but some just doesn't output as you would expect, but it does spec you if you leave pit lane with Knobbly tyres.

See image for on screen messages.

If you change code to something like


<?php 
Event OnExitPitLane
(  $userName # Player event
    
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );
        
    IF (
$TFR == "TYRE_KNOBBLY" )
    
THEN
    openPrivButton
"tyrespec",50,125,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
     
openPrivButton"tyrechange",50,150,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );  
        
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );      
    ENDIF
EndEvent
?>


it may work.

By the by; when you change tyres, you change front left/right and rear left/right as pairs, so you don't need so many IF statements. Just pick one front wheel and one back wheel and code should still work.

Haven't tested code in different EVENTS, so may work in OnNewPlayerJoin if changing to outputting text on buttons.
Attached images
LFS Knobbly tyre results.jpg
...or you could something like....


<?php 
Event On
.........
 
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );
 
$TFL = ( GetCurrentPlayerVar"TyreFrontLeft" );
 
$TRR = ( GetCurrentPlayerVar"TyreRearRight" );
 
$TRL = ( GetCurrentPlayerVar"TyreRearLeft" );

   IF ((
$TFR == "TYRE_KNOBBLY" ) || ($TFL == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TRL == "TYRE_KNOBBLY" ))
    
THEN
        openPrivButton
"tyrespec",50,50,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,70,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" ); 
        
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
    ENDIF
EndEvent
?>


Quote from sinanju :...or you could something like....


<?php 
Event On
.........
 
$TFR = ( GetCurrentPlayerVar"TyreFrontRight" );
 
$TFL = ( GetCurrentPlayerVar"TyreFrontLeft" );
 
$TRR = ( GetCurrentPlayerVar"TyreRearRight" );
 
$TRL = ( GetCurrentPlayerVar"TyreRearLeft" );

   IF ((
$TFR == "TYRE_KNOBBLY" ) || ($TFL == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TRL == "TYRE_KNOBBLY" ))
    
THEN
        openPrivButton
"tyrespec",50,50,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,70,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" ); 
        
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
    ENDIF
EndEvent
?>



Sin, i dont want to be rubbish, but i tried with on connect on leavepit and not working for me ... :S
Knobbly tyres for FTW :banana::sadbanana:banana::drink:
Quote from ViKTOOR-LFS :Knobbly tyres for FTW :banana::sadbanana:banana::drink:

What you mean under FTW ? I have to change to this ?
Quote from sarxes :Sin, i dont want to be rubbish, but i tried with on connect on leavepit and not working for me ... :S

I've been doing some testing, and it seems like code will only work if you change it to old tyres!

Try

<?php 
Event OnExitPitLane
(  $userName # Player event
    
$OTFR GetCurrentPlayerVar"OldTyreFrontRight" );
    
$OTRR GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR GetCurrentPlayerVar"TyreFrontRight" );
    
$TRR GetCurrentPlayerVar"TyreRearRight" );
    
    IF ((
$OTRR == "TYRE_KNOBBLY" ) || ($OTFR == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TFR == "TYRE_KNOBBLY" ))
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
openPrivButton"tyrespec",50,35,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,50,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );        
    ENDIF
EndEvent
?>


As you can see, I've only chosed 1 tyre for front and rear, and I've also added $TFR and $TRR - this is incase someone already on track with correct tyres comes into pits and changes to knobbly tyres - this bit not tested as I haven't had time.

Let me know how you get on.
Quote from sarxes :What you mean under FTW ? I have to change to this ?

I'm kidding with you xD & i dont know why im saying this
coz we useing Knobbly tyre for drifting in or server.
I know that he is not the place to speak at these things on this Thread

sorry for interrupting you

Peace
Quote from sinanju :I've been doing some testing, and it seems like code will only work if you change it to old tyres!

Try

<?php 
Event OnExitPitLane
(  $userName # Player event
    
$OTFR GetCurrentPlayerVar"OldTyreFrontRight" );
    
$OTRR GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR GetCurrentPlayerVar"TyreFrontRight" );
    
$TRR GetCurrentPlayerVar"TyreRearRight" );
    
    IF ((
$OTRR == "TYRE_KNOBBLY" ) || ($OTFR == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TFR == "TYRE_KNOBBLY" ))
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
openPrivButton"tyrespec",50,35,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,50,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );        
    ENDIF
EndEvent
?>


As you can see, I've only chosed 1 tyre for front and rear, and I've also added $TFR and $TRR - this is incase someone already on track with correct tyres comes into pits and changes to knobbly tyres - this bit not tested as I haven't had time.

Let me know how you get on.

Nothing happening ...
I've just reloaded that code again on my lapper version 6.013 and it's still working for me - see YouTube video HERE.

Note that it takes about 3 seconds after passing pit exit before you get spec'd.

This code should probably work in V5.825 and onwards according to lapper changes document.
Quote from sinanju :I've just reloaded that code again on my lapper version 6.013 and it's still working for me - see YouTube video HERE.

Note that it takes about 3 seconds after passing pit exit before you get spec'd.

This code should probably work in V5.825 and onwards according to lapper changes document.

ThX for the vid, but what about in autocross ? There is a pitlane ?
Try in a different Event, like;


<?php 
Event OnNewPlayerJoin
$userName )  # Player event
    
$OTFR GetCurrentPlayerVar"OldTyreFrontRight" );
    
$OTRR GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR GetCurrentPlayerVar"TyreFrontRight" );
    
$TRR GetCurrentPlayerVar"TyreRearRight" );
   
    IF ((
$OTRR == "TYRE_KNOBBLY" ) || ($OTFR == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TFR == "TYRE_KNOBBLY" ))
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
openPrivButton"tyrespec",50,35,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,50,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );        
    ENDIF
EndEvent
?>


Quote from sinanju :Try in a different Event, like;


<?php 
Event OnNewPlayerJoin
$userName )  # Player event
    
$OTFR GetCurrentPlayerVar"OldTyreFrontRight" );
    
$OTRR GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR GetCurrentPlayerVar"TyreFrontRight" );
    
$TRR GetCurrentPlayerVar"TyreRearRight" );
   
    IF ((
$OTRR == "TYRE_KNOBBLY" ) || ($OTFR == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TFR == "TYRE_KNOBBLY" ))
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
openPrivButton"tyrespec",50,35,100,15,5,8,32"You have been spectated for using ^1Knobbly ^8tyres");
        
openPrivButton"tyrechange",50,50,100,15,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres" );        
    ENDIF
EndEvent
?>



Sure that your code is working because you are a genius but i tried with another event like onsplit1 and for autocross its not working ... :S
Quote from sarxes :Sure that your code is working ... but i tried with another event like onsplit1 and for autocross its not working ... :S

But it will work for Event OnLap( $userName ).

Testing, the best I can see for you would be


<?php 
$distToDo 
10;
Event OnDistDone$userName # Player event
    
$OTFR GetCurrentPlayerVar"OldTyreFrontRight" );
    
$OTRR GetCurrentPlayerVar"OldTyreRearRight" );
    
$TFR GetCurrentPlayerVar"TyreFrontRight" );
    
$TRR GetCurrentPlayerVar"TyreRearRight" );
   
    IF ((
$OTRR == "TYRE_KNOBBLY" ) || ($OTFR == "TYRE_KNOBBLY" ) || ($TRR == "TYRE_KNOBBLY" ) || ($TFR == "TYRE_KNOBBLY" ))
    
THEN
        cmdLFS
"/spec " GetCurrentPlayerVar("UserName") );
        
openPrivButton"tyrespec",50,35,100,12,10,8,32"Sorry, but you have been spectated for using ^1Knobbly ^8tyres.%nl%Knobbly tyres are not allowed on this particular layout.");
        
openPrivButton"tyrechange",50,55,100,12,5,8,32"Please change to ^4Normal ^8or ^4Super ^8tyres%at%^4Please change to ^8Normal ^4or ^8Super ^4tyres" );        
    ENDIF
EndEvent
?>


Above code has set $distToDo to 10m, but you can change to suit.
Quote from sinanju :But it will work for Event OnLap( $userName ).

Testing, the best I can see for you would be


EndEvent[/PHP]Above code has set $distToDo to 10m, but you can change to suit.

Awesome ! why i havent this idea ... :P Thank you very much , now i can take a rest ! Cheers !
The code is working great but it has an error. The reason is that if I use knobly tyre and Im spectated for this after changing to normal tyres the lapper spectate me too for knobly tyres. But how ? Normal is not = with knobly tyres !
Quote from sarxes :The code is working great but it has an error. The reason is that if I use knobly tyre and Im spectated for this after changing to normal tyres the lapper spectate me too for knobly tyres. But how ? Normal is not = with knobly tyres !

Don't know why that happens, but I can confirm that it does!

Keeping your original coding, try adding the following additional code to your Event OnNewPlayerJoin( $userName ) # Player event section;

Quote :$OTFR = GetCurrentPlayerVar( "OldTyreFrontRight" ); SetCurrentPlayerVar("OldTyreFrontRight",$OTFR);
$OTRR = GetCurrentPlayerVar( "OldTyreRearRight" ); SetCurrentPlayerVar("OldTyreRearRight",$OTRR);
$TFR = GetCurrentPlayerVar( "TyreFrontRight" ); SetCurrentPlayerVar("TyreFrontRight",$TFR);
$TRR = GetCurrentPlayerVar( "TyreRearRight" ); SetCurrentPlayerVar("TyreRearRight",$TRR);

Basically, it's getting lapper to set in its memory what the tyres are at the start of a race or when leaving pits, but then after a certain distance (defined in your $distToDo), lapper looks what it has in its memory and acts accordingly.

Weird, as not sure why tyres should need to be set beforehand as you're only getting lapper to look up '(get') the information supplied by LFS.
This thread is closed

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