The online racing simulator
Searching in All forums
(879 results)
Bass-Driver
S3 licensed
i personally find this a good idea. Not to difficult to configure i think?
But something tells me that subject is discussed before.

But uhm what about the following sections that need to be restricted.
- Programmer forum
-'Files' forum section
-'Media' forum section

I also have to agree with Huskii. But yeah to late to fix that.
Bass-Driver
S3 licensed
If you open the script, see will see alot of RegisterNodeAction() lines.
one of the is RegisterNodeAction( "FE1" , 24 , SE_snow4,"" );

This is for FernBay 01 and it will executes on a particular node on the track. Type !node to see your current node.

However. What you want is getting snow on a Open-Config track. Since Open-Configs doesnt work with nodes but with X and Y Axis(Called Zones in Lapper). That means you have to work with a another function is Lapper: RegisterZoneAction();

Example:

#RegisterZoneAction("Track" , X , Y , Width of Zone, EnterZone, LeaveZone);
RegisterZoneAction( "WE1X" , 24 , 30 , 1 , SE_snow4,"" );

Type !zone to get your current X and Y position.

More info about Nodes and Zone in the link below.

https://www.lfs.net/forum/thread/89860-Nodes-and-Zones
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
As first, when a new player joined the server. You need to set a new playervar for that player.

Event OnConnect($userName)
SetPlayerVar($userName,"Health",100);
EndEvent

Than you have to create code, that decrease the "Health" of the player. Most cruiseservers do this with distance. Every 1000 meters = Decreasing health with 2%.

Also a loop is required to get the PlayerVars for each player.
See the example below.

https://www.lfs.net/forum/thread/91285-LFSLapper%3A-Code-Examples.

And to display it to the players, you could use the code above as a base.
HealthBar
Bass-Driver
S3 licensed
Hello,

I've created a healthbar for several purposes. One of them is for Lapper CruiseInsims.

Features:

-Choose your type of character: I ,| or dots or whatever you like:
-Colorscheme is easy to adjust,
-Length of the bar ( length of the characters you used).

How to use it:

-Download the script:
-Rename the file to HealthBar.LPR with 'notepad' or other textediting applications
-Place the file in 'include' folder (Bin\Default\Includes)
-Add the following line in 'AddonsUsed.LPR' (Bin\Default\Includes\Addonsused.LPR)
include( "./HealthBar.LPR");
-Type command !hb <0-100> Example: !hb 25


<?php 
#==================================================================================#
#Scriptname:     HealthBar.LPR
#Author:          Bass-Driver
#Version:          1.0
#VersionDate:     25-12-2017
#Description:     HealthBar, With automatic colored chars calculation
#==================================================================================#
CatchEvent OnMSO$userName$text # Player event
    
$text Tolower$text );
    
$idxOfFirstSpace indexOf$text" ");
    IF( 
$idxOfFirstSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirstSpace );
      
$argv trimsubStr$text,$idxOfFirstSpace ) );
    ENDIF

    SWITCH( 
$command )
        CASE 
"!hb":
            
#Check is Argv is a numeric value
            
IF (IsNum($argv) == 1THEN
                $Health 
$argv;
                
$HealthBar "IIIIIIIIIIIIIIIIIIII";                     #Kind of chars for the bar (count even chars) 10/20/40/50/100)
                
$CurrentHealth "".CalculateHealth($Health,$HealthBar);#Get Calculated string  
                
                #IF health is equal or below 15% , it will blink.
                
IF (ToNum($Health) <= 15THEN
                    openButton
($userName,"statusbar",178,100,22,4,5,-1,80,"^0Health: ".$HealthBar." ^0(".$Health."%) %at%^0Health: ".$CurrentHealth." ^0(".$Health."%)");
                ELSE
                    
openButton($userName,"statusbar",178,100,22,4,5,-1,80,"^0Health: ".$CurrentHealth." (".$Health."%)");
                ENDIF
            ENDIF
        BREAK;
    ENDSWITCH
EndCatchEvent

Sub CalculateHealth
($Health,$HealthBar)
            
#Get length of the healthbar
            #Calcalate how many chars need be colored ((LenghtOfChars/100%) * Health)
            
$LengthOfBar StrLen$HealthBar );
            
$GetStatus ToNum(Round((($LengthOfBar/100)*$Health),0));
            
            
#Get length of string that need to be colored.
            
$GetString substr$HealthBar,0,$GetStatus );
            
#And rhe rest of the string
            
$GetOtherChars substr$HealthBar,$GetStatus,$LengthOfBar-$GetStatus );
            
            
#Which color need the calculate string have at a particular Health%
            
IF (ToNum($Health) >= 50THEN
                $NewHealth 
"^2".$GetString;
            ENDIF
            IF (
ToNum($Health) >= 20 && ToNum($Health) < 50THEN
                $NewHealth 
"^3".$GetString;
            ENDIF
            IF (
ToNum($Health) < 20THEN
                $NewHealth 
"^1".$GetString;
            ENDIF
            
#Calculate how many chars are colored , the rest will be black. Total chars = 20, Health = 50% = 10 colored chars, rest of the 10 chars will be black.
            
$GetLength StrLen$NewHealth );
            
$NewHealthBar Insert($NewHealth,$GetLength,"^0".$GetOtherChars);
            
            
#Create new string when health is below 5 %
            
IF (ToNum($Health) < 5THEN
                $NewHealthBar 
"^1".$HealthBar;
            ENDIF    
        
#Return value/string.    
        
Return($NewHealthBar."");
EndSub
?>


Release: LFSLapper V7.0.5.0
Bass-Driver
S3 licensed


Hello LapperUsers,

!!!YOU MUST DOWNLOAD LFS TESTPATCH R12 or HIGHER TO RUN THIS LAPPER VERSION!!!

See the changelog below what the new features are.

+---------------------------------+
|Changes from 7.0.4.10 to 7.0.5.0|
+---------------------------------+
-New Function
-New Events
-Several BugFixes
=================================================
New:
=================================================
=================================================
NEW EVENTS:
=================================================
01: New Event: Event OnTakeOverCar($Player_Old,$Player_New,$Car)
Event executes when someone takes over someone cars.

02: New Event: Event OnLapValidation( $userName,$HVLC,$Time )
Reports when a player hits a wall, goes off track, goes Out of Bounds, Speeds in the pitlane
#Output of $HVLC
# 0 : Off Track
# 1 : Hits Wall
# 4 : Speeding in pitlane
# 5 : Out of Bounds

03: New Event: OnInterfaceMode() VERSION LFS 0.6R12 required!!!!!
-Reports in which menu the Player is.
-Also report when a admin is editing an object in Shift+U mode

Event OnInterfaceMode($userName,$Mode,$SubMode,$SelObject,$Time) # Player event
#YourcodeHere
EndEvent
=================================================
NEW FUNCTIONS:
=================================================
01: New Function: GetAngle(); See attachment
-Get the angle of location or player , depends on your Cars Heading.

$Angle = GetAngle($userName,$userName);
$Angle = GetAngle($TheLocation,$userName);
$Angle = GetAngle($userName,$TheLocation);
$Angle = GetAngle($TheLocation,$TheLocation);
$Angle = GetAngle("-150:26","-150:26"); #(X:Y,x:y)

02: New Function: CarSwitches(); //More info in Docs/CarSwitches
-Set switches of your car lights,horn,siren,flash,signals
NOTE: You must be a host to enable this function.

03: New Lapperoption: DebugSettings , in LFSLapper.LPR
-When set one of the options below, it will displayed the executed subs/events/Loops in your Lapper console.
$DisplaySubs = 0; #Player created subs
$DisplayLoops = 0; #DelayedCommand functions,
$DisplayEvents = 0; #(Catch)Events

#Note: These settings are in a testfase, there is a chance that some subs not will be displayed in your console.

04: New Function: FileExist();
-Check if a file exist.
$Folder = "C:\Users\Danny\Desktop";
$FileName = "Testfile";
$Extension = ".txt";
IF (FileExist( $Folder,$FileName,$Extension ) == 1) THEN
privmsg("File Exist");
ELSE
privmsg("File does not Exist");
ENDIF

05: New Function: GetListOfFiles();

$Folder = "C:\Users\Danny\Desktop\CruiseFolder";

#Get an array of files from the folder
$ListOfFiles = getlistoffiles($Folder);

$NumberOfFileInFolder = 0; #This is the first file in the folder

#Values you can get from each file.
$FileNumber = $ListOfFiles[$NumberOfFileInFolder,"FileNumber"];
$FileName = $ListOfFiles[$NumberOfFileInFolder,"FileName"];
$CreationDate = $ListOfFiles[$NumberOfFileInFolder,"FileCreated"];
$ModifiedDate = $ListOfFiles[$NumberOfFileInFolder,"FileModified"];
$FileSize = $ListOfFiles[$NumberOfFileInFolder,"FileSize"];

06: New Lappervar: 'Lapperstate'
-Check which state your lapper is. Stable or experimental etc

=================================================
Updates:
=================================================
01: Lapper Console: Message/command length increased from 30 characters to 80 characters
02: Lapper Console: Message/command sendtime decreased from 1000 milliseconds to 100 milliseconds
03: Lapper Console: Server Connecting messages.
04: WriteLine(); Possible to use colortags ^0 - ^8 See attachment
05: Write(); Possible to use colortags ^0 - ^8
06: Sqlite Database libraryfiles. (not mono yet)
07: Event OnObjectInfo($userName,$NumO,$Action,$X,$Y,$Z,$Type,$InDex,$Heading) # Player event
//Added new value for $Action
//Get GroundLevel ZByte.
08: LFSLapper.LPR main scriptfile.
09: Update TrackList.cfg . Thanks Sinanju :)
10: Possible to not allow AI on track. THANKS LakynVonLegendaus
####################
#Disable AI drivers# (Can be found in LFSLapper.LPR below $DefaultTopCar option)
####################
# If enabled, LFS will not allow AI drivers to join race (/ai) and all AI drives that are
already on track will be spectated on Lapper start/reload
$DisableAI = -1; # Enable (1) or disable (-1)

11: Add/Removeobject: Floating values for X / Y / Z axis are now possible
12: Add/Removeobject: Non-floating input values will now be converted into floating values
13: Lapper no longer returns $userName converted to lowercase format
14: UserGroupToFile no longer converts usernames to lowercase format

=================================================
Fix:
=================================================
01: FO8 characterbug in SetAllowedCars();
02: F08 characterbug in AllowedPlayerCars();
03: Remove($String,$StartIndex,$NumberOfChars) : Error when StartIndex is lower than 1.
04: Addobject(): Lapper crash when X and Y values are floating (comma) numbers (0,00).
05: Addobject(): Lapper crash when Heading value is negative.
06: Removeobject(): Lapper crash when X and Y values are floating (comma) numbers (0,00).
07: Removeobject(): Lapper crash when Heading value is negative.
08: EditFile(): Lappercrash caused by a wrong hardcoded errormessage.
09: Lapper Console: Lapperserver 'stopped' message while starting a lapperserver.
10: Hosts also executed Flooding Events.
11: No error messages for StartLightControl.
12: joinrequest: Lapper crash when CarHeading is lower than 0.
13: (Priv/Host)Delayedcommand: Cannot be executed when settime is not equal with the current time.
The Delayedcommand task stays in the list and will never be executed.
Continues loops could hang. And had to be resetted manually.
14: Add/Removeobject: Heading value wasnt calculated correctly. And negative values werent possible.
15: Random UCO insimpacket crashes
16: AFKTimer/IdleTimer PlayerVars

See the bug/request tracker in the link below:

Linky

Some feedback whould be nice Tongue
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Tell us the steps you have done. And where do you get stuck.

Example:
-Downloaded the script.
-Placed the script in the 'includes' folder (Bin/Default/Includes)
etc...

Bass-Driver
S3 licensed
There are several options to run Lapper 24/7


- Free and Simple: Let your computer on for 24/7. (Except powercosts etc)
- Less expensive: Let someone else run Lapper for you. But i think it whould cost you money.
- Most expensive: Buy a VPS (Virtual private server) at a hosting company.

Bass-Driver
S3 licensed
apparently, i left some debugmessages in this version.

You can delete these messages in LFSLapper.LPR
See attachment for more info.

And for the people that doesnt know.
SAVE THE FILE!!!

Sorry for my mistake.

Bass-Driver
S3 licensed
Oh oke, well that drag system isnt that simple. You have todo some setup work. So that isnt a system for you sorry.
Bass-Driver
S3 licensed
@LOXISLOXIS

Did you bought a server or do you host a dedicated server yourself?

Seems you are dealing with the same issue as you had with LFSLapper.

https://www.lfs.net/forum/thread/91721-Help-with-SetUp-Lapper
https://www.lfs.net/forum/post/1931361#post1931361
Bass-Driver
S3 licensed
If you tell us which errors you are receiving, we could help you to fix that.

Also check the ERR and MSS files aswell. you can find these in the the 'logs' folder (Lapperfolder/Bin/Default/Logs)

xxx.xxx.xxx.xxx-xxxxx-ERR.log & xxx.xxx.xxx.xxx-xxxxx-MSS.log

And errors and questions about the Lapper dragsystem.

And any lapper problem, please post that in the Lapper development section
Bass-Driver
S3 licensed
That tutorial is not to create a server. But how to setup Lapper on a (dedicated) LFSServer.

It seems that lapper is connecting to your dedicated server. But it doesnt stay connected.

One of the main issue is the adminpass.

If you know the Adminpass of your dedicated server, then you have to enter in the same adminpass in the default_1.ini file as been said in the tutorial aswell.

Open default_1.ini (LFSLapper directory/Bin/default/default_1.ini)
-Set the Server-AdminPass: $password = "adminpass";

Bass-Driver
S3 licensed
as first, i suggest to get the newest version of Lapper:

https://www.lfs.net/forum/thread/91567-Release%3A-LFSLapper-V7-0-4-10


And check this link below aswell. Contains information to setup Lapper.

https://www.lfs.net/forum/post/1305869#post1305869
Bass-Driver
S3 licensed
If you or someone else find a fix for it.
Could you post the fix in this topic please.

For other people who is dealing with the same issue.

Thanks in advanced.
Bass-Driver
S3 licensed
looking on the web, i think this is not a lapper problem but more a Linux/Mono issue , thats not supporting a version of something.

I suggest you to google the error: The runtime version supported by this application is unavailable. To find a fix for it.

Or someone must join this topic, who's having more experience with Linux/Mono.
Sorry but i have no clue how to solve this. :S
Bass-Driver
S3 licensed
you have to change the insimport in the configfile (LFSServer.cfg) of lapper aswell

| Server/PC IP |Insimport
DEF1|gr1|xxx.xxx.xxx.xxx|xxxxx|./default|default_1.ini|autowork

Bass-Driver
S3 licensed
Have you set /insim = 29999 in the Setup.cfg of your dedicated server?

Bass-Driver
S3 licensed
To be honest, i have no idea how to fix this. I have no experience with mono.
On the web i found this. Maybe this fixes it.

http://do-the-right-things.blogspot.nl/2017/05/the-way-to-suppress-monos-warning.html

Lapper is compiled with Net Framework version 3.5.
Bass-Driver
S3 licensed
What does the Error files tell you?

(bin/Default/Logs/)
xxx.xxx.xxx.xxx-insimport.ERR
and
xxx.xxx.xxx.xxx-insimport.MSS
Bass-Driver
S3 licensed
Thanks , is noted.
Will look into it.
LFSLapper: Split Strings (Text)
Bass-Driver
S3 licensed
Hello,
While supporting/pre dev an Lapper cruiseserver : [SC] Cruise Server, i have saw many things the developers are dealing with.
One of them are the stringlengths. Its limited by Insim to a maximum of 128 characters.
So if you type/sent 140 characters with privmsg(); or globalmsg(); LFS will only display 128 characters.

So i came up with a script that gives the possibility to split the string in 2 seperated strings.

In this script you need to type a command to activate the function to split the string.
You may allowed to change the command to your own purposes.
Do not change any of the code in the SplitText() function.


Make sure to add the following lines into addonsused.lpr

include ("./SplitString.lpr");

And change the file extension to .LPR

SplitString.txt to SplitString.LPR

The code look like this:

<?php 
       
#==================================================================================#
#Scriptname:     SplitString.LPR
#Author:          Bass-Driver
#Version:          1.0
#VersionDate:     09-12-2017
#Description:     Split a string with a max amount of characters in 2 strings.
#                Choose between return a Global or a Private Message.
#                Split a string by the choosen delimiter.
#==================================================================================#

CatchEvent OnLapperStart()
    
GlobalVar $MaxLen;                      $MaxLen 120;                     #Max length of first string.
    
GlobalVar $StartIndex;                     $StartIndex 0;                #StartIndex to read the firststring or total text
    
GlobalVar $ReadMaxCharsForDelimiter;    $ReadMaxCharsForDelimiter 5;    #How many chars to read back from the first string. (IF delimiterchar is set)
EndCatchEvent


CatchEvent OnMSO
$userName$text # Player event
    
$text Tolower$text );
    
$idxOfFirstSpace indexOf$text" ");
    IF( 
$idxOfFirstSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirstSpace );
      
$argv trimsubStr$text,$idxOfFirstSpace ) );
    ENDIF

    SWITCH( 
$command )
        CASE 
"!spst":
        CASE 
"!splitstring":
        
            
$Privmsg 1;            #Set return message in a privatemessage = 1 or a globalmsg = 0;
            
$Player $userName;    #Set username if you have set a private message
            
$Text $argv;            #Text
            
$Delimiter ",";        #Set a char that will split the string for more precision. 
                                    #Keep empty to split the text after a maximum of chars.
            
            #Call Sub
            
SplitText($Privmsg,$Player,$Text,$Delimiter);
            
        BREAK;
    ENDSWITCH
EndCatchEvent

Sub SplitText
($privmsg,$userName,$Text,$Delimiter)
    
#SplitText variables
    
$LoT StrLen($Text);             #Get Length of total text
    
    #When Textlength is higher than Maximumlength
    
IF ($LoT $MaxLenTHEN        
        $FirstString 
substr(  $Text$StartIndex$MaxLen);
        
$SecondString substr$Text,$MaxLen,$LoT-$MaxLen );
        
            
#Find Delimiters variables
        
IF (($Delimiter != "")&&(contains($FirstString,$Delimiter) == 1)) THEN        
            
#From where to start read string to find delimiter
            
$IndexOfDelimiterCheck $MaxLen $ReadMaxCharsForDelimiter;
            
            
#Get String between MaxLength of first string and StartFind delimiter
            
$StringDelimiterCheck substr(  $FirstString$IndexOfDelimiterCheck$ReadMaxCharsForDelimiter);
            
            
#Get Index of Delimiter
            
$IndexOfDelimiter indexOf$StringDelimiterCheck$Delimiter);
            
            
#Delimiter is found
            
IF ($IndexOfDelimiter != -1THEN
                
#Calculate the startindex of second string
                
$StartIndexSecondString = ($MaxLen $ReadMaxCharsForDelimiter) + ($IndexOfDelimiter+1);
                
                
#Calculate the length of the second string
                
$LenghtOfSecondString $LoT-$StartIndexSecondString;
                
                
#Get First string and Second string
                
$SecondString substr$Text$StartIndexSecondString$LenghtOfSecondString );
                
$FirstString substr$Text$StartIndex$StartIndexSecondString-1); #$StartIndexSecondString-1 = Remove Delimiter
            
ENDIF
        ENDIF
        
#Return message is a privatemessage or a globalmessage
        
IF ($privmsg == 1THEN
            privmsg
$userName,"" $FirstString );
            
privmsg$userName,"" $SecondString );
        ELSE
            
globalmsg("" $FirstString );
            
globalmsg("" $SecondString );
        ENDIF
    
#Text doesnt exceed textlength limit            
    
ELSE
        
#Return message is a privatemessage or a globalmessage
        
IF ($privmsg == 1THEN
            privmsg
$userName"" $Text );
        ELSE
            
globalmsg("" $Text);
        ENDIF
    ENDIF
EndSub
?>


Some example of some inputs and outputs.

#==================================================
#EXAMPLES
#==================================================
Settings: (max length is 10)

$Privmsg = 1;
$Player = $userName;
$Text = $argv;
$Delimiter = "";

Input:
!spst hellohello
Output:
hellohello

Input:
!spst hellohelloblah
Output:
hellohello
blah

#==================================================
$Privmsg = 1;
$Player = $userName;
$Text = $argv;
$Delimiter = ",";

Input:
!spst hellohello
Output:
hellohello


Input:
!spst hello,helloblah
Output:
hello
helloblah

Input:
!spst h,ellohelloblah
Output:
hellohello
blah

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
to be honest i have no idea.
You should email the devs about this.

I dont know how they set lapper on theire servers.
Bass-Driver
S3 licensed
Insimport that you have to set in Lapper is 54421 and not 29999
Bass-Driver
S3 licensed
Show us your serversettings.
FGED GREDG RDFGDR GSFDG