The online racing simulator
Quote from lysergic :Hi, I'm sorry to ask again for your help, but I cannot make "autorestart" function working well.

My need is to have 30 minutes of qual, and then 30 or 60 minutes of races with autorestart 120 seconds after the end of each race.

But if I set autorestart = 120 every session (qual and race) restart every 120 seconds!!

Any help?

The problem is that Lapper sets the next race restart time when you have confimed results in either a race OR a qual ssession. It doesn't check whether the current session is a qual or race. Most race servers will only do race rotations, not quals.

if you have the source code, you could modify the file to restart only if its a race session.

Replace the line in managePacket.cs:

<?php 
...
        
void managePacket(InSim.Decoder.RES res// RESult (qualify or confirmed finish)
        
{
            if (
newCfg.varsLapper.AutoRestartRaceSec && ( currRace.autoRestartOn == false || newCfg.varsLapper.AutoRestartOnFirstFinished == false ))
?>

with:

<?php 
...
        
void managePacket(InSim.Decoder.RES res// RESult (qualify or confirmed finish)
        
{
            if (
newCfg.varsLapper.AutoRestartRaceSec && currRace.qualMins == && ( currRace.autoRestartOn == false || newCfg.varsLapper.AutoRestartOnFirstFinished == false ))
?>

That will only do a restart if the session has qualMins == 0, which indicates that its a race.
Hello i have a big problem

I have LFSLapper on my server.. he work great , But a command doesn;t work , command is !drf (name car) i write !drf XRG and nothing doing... please help me !



Thx
Quote from Krayy :The problem is that Lapper sets the next race restart time when you have confimed results in either a race OR a qual ssession. It doesn't check whether the current session is a qual or race. Most race servers will only do race rotations, not quals.

I think it needs to be recompliled. Anyway, now I know that I must disable qualification if I want autorestart.

I would like to take advantage of your availability: how can I set the default time for qualifying or races?
Example
from 21:00 to 23:00 qualifications enabled
from 23:00 to 00:00 only races
from 00:00 to 21:00 qualifications enabled

many thanks

Hello,

using registeraction

Gai-Luron
Quote from Gai-Luron :Hello,

using registeraction

Gai-Luron



Gai, You are my mith! Seriously, I have the same behaviour at work with my boring customers and their stupid questions.

But here I'm the stupid, boring customer. Registeraction? Uhm, may I call Steven Spielberg?

ready, register, ciak, action!

Quote from sinanju :
$MaxSessionLaps = 3;
Event OnMaxSessionLaps()
IF
$SessLaps==2
THEN
privMsg( "Max session laps reacheds - please pit or be spectated" );
IF
$SessLaps>2
THEN
cmdLFS( "/spec " . $Nickname );
ENDIF
ENDIF
EndEvent


It produces syntax error, brackets are wrong, but, maybe, not only brackets.

$MaxSessionLaps = 3;
Event OnMaxSessionLaps()
IF($SessLaps == 2)
THEN
privMsg( "Max session laps reacheds - please pit or be spectated" );
IF($SessLaps > 2)
THEN
cmdLFS( "/spec " . $Nickname );
ENDIF
ENDIF
EndEvent

try this
Need ";" after

$SessLaps==2

replace with

$SessLaps==2;
i have a lil problem

i got a error with this line:


openPrivTextButton( "penuser",81,72,59,6,5,-1,96,"^7Username","^7Click to fill in the Username",50,PenUser);

error message:

3/15/2010 5:49:03 AM -> Syntax error in cfg file "./includes/penalty.lpr" at line #27
Command 'openPrivTextButton' incorrect number of parameter
Function 'onmso./includes/penalty.lpr-1' script aborted


i dont see the bug
Maybe you're missing strFormat

openPrivTextButton( "penuser",81,72,59,6,5,-1,96,strFormat( "^7Username"),strFormat( "^7Click to fill in the Username"),50,PenUser);
it worked before when i change something on the script,
and it gaved me a error message with the same reason and yes it was missing 1 parameter( i have add the" -1 ")
after that i reboot lapper and did activate the command now it still says the same and i couldnt find the bug

i have made more scripts with this and it works.
so its a lilbit weird

EDIT: I fixed it
openPrivTextButton( "penuser",81,72,59,6,5,-1,96,"^7Username","^7Click to fill ......
i have removed the -1 because openPriveTextButton doesnt have a count function

script works ok now
thx for helping anyway
Quote from Bass-Driver :i have a lil problem

i got a error with this line:


openPrivTextButton( "penuser",81,72,59,6,5[COLOR=red],-1[/COLOR],96,"^7Username","^7Click to fill in the Username",50,PenUser);

error message:

3/15/2010 5:49:03 AM -> Syntax error in cfg file "./includes/penalty.lpr" at line #27
Command 'openPrivTextButton' incorrect number of parameter
Function 'onmso./includes/penalty.lpr-1' script aborted


i dont see the bug



openPrivTextButton( "penuser",81,72,59,6,5,96,"^7Username","^7Click to fill in the Username",50,PenUser);


openPrivTextButton( "button_ID",origL,origT,$wide_button,$hight_button,5,96,"text in chat window","Text in button",$max_lenght_of_input,Goto_this_Sub );

Sub Goto_this_Sub( $myVar )
privMsg( "$myVar = " . $myVar );
EndSub

Quote from Tim NL :

openPrivTextButton( "penuser",81,72,59,6,5,96,"^7Username","^7Click to fill in the Username",50,PenUser);


openPrivTextButton( "button_ID",origL,origT,$wide_button,$hight_button,5,96,"text in chat window","Text in button",$max_lenght_of_input,Goto_this_Sub );

Sub Goto_this_Sub( $myVar )
privMsg( "$myVar = " . $myVar );
EndSub


ur a lilbit to late
i fixed it already
Quote from Gai-Luron :Hello,

using registeraction

Gai-Luron

Hi Gai, sorry for bothering you with these issues. I assure you that I spent over 3 hours to try to configure the server so that every day from 22.00 to 24.00 only allows races 8 laps, then time expired, allowing more qualifications than 60 minutes.
I failed. Indeed ... I've done so much damage, that I had to delete the configuration file to replace it with a new
CatchEvent OnLapperStart ( )
RegisterScheduleAction( "0 0 22 * * * *", SA_race ); #Start race mode at 22pm every day
RegisterScheduleAction( "0 0 0 * * * *", SA_qual ); #Start qual mode at 24pm every day
# Start in in rigth mode
$tim = GetLapperVar( "ShortTime" );
writeLine( SubStr( $tim, 0,2 ) );
if( SubStr( $tim, 0,2 ) == "10" ) THEN
DelayedCommand( 10, SA_race );
ELSE
DelayedCommand( 10, SA_qual );
ENDIF
endCatchEvent

Sub SA_race()
cmdLFS("/qual=0");
cmdLFS("/laps=1");
cmdLFS("/restart");
EndSub
Sub SA_qual()
cmdLFS("/qual=60");
cmdLFS("/qualify");
EndSub

Thanks Gai, really a bit too difficult for me. I'll try as soon as possible = when server is empty

many thanks again
CatchEvent OnLapperStart ( )
RegisterScheduleAction( "0 0 22 * * * *", SA_race ); #Start race mode at 22pm every day
RegisterScheduleAction( "0 0 0 * * * *", SA_qual ); #Start qual mode at 24pm every day
# Start in in rigth mode
$tim = GetLapperVar( "ShortTime" );
if( SubStr( $tim, 0,2 ) == "10" && SubStr( $tim, 6,2 ) =="PM" ) THEN
DelayedCommand( 10, SA_race );
ELSE
DelayedCommand( 10, SA_qual );
ENDIF
endCatchEvent

Sub SA_race()
cmdLFS("/qual=0");
cmdLFS("/laps=1");
cmdLFS("/restart");
EndSub
Sub SA_qual()
cmdLFS("/qual=60");
cmdLFS("/qualify");
EndSub

Anybody got a "listenvent.lpr" file to share?
In 6.0 it's avaiable
Quote from Gai-Luron :In 6.0 it's avaiable

Thanks.

Maxsession laps update for version 6.0:

$MaxSessionLaps = 3;
Event OnMaxSessionLaps()
IF($SessLaps == 2;)
THEN
privMsg( langEngine( "%{max_laps}%" ) );
IF($SessLaps > 2;)
THEN
cmdLFS( "/spec " . $Nickname );
ENDIF
ENDIF
EndEvent

But... how to prevent racers sent to spectate mode to rejoin the qual session? They can rejoin, drive out of pits and stay on track.

Anybody knows a function like
/midrace=no

for qual session?
Hello,

Store session lap in player Var and test it when player rejoin the qual. But this dosen't prevent player to disconnect and reconnect.

Gai-Luron
Quote from Gai-Luron :Hello,

Store session lap in player Var and test it when player rejoin the qual. But this dosen't prevent player to disconnect and reconnect.

Gai-Luron

This is why I got you add the RaceId var:


<?php 
    $RaceID 
getLapperVar"RaceId" );
    
SetStoredValue"RaceID"$RaceID);
....
CatchEvent OnNewPlayerJoin$userName )  # Player event
    
$PlayerRaceID GetUserStoredValue "PlayerRaceID");
    IF ( 
$PlayerRaceID == $RaceID )
    
THEN
        
# Rejoining from a previous session
    
ELSE
       
# Firstt ime in this session
       
SetUserStoredValue "PlayerRaceID"$RaceID);
    ENDIF
?>

Cannot make Maxsession laps event work...

My CODE (modified, again...)

$MaxSessionLaps = 2;
Event OnMaxSessionLaps( $userName ); #this is line 1001
IF($SessLaps == 1;)
THEN
privMsg( langEngine( "%{max_laps}%" ,$MaxSessionLaps ) );
privMsg( langEngine( "%{max_laps2}%" , GetCurrentPlayerVar("$MaxSessLaps") ) );
IF($SessLaps > 1;)
THEN
globalMsg( langEngine( "%{max_laps2}%", GetCurrentPlayerVar("NickName") ) );
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
ENDIF
ENDIF
EndEvent

ERROR:
3/23/2010 10:29:53 AM -> Syntax error in cfg file "LFSLapper.lpr" at line #1001 Token not catched Function 'onmaxsessionlaps' script aborted

If I remove $userName from line 1001 it gets error: something similar to: "number of parameters..."

This works:
$MaxSessionLaps = 1;
Event OnMaxSessionLaps( $userName ) # Player event
privMsg( langEngine( "%{max_laps2}%",$MaxSessionLaps ) );
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
EndEvent

You have semi colons after the declaraion of the Event, and after the IF conditional tests:


<?php 
$MaxSessionLaps 
2;
Event OnMaxSessionLaps$userName ); #this is line 1001
IF($SessLaps == 1;)
?>

Should be:

<?php 
$MaxSessionLaps 
2;
Event OnMaxSessionLaps$userName #this is line 1001
IF($SessLaps == 1)
?>

The IF is repeated further down
im working on my new update system and i cant get it to work
LFSLapper

<?php 
$status 
http("http://t3charmy.net/LFSLapper-Cruise/update.php?ver=".$CruiseVer);
dumpvar($status);
SWITCH(
$status)
                            CASE 
"0":
  
openPrivButton"Cruise_Wel_1",56,40,66,5,12,-1,32,"^6" getLapperVar"HostName" ) . "      (" GetLapperVar("ShortTrackName") . ")" );
    
openPrivButton"Cruise_Wel_2",122,40,15,5,12,5,32,"^1Close ^7(%cpt%)"Cruise_Wel_Close );
    
openPrivButton"Cruise_Wel_3",56,45,81,5,12,-1,32,"^7Insim By: ^0[^4S^0C] ^7T3charmy" );
    
openPrivButton"Cruise_Wel_4",56,50,81,5,5,-1,32,langEngine"%{Cruise_Wel_Main}%" getLapperVar"HostName" ) ) );
    
openPrivButton"Cruise_HUD_BG",1,135,22,38,12,-1,32," " );    
                            BREAK;
                            
                            CASE 
"1":
                           DEFAULT:
            IF ( 
UserIsAdmin$userName ) == )
            
THEN                
      PrivMsg
("^7Please Update Cruise Insim To The Latest Version");
      ENDIF
                            BREAK;                            
ENDSWITCH
?>

Site

<?php 
php
switch( $_GET['ver'] )
{
case 
1.95:
case 
1.96:
case 
1.98:
case 
"2.00B":
case 
2.01:
Print(
"return (0);");
break;

default:
Print(
"return (1);");
break;
}


?>

any ideas?

it auto goes to the default ... when it dumps the value it returns a 0 :/
This thread is closed

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