If you want to do Drivers Briefing file here is how I did it.
First i made the file Briefing.lpr in the folder location:
C:\LFS\LFSLapper\bin\servers\includes\
Then i added line:
include( "./Briefing.lpr");
Line was added to file:
C:\LFS\LFSLapper\bin\servers\includes\addonsused.lpr
Then I made sure that my Server_OPEN.lpr in the folder location:
C:\LFS\LFSLapper\bin\servers\
had line
include( "./includes/addonsused.lpr");
After that
I wrote code and tested it.
I found out that, if you want to have multiple commands for different text flods, you have to write them in same file as I have done here.
Next I am going to explore the "SWITCH( $command )" if it would make possible to make individual "files with execute commands".
Here is my code
----------
# DriversBriefing
# THIS IS THE DRIVERSBRIEFING text
Sub line1 ()
cmdLFS("/msg" ); #This maybe clears all other written text before it
DelayedCommand( 1,line2 );
EndSub
Sub line2 ()
globalmsg("^7Welcome to OPEN Drift Event 1 ");
DelayedCommand( 4,line3 );
EndSub
Sub line3 ()
globalmsg("^7We now start the DRIVERS BRIEFING.");
DelayedCommand( 4,line4 );
EndSub
Sub line4 ()
globalmsg("^7Keep the game chat empty for competition leader messages.");
DelayedCommand( 4,line5 );
EndSub
Sub line5 ()
globalmsg("^7Do not write anything to the game chat during the QUALIFY.");
DelayedCommand( 4,line6 );
Sub line6 ()
globalmsg("^7Thank you!");
EndSub
# THIS CLOSES DRIVERSBRIEFING text flod
Sub CloseBriefMsg( $KeyFlags,$id )
closeGlobalButton("Brief_msg");
EndSub
# THIS IS THE COMMAND FOR START DRIVERSBRIEFING text flod
CatchEvent OnMSO( $userName, $text )
$ucaseText = ToLower($text);
IF( $ucaseText == "!brief" ) THEN
IF( UserIsAdmin($userName) == 1 ) THEN
DelayedCommand( 1, line1 ); # delay in secends, here 1, whats happens next
privMsg($userName, "^2Drivers Briefing starts ...");
ELSE
privMsg("Only for admin!");
ENDIF
ENDIF
IF( $ucaseText == "!huuto" ) THEN
IF( UserIsAdmin($userName) == 1 ) THEN
DelayedCommand( 1, huuto_line1 ); # delay in secends, here 1, whats happens next
privMsg($userName, "^2Sign up name call starts ...");
ELSE
privMsg("Only for admin!");
ENDIF
ENDIF
EndCatchEvent
# THIS IS THE SIGN UP NAME CALL text
##########NIMENHUUTO##########
Sub huuto_line1 ()
globalmsg("^4SIGN UP NAME CALL");
DelayedCommand( 4,huuto_line2 );
EndSub
Sub huuto_line2 ()
globalmsg("^7We now start the SIGN UP NAME CALL FOR THE EVENT.");
DelayedCommand( 4,huuto_line3 );
Sub huuto_line3 ()
globalmsg("^7ALL DRIVERS who want to PARTICIPATE in the competition TODAY,");
DelayedCommand( 4,huuto_line4 );
EndSub
Sub huuto_line4 ()
globalmsg("^7TYPE hi in the game chat now.");
EndSub
# THIS CLOSES text flod
Sub CloseHuutoMsg( $KeyFlags,$id )
closeGlobalButton("huuto_msg");
EndSub
I changed rivi -> line for better describtion what it is and also changed that command to send to sub "line1" (previous was to sub line2).
I think I have made the error in the "CatchEvent OnMSO" - part of the script.
I just need simple button, when pressed checks am I admin of server and then runs the text.
I think this catchevent does not suit for this purpose.
I copied it from an another part from my lapper code, where it is used to reload lapper (when changes are made).
First i did correct obvious, Event -> CatchEvent & EndEvent -> EndCatchEvent, Problem.
Then opened the error log, and found out that i had left there a mark for my self wich caused the crashing.
I re moved the error and then added briefing.lpr to addons.lpr
After these modifications, lapper and its other functions are working.
But can get my command to make to text flow.
Here is the code now
-----
# Drift OPEN
# DriversBriefing
$distToDo = -1; # <-- I don't know is this necessary
CASE "!kokous":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
DelayedCommand( 5,line1 );
ELSE
privMsg("Only for admin!");
ENDIF
BREAK;
ENDSWITCH
EndCatchEvent
Sub line1 ()
cmdLFS("/msg" );
DelayedCommand( 10,line2 );
EndSub
Sub line2 ()
globalmsg("^7We now start the DRIVERS BRIEFING.");
DelayedCommand( 10,line3 );
EndSub
Sub line3 ()
globalmsg("^7Keep the game line empty for competition leader messages.");
DelayedCommand( 10,line4 );
EndSub
Sub line4 ()
globalmsg("^7Do not write anything to the game line during the QUALIFY and TOP20 bracket.");
DelayedCommand( 10,line5 );
EndSub
Sub line5 ()
globalmsg("^7You can follow competition by opening www.website.ne/scoreboard ");
DelayedCommand( 10,line6 );
EndSub
Sub line6 ()
globalmsg("^7Stay on server as long as you are still competing.");
DelayedCommand( 10,line7 );
EndSub
Sub line7 ()
globalmsg("^7Add your competition number front of your name => #666 E.Xample ");
DelayedCommand( 10,line8 );
EndSub
Sub line8 ()
globalmsg("^7Only drivers with competition number get to the qualifying list.");
DelayedCommand( 10,line9 );
EndSub
Sub line9 ()
globalmsg("^7You are free to choose any competition number between 1-999.");
DelayedCommand( 10,line10 );
EndSub
Sub line10 ()
globalmsg("^7Competition Leader will call you by name when it is your turn.");
DelayedCommand( 10,line11 );
EndSub
Sub line11 ()
globalmsg("^7NAME CAll FOR THE EVENT");
DelayedCommand( 10,line12 );
EndSub
Sub line12 ()
globalmsg("^7ALL DRIVERS who want to PARTICIPATE in the competition TODAY");
DelayedCommand( 10,line13 );
EndSub
Sub line13 ()
globalmsg("^7TYPE hi in the game chat now.");
EndSub
Sub OnConnectClose( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
LoginNonMember(GetCurrentPlayerVar( "UserName" ));
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") 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
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
Is it possible to map a clutch indicator light or a throttle indicator light in the same way as an additional brake light?
In some drifting series, indicator lights are mounted on the car’s roof to inform other competitors when the driver ahead is pressing the clutch, brake, or throttle pedal.
These kinds of indicator lights would also make judging easier.
At least for the player, pedal bars can be displayed via **\[Options] → \[Display] → \[Show Pedals]**:
* Grey = Handbrake
* Purple = Clutch
* Red = Brake
* Green = Throttle
I wasn’t sure which section this question belongs in. The moderators may delete it or move it to the correct place.
#############################################################################
# You are free to choose any car on the server, as long as it meets the following requirements:
# - Vehicle class: saloon, touring car or GT
# - Drivetrain: Rear Wheel Drive [RWD], All_Wheel_Drive [AWD] or Four_wheel_drive [4WD]
# - TYRES
# * Super
# * Normal
#############################################################################
## List of correct names of Tyre types
## Slick_R1, //0: R1
## Slick_R2, //1: R2
## Slick_R3, //2: R3
## Slick_R4, //3: R4
## Road_super, //4: Super
## Road_normal, //5: Normal
## Hybrid, //6: Hybrid
## Knobbly, //7: Knobbly
#############################################################################
## 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
#############################################################################
## List of correct names of 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
## Allowed tyres on server
$OTFR = GetCurrentPlayerVar( "OldTyreFrontRight" ); # Vanha Rengas etu oikea
$OTRR = GetCurrentPlayerVar( "OldTyreRearRight" ); # Vanha Rengas taka oikea
$TFR = GetCurrentPlayerVar( "TyreFrontRight" ); # Rengas etu oikea
$TRR = GetCurrentPlayerVar( "TyreRearRight" ); # Rengas taka oikea
$FWAdj = GetCurrentPlayerVar( "FrontWheelsAdj" ); # Etu rengas säätö?
$RWAdj = GetCurrentPlayerVar( "RearWheelsAdj" ); # Taka rengas säätö?
IF (($OTRR != "TYRE_ROAD_SUPER" ) && ($OTFR != "TYRE_ROAD_SUPER" ) && ($TRR != "TYRE_ROAD_SUPER" ) && ($TFR != "TYRE_ROAD_SUPER" ) && ($OTRR != "TYRE_ROAD_NORMAL" ) && ($OTFR != "TYRE_ROAD_NORMAL" ) && ($TRR != "TYRE_ROAD_NORMAL" ) && ($TFR != "TYRE_ROAD_NORMAL" ))
THEN
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
openPrivButton( "tyrechange",50,50,100,15,5,15,32, "^7Please change your tyres to ^3Hybrid ^7, ^3Normal ^7or ^3Super" );
# ELSE
# privmsg("Allowed tyres on server are Hybrid, Normal or Super. Tyres are correct");
ENDIF
## Allowed vehicle class on server
$modinfo = GetModInfo($userName);
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" );
# ELSE
# privmsg("Allowed vehicle classes on server are GT, Saloon and Touring. Vehicle class is correct");
ENDIF
## Allowed drivetrain on server
IF(($modinfo["drive"] != "Rear_Wheel_Drive_RWD" ) && ($modinfo["drive"] != "All_Wheel_Drive_AWD") && ($modinfo["drive"] != "Four_Wheel_Drive_4WD"))
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 drivetrains ^7on the server are ^3RWD or AWD" );
ELSE
# privmsg("Allowed drivetrains on server are RWD or AWD. Vehicle drivetrain is correct");
# ENDIF
EndEvent
Previosly lapper was complaining about these lines also but I deleted them to see is that the reason it stops working.
$StoredValueDbs = "Databases/storedvalue"; # Name of the database in which additional values are stored.
$StoreOfflineData = 0; #storedvalue.dbs Store Offline data , even when the player doesnt exist in the database.
**"Here's the error:"**
-----------------------------------------------------------------------------
7/4/2025 10:15:00 PM
$AdminFile = "./admin.txt"; # Name of the file containing admin lfsname player
$TrackInfoFile = "trackInfo.cfg"; # Path to the TrackInfoFile used to compare splits
$TCPmode = true; # Connection to LFS in UDP mode or TCP mode
$EnableRegisterWeb = false; # When set to "true" your LFS Server is displayed on the FRH Team website
$LongTimeFormat = "HH:mm:ss tt";
$ShortTimeFormat = "HH:mm";
$DateFormat = "dd/MM/yyyy";
$LongDateFormat = "dddd dd MMMM yyyy";
$MessageTime = 5000; # Time in milliseconds for a racecontrol message (started by: rcm_all) to be displayed on screen
$ShowPlayerControl = False; # Set option to "true" if you want to show the control configuration of players when leaving the pits.
$LayoutFolder = ""; #LFSLapper must be on the same machine as the LFS Server.
###############
#Debug Setting#
###############
#When setting one of these options below, it will displayed the executed subs/events/Loops etc in your Lapper console.
$DisplaySubs = -1; #Player created subs
$DisplayLoops = -1; #DelayedCommand functions,
$DisplayEvents = -1; #(Catch)Events
$DisplayGetPlayerVar = -1; #Display GetPlayerVars
$DisplaySetPlayerVar = -1; #Display SetPlayerVars
$DisplayLapperVar = -1; #Display LapperVars
$DisplayLapperFunction = -1; #Display LapperFunctions
$DisableAI = -1;
#################
#Control Allowed#
#################
$AuthAllowPlayer = "All";
$AuthMinPlayer = 0; # Minimum number of players on the server to auto enable authorization
$AutoGears = "N";
$HelpBrake = "N";
$KbNoHelp = "N";
$KbStabilised = "N";
$CustomView = "N";
Lang "EN"
example = "This text is an exampletext";
main_welc1 = "^7Welcome to ^1Sladi ^7Masters OPEN server";
main_welc2 = "^7Make your player name as example: ^7#000 F.Surename 'WHITE COLOR'";
main_accept = "^2Accept";
main_rules = "^2Rules";
main_speedtrap = "SpeedTrap = {0} {1}";
main_gotlevel = "^3You have got level: {0}";
main_swear11 = "^1Don't use this words on this server";
main_swear12 = "You will be spectated in ^2{0} ^1 more attempt(s)";
main_swear21 = "Too many swearwords, spectated";
main_nomatchflag = "Flags not match required flags";
main_yourflag = "Yours flags -> {0}";
main_requiredflag = "Required flags -> {0}" ;
main_spectated = "Spectated";
main_notadmin = "You are not an Admin!";
main_currnode = "The Current Node is : {0}";
main_currzone = "The Current Zone is : {0}";
main_lapclose = "Lapper Closed By Administrator!";
main_ban = "{0} Ban {1}";
main_kick = "{0} kick {1}";
main_friendpos = "Your friendly position is {0}";
main_groupqual = "Your groupqual is {0}";
main_level = "^3You have level(s): {0}";
main_dist = "Distance done on {0}/{1} = {2} {3}, session = {4} {5}";
main_lapdone = "Laps done on {0}/{1} = {2}, session = {3}";
main_timeinpit = "Time in pitting {0}";
main_trackused = "Track in use : {0} = {1}";
main_serverclock = "Server time clock reference : {0}";
main_midnight = "Midnight warning to all working men!";
main_newyear = "Happy New Year!";
main_allowed = "{0}^3 allowed on this server";
main_notallowed = "{0}^3 not allowed on this server";
main_tolowhand1 = "{0}^3 spectated for too low handicap";
main_tolowhand2 = "^3need {0}kg and {1}% of intake restriction!";
main_vote_restart1 = "Restart:";
main_vote_restart2 = "({0}/{1}) Need {2}";
main_vote_qualify1 = "Qualify";
main_vote_qualify2 = "({0}/{1}) Need {2}";
main_vote_end1 = "End:";
main_vote_end2 = "({0}/{1}) Need {2}";
main_car_changed = "Car changed, go to pit! Current car = {0}";
main_track_changed1 = "Track changed, please wait!";
main_track_changed2 = "Current Track = {0}";
main_left_server = "{0} ^7left the server";
main_great1 = "Great 1st split ({0}) by {1}^8!";
main_good1 = "Good 1st split ({0}) by {1}^8!";
main_great2 = "Great 2nd split ({0}) by {1}^8!";
main_good2 = "Good 2nd split ({0}) by {1}^8!";
main_great3 = "Great 3rd split ({0}) by {1}^8!";
main_good3 = "Good 3rd split ({0}) by {1}^8!";
main_greatlap = "Great lap ({0}) by {1}^8!";
main_goodlap = "Good lap ({0}) by {1}^8!";
main_flood = "{0}^3 kicked for flooding";
main_on_result = "Finished Pos = {0}";
main_lost_control = "^1Danger! ^8{0} ^2lost control!";
main_toslow1 = "you are too slow! Max : {0}";
main_toslow2 = "kick on {0}";
main_toslowvery1 = "You are very slow, spectated!";
main_toslowvery2 = "{0} is too slow, spectated!";
main_idle1 = "^3You are idle and will be spectated in 10 seconds" ;
main_idle2 = "^3You are spectated for non-activity";
main_onnewpb = "New PB by {0}^8 ({1}): {2}";
main_onnewpb_rank = "Friendly rank : {0}";
main_onnewpb_sesslaps = "Session laps done = {0}";
main_onnewpb_servlaps = "Total laps done (server) = {0}";
main_onnewpb_avgspeed = "Average speed: {0}{1}";
main_onnewpb_rank2 = "Friendly {0} rank: ^7{1}";
main_onnewpbqual = "League - New QT by {0}^8:{1}";
main_onnewpbqual_rank = "Friendly rank (all visitors): ^7{0}";
main_onnewpbqual_pos = "^2Qualify pos.: {0}";
main_onnewpbqual_pool = "^6Actual Pool: {0}";
main_onnewpbqual_avgspeed = "Average speed: {0}{1}";
main_onnewpbqual_posqual = "{0} ^2Pos:{1} - Pool:{2}";
main_accel = "^8Accelerated in ^3{0}^8 seconds to {1} {2}!";
main_notpitwindow = "{0} ^1You are not on pit Windows, allowed in {1}-{2}";
main_inpitwindows = "{0} ^1You are allowed to pit";
main_outpitwindows = "{0} ^1You are not allowed to pit";
main_beginpit = "{0}^8 makes a pit stop";
main_pitwork = "Pit begin! Work:{0}";
main_fastdrivepitl1_1 = "{0}^1 Warning for fast driving in pit";
main_fastdrivepitl1_2 = "^1WARNING-KICK POSSIBLE";
main_fastdrivepitl2_1 = "{0}^1 Spectated for fast driving in pit";
main_fastdrivepitl2_2 = "^1WARNING: YOU WILL BE KICKED IF YOU SPEED IN PITS {0} MORE TIME";
main_maxfastdrivepit1 = "{0}^1 kicked for fast driving in pit";
main_maxfastdrivepit2 = "^1YOU HAVE BEEN KICKED FOR SPEEDING IN PITS TOO MANY TIMES";
main_maxreset = "{0} spectated for exceeding max car resets";
main_oncarreset = "Car Reset by {0} on lap {1}";
main_specwarn = "^1Spectate Warning";
main_resetrest = "^2You have^3 {0} ^2car resets left";
main_close = "Close";
main_psdistance = "^7Distance: ^2{0} ^7{1}";
main_psfuel = "^7Fuel used: ^2{0} ^7liters ";
main_pslaps = "^7Laps done: ^2{0}";
main_pswins = "^7Wins: ^2{0}";
main_pssecond = "^7Second: ^2{0}";
main_psthird = "^7Third: ^2{0}";
main_psfinished = "^7Race finished: ^2{0}";
main_psquals = "^7Qualifications done: ^2{0}";
main_pspole = "^7Poles done: ^2{0}";
OnNewDriftPB = "{0}^3 made new PB: ^7{1} ^3pts!";
OnGoodDrift = "{0} ^3made excellent drift: ^7{1} ^3pts";
built_pos = "Pos";
built_grp = "Grp";
built_car = "Car";
built_track = "Track";
built_nick = "NickName";
built_pb = "Pb";
built_split = "Split";
built_splits = "Splits";
built_points = "Points";
built_nolfspb = "LFS World PB not yet retreived";
built_nolfspbcrit = "No LFS World PB for this criteria";
built_lapsdone = " Laps Done";
built_hand_nick = "^3{0}^9 handicap:";
built_hand_curr = " - Current {0}Kg - Intake Restr.: {1}%";
built_hand_req = " - Required {0}^9 {1}Kg - Intake Rest.: {2}%";
EndLang
/*
To create colored text, use the following codes in front of the text you want to color:
^0 - black
^1 - red
^2 - green
^3 - yellow
^4 - blue
^5 - violet
^6 - cyan
^7 - white
^8 - no color
Other variables that could be used on expressions
&& -> and
|| -> or
+ -> plus
- -> minus
/ -> devide
* -> multiply
^ -> pow
== -> equal to
!= -> not equal to
> -> bigger then
< -> smaller then
<= -> smaller then and equal to
>= -> bigger then and equal to
*/
Question1:
What are correct settings LFSLAPPER for API Access Management: Register a new Application?
Do i need URI or checkbox?
Information:
Since LFSLapper version V7.0.9.0 it have been available to register your application.
You register your LFSLapper application at https://www.lfs.net/account/api
Prompt application name and display name. (Picture1 included)
Registering your LFSLapper gives you access on mod car data.
(Correct me Bass-Driver, if i am wrong)
Greetings.
I am using LFS 0.7F and LFSLapper V7.0.9.6
I got this lapper code as an heritance from friend of mine whom has been developing drifting ai.
I went and registered my lapper to get modinfo command working, (https://www.lfs.net/account/api).
I did not figured how to get lapper to go pack in folder tree.
Location of secret key file: C:\LFS\LFSLapper\bin\default\includes\myInc.lpr
Location of my lapper file: C:\LFS\LFSLapper\bin\servut\OPEN_drifting_server.lpr
So i just added these lines on start of my lapper.
$RestAPIClientID = "GoGetYourOwn";
$RestAPIClientSecret = "L9VeryLongGiprishMyCode8x";
Old lapper code mostly works (tyre stuff), but i do not get modinfo"class" and drivetrain -querys move player to spectator when driving FWD VAN.
Here is the code
----
#############################################################################
# You are free to choose any car on the server, as long as it meets the following requirements:#
# - Vehicle class: saloon, touring car or GT #
# - Drivetrain: Rear Wheel Drive [RWD], All_Wheel_Drive [AWD] or Four_wheel_drive [4WD]
# - TYRES #
# * Super #
# * Normal #
# * Hybrid #
#############################################################################
## Allowed tyres on the server
## Tyre types: Super or Normal or Hybrid
## List of Tyre types
## Slick_R1, //0: R1
## Slick_R2, //1: R2
## Slick_R3, //2: R3
## Slick_R4, //3: R4
## Road_super, //4: Super
## Road_normal, //5: Normal
## Hybrid, //6: Hybrid
## Knobbly, //7: Knobbly
Event OnNewPlayerJoin( $userName )
$OTFR = GetCurrentPlayerVar( "OldTyreFrontRight" ); # Vanha Rengas etu oikea
$OTRR = GetCurrentPlayerVar( "OldTyreRearRight" ); # Vanha Rengas taka oikea
$TFR = GetCurrentPlayerVar( "TyreFrontRight" ); # Rengas etu oikea
$TRR = GetCurrentPlayerVar( "TyreRearRight" ); # Rengas taka oikea
$FWAdj = GetCurrentPlayerVar( "FrontWheelsAdj" ); # Etu rengas säätö?
$RWAdj = GetCurrentPlayerVar( "RearWheelsAdj" ); # Taka rengas säätö?
IF (($OTRR != "TYRE_ROAD_SUPER" ) && ($OTFR != "TYRE_ROAD_SUPER" ) && ($TRR != "TYRE_ROAD_SUPER" ) && ($TFR != "TYRE_ROAD_SUPER" ) && ($OTRR != "TYRE_ROAD_NORMAL" ) && ($OTFR != "TYRE_ROAD_NORMAL" ) && ($TRR != "TYRE_ROAD_NORMAL" ) && ($TFR != "TYRE_ROAD_NORMAL" ))
THEN
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
openPrivButton( "tyrespec",50,35,100,15,5,15,32, "^7You have been moved to spectators because your ^1disallowed ^7tyres");
openPrivButton( "tyrechange",50,50,100,15,5,15,32, "^7Please change your tyres to ^3Normal ^7or ^3Super" );
# openPrivButton( "tyrechange",50,50,100,15,5,15,32, "^7Please change rear ^7and front ^7tyres to ^3Super" );
ENDIF
## Allowed cars on the server
## Vehicle class: saloon, touring car or GT
## 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["class"] = getmoddedcarinfo($userName);
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
## Allowed Drivetrains on the server
## Drivetrain: Rear Wheel Drive [RWD] or Four wheel drive AWD
## List of Drivetrains
## No_drive, //0: No_drive
## Rear_wheel_drive, //1: RWD
## Front_wheel_drive, //2: FWD
## All_Wheel_Drive_AWD, //3: All-Wheel Drive
## Four_wheel_drive, //4: 4WD
$modinfo["drive"] = getmoddedcarinfo($userName);
IF(($modinfo["drive"] != "RWD" ) && ($modinfo["drive"] != "AWD") && ($modinfo["drive"] != "4WD"))
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 drivetrains ^7on the server are ^3RWD or AWD" );
ENDIF
EndEvent
Made the changes.
I still need to exclude front-wheel drive cars. Is there a query for the drivetrain?
is it something like
$modinfo["drive"] = getmoddedcarinfo($userName);
... and then the same if-then logic can be applied in the same way.
## Allowed Drivetrains on the server
## Drivetrain: Rear Wheel Drive [RWD] or Four wheel drive AWD
## List of Drivetrains
## No_drive, //0: No_drive
## Rear_wheel_drive, //1: RWD
## Front_wheel_drive, //2: FWD
## Four_wheel_drive, //3: AWD
Code:
----
Event OnNewPlayerJoin( $userName )
## Allowed tyres on the server
## Tyre types: Super or Normal
## List of Tyre types
## Slick_R1, //0: R1
## Slick_R2, //1: R2
## Slick_R3, //2: R3
## Slick_R4, //3: R4
## Road_super, //4: Super
## Road_normal, //5: Normal
## Hybrid, //6: Hybrid
## Knobbly, //7: Knobbly
$OTFR = GetCurrentPlayerVar( "OldTyreFrontRight" ); # Vanha Rengas etu oikea
$OTRR = GetCurrentPlayerVar( "OldTyreRearRight" ); # Vanha Rengas taka oikea
$TFR = GetCurrentPlayerVar( "TyreFrontRight" ); # Rengas etu oikea
$TRR = GetCurrentPlayerVar( "TyreRearRight" ); # Rengas taka oikea
$FWAdj = GetCurrentPlayerVar( "FrontWheelsAdj" ); # Etu rengas säätö?
$RWAdj = GetCurrentPlayerVar( "RearWheelsAdj" ); # Taka rengas säätö?
IF (($OTRR != "TYRE_ROAD_SUPER" ) && ($OTFR != "TYRE_ROAD_SUPER" ) && ($TRR != "TYRE_ROAD_SUPER" ) && ($TFR != "TYRE_ROAD_SUPER" ) && ($OTRR != "TYRE_ROAD_NORMAL" ) && ($OTFR != "TYRE_ROAD_NORMAL" ) && ($TRR != "TYRE_ROAD_NORMAL" ) && ($TFR != "TYRE_ROAD_NORMAL" ))
THEN
cmdLFS( "/spec " . GetCurrentPlayerVar("UserName") );
openPrivButton( "tyrespec",50,35,100,15,5,15,32, "^7You have been moved to spectators because your ^1disallowed ^7tyres");
openPrivButton( "tyrechange",50,50,100,15,5,15,32, "^7Please change your tyres to ^3Normal ^7or ^3Super" );
# openPrivButton( "tyrechange",50,50,100,15,5,15,32, "^7Please change rear ^7and front ^7tyres to ^3Super" );
ENDIF
## Allowed cars on the server
## Vehicle class: saloon, touring car or GT
## 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["class"] = getmoddedcarinfo($userName);
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
EndEvent
Under here are my lapper lines.
Haven't yet had time to test it (, because when you have children and want to have oranges you get bananas).
##############################
# Allowed cars on the server #
##############################
# Vehicle Class
#0: Object
#1: Touring car
#2: Saloon car
#3: Buggy
#4: Formula
#5: GT
#6: Kart
#7: Bike
#8: Van
#9: Truck
#10: Formula 1
#11: Formula SAE
#################################
Event OnNewPlayerJoin( $userName )
$modinfo = getmoddedcarinfo($userName);
IF (($modinfo == "OBJECT" ) || ($modinfo == "BUGGY" ) || ($modinfo == "FORMULA" ) || ($modinfo == "KART" ) || ($modinfo == "BIKE" ) || ($modinfo == "VAN" ) || ($modinfo == "TRUCK" ) || ($modinfo == "FORMULA 1" ) || ($modinfo == "FORMULA SAE" )
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
EndEvent
Greetings
I am setting up an open drifting server.
I want to restrict visitors' cars with the following requirements:
- Allowed Vehicle Types: `Touring_Car`, `Saloon_Car`, `GT`
- Tyre Compounds: Front and rear must both be `Super`
Any vehicle types or tyre compounds that do not meet the above conditions will result in the player being moved to spectators and shown a text window instructing them to change their car and tyre compound to an allowed one.
Question:
1. What command in Lapper can be used to check the joining player's vehicle type?
There was some API -thread, but that i did not understant, how to change it to work for me.
Under here is part from that code where car classes are numbered.
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
};
Is there someway to do your own pathfile? I can watch cordinates from track editor and i could draw my own track lines if code was readable with notepad++ or there was some sort of adapter program.
Know that I can copy existing path file and make it work on X or Y layout, but i would prefer to code my tracks also for easier camera alignment.