Greetings
I am trying to organize an open drifting competition.
At the beginning of the competition, I want to hold a drivers’ meeting where I briefly explain the competition format and the rules.
I assume I won’t get all interested drivers to join the Discord voice chat, so my solution is to write the drivers’ briefing directly into the game chat.
This can be automated with Lapper.
I will create a separate `Briefing.lpr` file in the folder:
C:\LFS\LFSLapper\bin\servers\includes
and then add the following line at the top of the file
C:\LFS\LFSLapper\bin\servers\DriftingServer.lpr
include("./includes/Briefing.lpr");
In the `Briefing.lpr` file, I want to create a command that only the server admin can run.
The command is "!brief", which starts the drivers’ meeting consisting of 25 lines of text.
PROBLEM
My code now crashes lapper, when includes line is active (include("./includes/Briefing.lpr")
.
When line in inactive (#include("./includes/Briefing.lpr")
lapper works fine.
I changed word chat -> rivi
QUESTION
1. What I did wrong?
2. How to fix it?
Here is my code in Briefing.lpr -file:
-----
# Driftin OPEN
# DriversBriefing
$distToDo = -1;
Event OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");
IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF
SWITCH( $command )
CASE "!brief":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
DelayedCommand( 5,rivi2 );
ELSE
privMsg("Only for admin!");
ENDIF
BREAK;
ENDSWITCH
EndEvent
Sub rivi1 ()
cmdLFS("/msg" );
DelayedCommand( 10,rivi2 );
EndSub
Sub rivi2 ()
globalmsg("^7We now start the DRIVERS BRIEFING.");
DelayedCommand( 10,rivi3 );
EndSub
Sub rivi3 ()
globalmsg("^7Keep the game chat empty for competition leader messages.");
DelayedCommand( 10,rivi4 );
EndSub
Sub rivi4 ()
globalmsg("^7Do not write anything to the game chat during the QUALIFY and TOP20 bracket.");
DelayedCommand( 10,rivi5 );
EndSub
Sub rivi5 ()
globalmsg("^7You can follow competition by opening www.sladimasters.com/scoreboard ");
DelayedCommand( 10,rivi6 );
EndSub
I am trying to organize an open drifting competition.
At the beginning of the competition, I want to hold a drivers’ meeting where I briefly explain the competition format and the rules.
I assume I won’t get all interested drivers to join the Discord voice chat, so my solution is to write the drivers’ briefing directly into the game chat.
This can be automated with Lapper.
I will create a separate `Briefing.lpr` file in the folder:
C:\LFS\LFSLapper\bin\servers\includes
and then add the following line at the top of the file
C:\LFS\LFSLapper\bin\servers\DriftingServer.lpr
include("./includes/Briefing.lpr");
In the `Briefing.lpr` file, I want to create a command that only the server admin can run.
The command is "!brief", which starts the drivers’ meeting consisting of 25 lines of text.
PROBLEM
My code now crashes lapper, when includes line is active (include("./includes/Briefing.lpr")

When line in inactive (#include("./includes/Briefing.lpr")

I changed word chat -> rivi
QUESTION
1. What I did wrong?
2. How to fix it?
Here is my code in Briefing.lpr -file:
-----
# Driftin OPEN
# DriversBriefing
$distToDo = -1;
Event OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");
IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF
SWITCH( $command )
CASE "!brief":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
DelayedCommand( 5,rivi2 );
ELSE
privMsg("Only for admin!");
ENDIF
BREAK;
ENDSWITCH
EndEvent
Sub rivi1 ()
cmdLFS("/msg" );
DelayedCommand( 10,rivi2 );
EndSub
Sub rivi2 ()
globalmsg("^7We now start the DRIVERS BRIEFING.");
DelayedCommand( 10,rivi3 );
EndSub
Sub rivi3 ()
globalmsg("^7Keep the game chat empty for competition leader messages.");
DelayedCommand( 10,rivi4 );
EndSub
Sub rivi4 ()
globalmsg("^7Do not write anything to the game chat during the QUALIFY and TOP20 bracket.");
DelayedCommand( 10,rivi5 );
EndSub
Sub rivi5 ()
globalmsg("^7You can follow competition by opening www.sladimasters.com/scoreboard ");
DelayedCommand( 10,rivi6 );
EndSub