The online racing simulator
Searching in All forums
(24 results)
Servet_zngl
S3 licensed
Up +
Servet_zngl
S3 licensed
Quote from Yisc[NL :;2075908"]As I think that you already have created a loop to go through the content of the file, you should add SplitToArray to that loop.
The value to make the split on will be "=" which will then give you an array for each line, with the following content in the array for each line read:

position 0 of the array: name of the value
position 1 of the arry: value

Example:

position 0 of the array: ban
position 1 of the arry: 0

I would like to inform you that when we used this code with our teammate, inspired by your comment, I got the result we wanted, thank you.

$idxSpace = indexOf( $Line, "=");
$car = subStr( $Line,0,$idxSpace );
Getting row index in file system
Servet_zngl
S3 licensed
Hello everyone, after a long time. I am facing a problem regarding a detailed system I have built.



I created a user infrastructure as shown in the picture, and it is created by default for each logged-in user, but when reading the data (readfile method), it takes the entire line, but I only want to get the 0's, 1's at the end or other data, for example, the 9th value of the 17th line or the 17th value. How can I get the part from the 9th to the 15th value of the line? It can be done with indexof or indexrange in C# language.
Servet_zngl
S3 licensed
Quote from Yisc[NL :;2062170"]This line has no function: $FileCreationDate = $LinesofFile["TimeOfCreation"];

But that does not create a problem I think.
Does the edit happen when you try this: $NewText = "TESTTEST";

It would also be useful to check the error log and see if any error is reported by Lapper.

No, because I couldn't run it together with file creation, but when I linked it to a separate command, for example !editfile, it works, and in addition, it transfers the lappervar data properly.
Servet_zngl
S3 licensed
Quote from Yisc[NL :;2062161"]The problem is this line: $Filename = $username;
Should be: $Filename = $userName;

Even though I made the change he mentioned, there is no movement.
Servet_zngl
S3 licensed
Quote from Servet_zngl :As seen in the picture, when I place the code, it only creates a file, but it does not edit the content. In simple terms, I want to create a file for each user who logs in (by default, it does not add a second file if there is one) and add some information about the user, the simplest of which was the date and time of login.

The Edit file method in the picture works when used alone in the sub.

I don't think the file creation date variable affects other codes.
Error creating and printing user file
Servet_zngl
S3 licensed
As seen in the picture, when I place the code, it only creates a file, but it does not edit the content. In simple terms, I want to create a file for each user who logs in (by default, it does not add a second file if there is one) and add some information about the user, the simplest of which was the date and time of login.

The Edit file method in the picture works when used alone in the sub.
Servet_zngl
S3 licensed
Quote from Androphp :uWuu Perfect 👍 Turkey Lapper Man Deeveloploplop yess yyes yes prsskibi developloplop

Maybe after you Big grin
Spawn point selection Just a Drive similar system
Servet_zngl
S3 licensed
Hello everyone

My team and I have now finished the infrastructure of the system that allows you to choose a spawn place, just like when you exit Pit on Lapper version 7.0.7.0 on Just a Drive server And there is no similar System in my country Smile (Version 6R, 7D in the future) The system is working now but As in the picture, it seems like JOIN REQUEST must be at the bottom because even if the two swap places, it doesn't teleport to the place I want. Is this a self problem or can it be optimized?


Thanks to everyone who has helped so far


In addition, I would like to invite experts in this field to my 7d server for testing. In my country, we are 2-3 people who develop almost comprehensive lapper
Show button to other person ?
Servet_zngl
S3 licensed
How can I open a button to a user simply? For example: When an authorized player warns, I want to show a warning to him or it can be in a private message.
Thanks in advance to everyone who will help.
Servet_zngl
S3 licensed
Quote from Yisc[NL :;2045077"]In 5 minutes I have put this script together.
There is no close button, but that is on purpose as I think people should be able to code that (there are examples enough to look at).

I've attached the script as a file as well.
Rename the extension to .lpr and make sure to add a reference to addonsused.lpr


<?php 
CatchEvent OnMSO
$userName$text # Player event
    
$idxOfFirtsSpace indexOf$text" ");

    IF( 
$idxOfFirtsSpace == -THEN
      $command 
$text;
      
$argv "";
    ELSE
      
$command subStr$text,0,$idxOfFirtsSpace );
      
$argv trimsubStr$text,$idxOfFirtsSpace ) );
    ENDIF

    SWITCH( 
$command )
        CASE 
"!ctrl":
            
control_lapper0,);
            BREAK;
    ENDSWITCH
EndCatchEvent

Sub control_lapper
$KeyFlags,$id )
    
### Set initial values for left/right and top/bottom coordinates ###
    
$left_right_control 54;
    
$top_bottom_control 50;
    
### End ###

    
openPrivButton"control_term_lapper",$left_right_control+1,$top_bottom_control+56,45,5,5,-1,32"^3Terminate Lapper"control_term_lapper);
    
openPrivButton"control_reload_lapper",$left_right_control+46,$top_bottom_control+56,45,5,5,-1,32"^3Reload Lapper"control_reload_lapper);
EndSub

Sub control_term_lapper
$KeyFlags,$id )
    IF ( 
UserIsAdmin$userName ) == )
    
THEN
      globalMsg
langEngine"%{main_lapclose}%" ) );
      
termLapper();
    ENDIF
EndSub

Sub control_reload_lapper
$KeyFlags,$id )
    IF ( 
UserIsAdmin$userName ) == )
    
THEN
      privMsg
("Restarting and reloading config!");
      
reload();
    ENDIF
EndSub
?>



thank you for your help i will try this
reload() ,term() in Button
Servet_zngl
S3 licensed
How can we assign functions like Lapper shutdown and restart to buttons? I tried redirecting to sub but no success
Servet_zngl
S3 licensed
Quote from Bass-Driver :Hello,

Before you want to write text to a file, you must create a file first.
CreateFile();

To edit the file like adding/deleting lines to/from the file
EditFile();

And to read the file.
Readfile();

See some examples below.


<?php 
Create
/Edit/ReadTextfiles
        
#===================================================
        #Create textfiles (Include FileExist options) (only .txt extension)
        #===================================================
                
$FileName "Filename";
                
$NameofDirectory "C:\Users\User\Desktop";
                
$FileExistOption 0;
            
               
What todo if file exist:

               
no action
               1 
overwrite file
               2 
overwrite file create backup file.

               
CreateFile($FileName,$NameofDirectory,$FileExistOption);
           
        
#===================================================
        #Read file (Possible to read various Filetypes: .log/.txt/.ini/.cfg.lpr)
        #===================================================
                
$LinesofFile Readfile($Filename,$Folder);
                
What info you get from file.
                
                -
FileSize in bytes
                
-CreationDate/Time
                
-ModificationDate/Time
                
-Number Of lines
                
-LineNumber
                
-Text from each line
                
                
!!!!EXAMPLE CODE!!!!
                
                    
$Filename "TestFile";
                    
$Folder "C:\Users\Danny\Desktop";
                    
$Extension ".txt";
                    
$LinesofFile Readfile($Filename,$Folder,$Extension);
                    
                
                    
$NrOfLines ToNum($LinesofFile["NumberOfLines"]);
                    
$FileCreationDate $LinesofFile["TimeOfCreation"];
                    
$FileModificationTime $LinesofFile["TimeOfModification"];
                    
$FileSize $LinesofFile["FileSize"];
                    
                    
privmsg("Reading file: " $Filename "" .$Extension);
                    
privmsg("NumberOfLines: " $NrOfLines "");
                    
privmsg("Size of file: " $FileSize " bytes");
                    
privmsg("Creation time: " $FileCreationDate "");
                    
privmsg("Modify time: " $FileModificationTime "");
                    
                    FOR ( 
$i 0$i <= $NrOfLines-$i $i 1)
                        
$linenr $LinesofFile[$i,"LineNumber"];
                        
$line $LinesofFile[$i,"Line"];
                        
privmsg("[".$linenr."]: ".$line);                    
                    ENDFOR

        !!!!!!!!!! USE 
THE FOR/WHILE LOOPONLY FOR THE LINES YOU WANT TO BE DISPLAYED ON YOUR SCREEN !!!!!!!!!!!!!!!!!!!
            
        
#===================================================
        #Edit file (Possible to edit various Filetypes: .log/.txt/.ini/.cfg/.lpr)
        #===================================================
        
                
$Filename "TestFile";
                
$Folder "C:\Users\Blah\Desktop";
                
$NewText "TESTTEST";
                
$LineToEdit = -1;  # -1 to create a extra line
                
$Extension ".txt"
                
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);

               
#Delete a single line in the file.
               #Set '-1' as $NewText and set $LineToEdit which line you want to delete.
    
                
$Filename "TestFile";
                
$Folder "C:\Users\Blah\Desktop";
                
$NewText = -1;
                
$LineToEdit 5
                
$Extension ".txt"
                
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);
?>


Sorry for my delayed reply, I'll keep trying the method you provided, thank you for sharing your information.
simple logging (LOG) system
Servet_zngl
S3 licensed
hello everyone What I want to do is I want to record the events of which authorized person performs which action to which user in the admin panel I designed, in a txt and when necessary, I want to read from this file and print it on the panel. If I need to summarize more How can I print and read data in txt with lapper? Basic view of the admin panel I pictured:
Servet_zngl
S3 licensed
Of course, if I encounter an error, I will now look at the first log record.

Quote from Bass-Driver :Nice to see, that you got the code working.
Its trial and error to understand how the code works. I'm sure you can build some nice scripts around it.

Also if a piece of code isn't working, you could check the xxx.xxx.xxx.xxx-yyyyy.ERR files(error logs) to check if something is wrong.

Servet_zngl
S3 licensed
Thank you for your help. I did a study with your idea. It is working now. Even if it is a novice, it may be useful for other users. I am new to these topics.


CASE "!rt":
$X_Axis = getcurrentplayervar("X"); #X axis SpawnPoint
$Y_Axis = getcurrentplayervar("Y"); #Y axis SpawnPoint
$Z_Axis = getcurrentplayervar("Z"); #Z axis SpawnPoint
$Flags = 128; #Move/Reset car (128) else (0)
$Heading = getcurrentplayervar("Heading"); #Heading of the players car at Spawnpoint
$UCID = 0; #Connection's unique id (0 = host)
$PLID = getcurrentplayervar("PLID"); #Player's unique id
$JRRAction = 4;
$heading12 = (getcurrentplayervar("Heading") ;
IF (getcurrentplayervar("Heading") < 0)
THEN
PrivMsg("^T^7Araç Çevirme ^2Başarılı");


joinrequest($X_Axis , $Y_Axis , $Z_Axis , $Flags ,$Heading+180 , $UCID , $PLID ,$JRRAction); #Send Data to LFS
ELSE
PrivMsg("^T^7Araç Çevirme ^2Başarılı");
joinrequest($X_Axis , $Y_Axis , $Z_Axis , $Flags ,$Heading-179 , $UCID , $PLID ,$JRRAction); #Send Data to LFS
ENDIF

Lapper Code Help (Soawn System !jrr)
Servet_zngl
S3 licensed
What is the logic of the Spawn system on the currently active JUST DRIVE server? I think maybe changing the PLIC ID of the players might work, but I'm not sure

In addition, I changed the !jrr command to !rp without any problems, second thing I want to do is Reverse the HEADINGs of the Tools In short, I want to Rotate the Vehicle 180 degrees. I tried with many math operations but failed. Thanks in advance to everyone who helped.
Servet_zngl
S3 licensed
Thx for info
Servet_zngl
S3 licensed
Thank you it's finally done İ use vcredist x86
Last edited by Servet_zngl, .
Servet_zngl
S3 licensed
Thank you it's finally done
Lfs Lapper Sqllite error
Servet_zngl
S3 licensed
I bought an original LFS host and opened it, although I entered all the correct information, I cannot connect to the server. The error message is attached.

Server Game Versiyon : 7.D


12/18/2022 8:30:08 AM

Lapper Instance 185.123.101.78/52050 abort!

Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. The specified module could not be found.
LFSLapper
at LFSDbs.DbsAccess..ctor(Debug pmyDebug, String DbName)
at LFSDbs.gripDbs..ctor(Debug pmyDebug, String puniqueConnectionId, String DbName, Int32 LapTimeUsedForPbPar, String FtpServer, String FtpLogin, String FtpPasswd, String FtpRemotePath, String dateFormat)
at LFSLapper.LFSClient.init(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pIniFile, String pSuperUsers, Int32 timeOutScript)
at LFSLapper.LFSClient..ctor(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pInifile, String pSuperUsers, Int32 timeOutScript)
at LapperInstances.LapperInstance.doConnection()
Void .ctor(GLDebug.Debug, System.String)
Closing Instance...

Servet_zngl
S3 licensed
an older lapper is currently being used, I was just wondering if it is possible to upgrade to higher versions, thank you for the information, regards.
Quote from Racon :It seems from the log that lapper is shutting down because the request to use version 8 is denied - if that's what it is, you'll need an older version of lapper to connect to LFS 0.6R. (0.6T is the first to use InSim v8)

Servet_zngl
S3 licensed
I did what you said, I still got the same error, do you have another method that you can offer?


6R must be very old Big grin



-----------------------------------------------------------------------------
11/16/2022 8:00:40 AM

Lapper Instance 195.85.216.146/29152 abort!

Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. The specified module could not be found.
LFSLapper
at LFSDbs.DbsAccess..ctor(Debug pmyDebug, String DbName)
at LFSDbs.gripDbs..ctor(Debug pmyDebug, String puniqueConnectionId, String DbName, Int32 LapTimeUsedForPbPar, String FtpServer, String FtpLogin, String FtpPasswd, String FtpRemotePath, String dateFormat)
at LFSLapper.LFSClient.init(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pIniFile, String pSuperUsers, Int32 timeOutScript)
at LFSLapper.LFSClient..ctor(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pInifile, String pSuperUsers, Int32 timeOutScript)
at LapperInstances.LapperInstance.doConnection()
Void .ctor(GLDebug.Debug, System.String)
Closing Instance...
Error for 6R InSim : version 8 requested - using 7
Servet_zngl
S3 licensed
I can use Lapper version 7.0.4.6, but I can't open higher versions with discord plugin because of this error.
In addition
I cannot assign the ip address variable in version 7.0.4.6

Error Lfs CMD
Nov 16 05:06:31 InSim - TCP : LFSLapper
Nov 16 05:06:31 InSim : version 8 requested - using 7
Nov 16 05:06:32 InSim guest closed : LFSLapper




Error log
-----------------------------------------------------------------------------
11/16/2022 5:22:06 AM

Lapper Instance 195.85.216.146/29990 abort!

Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. The specified module could not be found.
LFSLapper
at LFSDbs.DbsAccess..ctor(Debug pmyDebug, String DbName)
at LFSDbs.gripDbs..ctor(Debug pmyDebug, String puniqueConnectionId, String DbName, Int32 LapTimeUsedForPbPar, String FtpServer, String FtpLogin, String FtpPasswd, String FtpRemotePath, String dateFormat)
at LFSLapper.LFSClient.init(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pIniFile, String pSuperUsers, Int32 timeOutScript)
at LFSLapper.LFSClient..ctor(String pGroupID, String pName, String pip, Int32 pport, String pWorkingDir, String pInifile, String pSuperUsers, Int32 timeOutScript)
at LapperInstances.LapperInstance.doConnection()
Void .ctor(GLDebug.Debug, System.String)
Closing Instance...
-----------------------------------------------------------------------------
FGED GREDG RDFGDR GSFDG