Event
EndEvent
CatchEvent
EndCatchEvent
CatchEvent 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
EndCatchEvent
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
-----------------------------------------------------------------------------
7/4/2025 6:57:27 PM -> Error: Unclosed string on file: ".\default\.\includes\.\RallySystem\Scripts\Test\Convert.LPR" at line #6
-----------------------------------------------------------------------------
7/4/2025 6:57:29 PM
Lapper Instance 188.122.74.156/55264 abort!
Object reference not set to an instance of an object.
LFSLapper
at LFSLapper.LFSClient.managePacket(NCN newConnection)
at LFSLapper.LFSClient.Loop(Connect insimConnection)
at LFSLapper.LFSClient.doloop()
at LapperInstances.LapperInstance.doConnection()
Void managePacket(NCN)
Closing Instance...
# X , Y , Z, Flag (do not change), Heading of vehicle
$SpawnLocation[1,KY2R] = "390.24,-463.08,11.89,128,140";
$SpawnLocation[1,BL1X] = "100.30,-410.18,11.89,128,140";
etc....
$CurrTrack = GetLapperVar("ShortTrackName");
$SplittedValues = SplitToArray($SpawnLocation[$locIndex,$CurrTrack],",");
list of variables:
status,id,name,descriptionshort,description,userid,username,wip
publishedat,numdownloads,currusage,rating,numratings,staffpick
tweakmod,version,lastdownloadedat,class,ev
icecc,icenumcylinders,icelayout,evredLine,drive,shifttype
power,maxpowerrpm,mass,bhp,powerweightratio,bhpton,fueltanksize
public enum Class
{
Object, //0: Object
Touring_Car, //1: Touring car
Saloon_Car, //2: Saloon car
Buggy, //3: Buggy
Formula, //4: Formula
GT, //5: GT
Kart, //6: Kart
Bike, //7: Bike
Van, //8: Van
Truck, //9: Truck
Formula_1, //10: Formula 1
Formula_SAE //11: Formula SAE
};
public enum iceLayout
{
Inline, //0: inline
Flat, //1: flat
V //2: V Shape
};
public enum drivetrains
{
None, //0: None
Rear_Wheel_Drive_RWD, //1: Rear-Wheel Drive
Front_Wheel_Drive_FWD, //2: Front-Wheel Drive
All_Wheel_Drive_AWD, //3: All-Wheel Drive
Four_Wheel_Drive_4WD //4: Four Wheel Drive
};
public enum shiftType
{
None, //0: None
H_Pattern, //1: H-pattern gearbox
Motorbike, //2: Motorbike
Sequential, //3: Sequential
Sequential_with_ignition_cut, //4: Sequential with ignition cut
Paddle, //5: Paddle
Electric_Motor, //6: Electric motor
Centrifugal_Clutch //7: Centrifugal clutch
};
<?php
##IF the player does not meet the required vehicleclass.
IF(($modinfo["class"] != "GT" ) && ($modinfo["class"] != "Saloon_Car") && ($modinfo["class"] != "Touring_Car"))
THEN
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
openPrivButton( "classspec",50,35,100,15,5,15,32, "^7You have been moved to spectators because your ^1car ^7does not meet the server ^1requirements.");
openPrivButton( "classchange",50,50,100,15,5,15,32, "^7Allowed vehicles ^7on the server are ^3Saloon, Touring Car, or GT" );
ENDIF
?>
List of correct names of vehicleclasses
Object, //0: Object
Touring_Car, //1: Touring car
Saloon_Car, //2: Saloon car
Buggy, //3: Buggy
Formula, //4: Formula
GT, //5: GT
Kart, //6: Kart
Bike, //7: Bike
Van, //8: Van
Truck, //9: Truck
Formula_1, //10: Formula 1
Formula_SAE //11: Formula SAE
$modinfo = getmoddedcarinfo($userName);
privmsg("".$modinfo["class"]);
openPrivButton( "pos",25,80,150,10,8,-1,ISB_NONE, langEngine("%{main_welc2}%",$Posabs,$Posqual,$Groupqual ) );
openPrivButton( "pos",25,80,150,10,8,-1,ISB_NONE, langEngine("%{main_welc2}%"));
Event OnConnect( $userName ) # Player event
$NickName = GetCurrentPlayerVar("NickName");
$Posabs = GetCurrentPlayerVar("PosAbs");
$Groupqual = GetCurrentPlayerVar("GroupQual");
openPrivButton( "welc",25,50,150,15,12,-1,ISB_NONE, langEngine("%{main_welc1}%", $NickName ) );
openPrivButton( "pos",25,80,150,10,8,-1,ISB_NONE, langEngine("%{main_welc2}%"));
openPrivButton( "clos",78,120,20,10,10,-1,ISB_DARK, langEngine("%{main_accept}%"),OnConnectClose );
openPrivButton( "ref",103,120,20,10,10,-1,ISB_DARK, langEngine("%{main_deny}%"),OnConnectCloseKick );
$RaceTime = GetLapperVar("racetime");
EndEvent
CatchEvent OnLapperStart()
GlobalVar $SpawnLocation;
# X , Y , Z, Flag(do not change), Heading of vehicle
$SpawnLocation[1] = "286.25,-984.5,11.89,128,55";
$SpawnLocation[2] = "126.56,-1087.62,14.62,128,-101";
$SpawnLocation[3] = "283.81,-988.25,11.92,128,55";
$SpawnLocation[4] = "190.56,-80.74,7.64,128,20";
$SpawnLocation[5] = "-284.5,-295.81,21.77,128,-101";
EndCatchEvent
CatchEvent 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 "!teleport":
OpenTeleportWindow($userName);
BREAK;
ENDSWITCH
EndCatchEvent
Sub OpenTeleportWindow($userName)
#Background
OpenPrivButton("Teleportwindow_bgd",70,65,60,32,5,-1,32, "");
#Buttons of locations.
OpenPrivButton("Teleportwindow_Loc_1",71,66,58,6,5,-1,16, "^0Location 1",TeleportPlayer);
OpenPrivButton("Teleportwindow_Loc_2",71,72,58,6,5,-1,16, "^0Location 2",TeleportPlayer);
OpenPrivButton("Teleportwindow_Loc_3",71,78,58,6,5,-1,16, "^0Location 3",TeleportPlayer);
OpenPrivButton("Teleportwindow_Loc_4",71,84,58,6,5,-1,16, "^0Location 4",TeleportPlayer);
OpenPrivButton("Teleportwindow_Loc_5",71,90,58,6,5,-1,16, "^0Location 5",TeleportPlayer);
EndSub
Sub TeleportPlayer($keyflags,$id)
$userName = Getcurrentplayervar("UserName");
#trim the first 19 characters of the buttonID
$SelectedLocation = trim( subStr( $id,19 ));
$SplittedValues = SplitToArray($SpawnLocation[ToNum($SelectedLocation)],",");
#Give values of the array a readable name.
$X = $SplittedValues[0];
$Y = $SplittedValues[1];
$Z = $SplittedValues[2];
$Flag = $SplittedValues[3];
$Heading = $SplittedValues[4];
#JRR Spawn request.
joinrequest(ToNum($X),ToNum($Y),ToNum($Z),ToNum($Flag),ToNum($Heading),GetPlayerVar($userName,"UCID"),GetPlayerVar($userName,"PLID"),4); #Spawn Player to the selected location with vehiclereset
EndSub
Sub TrafficLoop()
Sub Red_Yellow_light()
startlightcontrol(5,149,1,1); #LightID = 1
delayedcommand("GoToYellowLight",5,Yellow_Green_light); #duration 5 seconds
EndSub
Sub Yellow_Green_light()
startlightcontrol(5,149,1,2); #LightID = 1
delayedcommand("GoToGreenLight",2,Green_Yellow_Light); #duration 2 seconds
EndSub
Sub Green_Yellow_Light()
startlightcontrol(5,149,1,8); #LightID = 1
delayedcommand("GoToYellowLight",6,Yellow_Red_Light); #duration 6 seconds
EndSub
Sub Yellow_Red_Light()
startlightcontrol(5,149,1,2); #LightID = 1
delayedcommand("GoToRedLight",2,Red_Yellow_light); #duration 2 seconds
EndSub
Name: VM_TA_5S_2k25
Environment: Westhill
Config: WE1X
Stages: 5 (Stage 4 and 5 are accessible via the boxes or !s4/!s5)
Difficulty: Easy/Medium
Vehicles: All (Caution on stage 5 with larger vehicles)
Globalvar $CarNames;
$CarNames["DF234F"] = "Full CarName 01";
$CarNames["BD8E56"] = "Full CarName 02";