The online racing simulator
Searching in All forums
(882 results)
Bass-Driver
S3 licensed
Ohhh thats sucks indeed.
Maybe Scawen will increase the maximum buttons to 512 or something.

Just a idea:
What about creating pages for the schedules.
9 schedulelines per page and a maximum of 3 pages.
Bass-Driver
S3 licensed
Hi.
The updated files since TestVersion_10 are:

LFSLapper.exe
'Doc' folder
Bass-Driver
S3 licensed
Wow, these modules getting better and better.
Keep up the good work.
Release : LFSLapper V7.0.4.8
Bass-Driver
S3 licensed
Hello Lapperusers.

After adding many features and alot of testing.

Curious about the testing period?: Test: Lapper 7.0.4.8

Check the changelog below for the new/updated features.


+-------------------------------+
|Changes from 7.0.4.7 to 7.0.4.8|
+-------------------------------+
-Sort Arrays function
-Several functions to edit strings
-Delete stored values from the database
-Delete userstored values from the database
-New Lappervars
-Set/Get allowed cars on the server.
-Create/Edit/Read/Delete Textfiles.
-Old RemoveZoneAction() bugfix.
-Other Fixes.
-Small updates on errormessages
-Small Sourcecode cleanup.

=================================================
New:
=================================================

01: New Function: Sort() Sort Arrays

Sort(Var,"TypOfSort") Sort Arrays , TypOfSort = DESC or ASC: Sort values descending or ascending
$testArray[0] = A;
$testArray[1] = B;
$testArray[2] = C;
$testArray[3] = D;

$Sortedarray = Sort($testArray,$TypOfSort);

FOR ( $i = 0; $i < 4 ; $i = $i + 1)
privMsg( "^3" . $Sortedarray[$i] );
ENDFOR

02: Delete Stored (Player) Vars from database

DeleteUserStoredValue($userName,"Value"); #Delete user stored values from the database
DeleteStoredValue("Value"); #Delete stored values from the database

03: New Function: SetAllowedCars() Set Allowed cars on the server. (This is not the same as setallowedPlayerCars($username,$Cars))

$Cars = UF1+XRT+UFR;
SetAllowedCars($Cars);

04: New lappervars added: (retrieve values from LFS)
-Wind (returns 0,1 or 2)
-Weather (returns 1,2 or 3)
-RaceLaps (returns number of Laps) Returns 0 IF Hours is set
-RaceHours (return number of Hours) Returns 0 IF Laps is set
-allowedcars (Returns string of cars : UF1+XRT+XFG for example)

05: New function: Contains() Returns 1 or 0
$String = "teststring";
IF (Contains($String,"test") == 1) THEN
#yourcode
ENDIF

06: New function: Replace() Replace chars in a string
$oldstring = "LFSLapper String Test";
privmsg("Old String: ".$oldstring);

$newstring = Replace($oldstring,"","_");

privmsg("New String: ".$newstring);

07: New function: Insert() Insert chars in a string.
$oldstring = "LFSLapper String Test";

privmsg("Old String: ".$oldstring);
$newstring = Insert($oldstring,21," [Extra String]");

privmsg("New String: ".$newstring);

08: Created $TimeFormat var for 12 or 24hour format. used for the following LapperVars

GetLapperVar("ShortTime");
GetLapperVar("LongTime");

//The code below can be found in LFSLapper.LPR
$LongTimeFormat = "HH:mm:ss tt";
$ShortTimeFormat = "HH:mm";
# Used for GetLapperVar("LongTime") and GetLapperVar("ShortTime")
# HH = Hour in 0-23 format
# hh = Hour in 0-12 format
# mm = Minute
# ss = Seconds
# t = A/P "hh:mm:ss t"
# tt = AM/PM "hh:mm:ss tt"

09: Create/Read/Delete Textfiles
#===================================================
#Create textfiles (Include FileExist options) (only .txt extension)
#===================================================
$FileName = "Filename";
$NameofDirectory = "C:\Users\User\Desktop";
$FileExistOption = 0;

What todo if file exist:

0 = no action
1 = overwrite file
2 = overwrite file + create backup file.

CreateFile($FileName,$NameofDirectory,$FileExistOption);
#===================================================
#Delete textfiles (Include copy file option)
#===================================================
$FileName = "Filename";
$NameofDirectory = "C:\Users\User\Desktop";
$NameofCopyDirectory = "C:\Users\User\Desktop\Copy"; #or $NameofCopyDirectory = "";
$Extension = ".txt";

DeleteFile($FileName,$NameofDirectory,$NameofCopyDirectory,$Extension);
#===================================================
#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-1 ; $i = $i + 1)
$linenr = $LinesofFile[$i,"LineNumber"];
$line = $LinesofFile[$i,"Line"];
privmsg("[".$linenr."]: ".$line);
ENDFOR

!!!!!!!!!! USE THE FOR/WHILE LOOP, ONLY 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\Danny\Desktop";
$NewText = "TESTTEST";
$LineToEdit = -1; # -1 to create a extra line
$Extension = ".txt";
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);

=================================================
Updates:
=================================================

01: Files with LapperVars and LapperConfigvars updated.
02: Deleted !powered command: command became obsolete
03: Few errormessages updates (typo's & imcomplete info).

=================================================
Fixes:
=================================================
01: ToNum(); Wrong error message when PlayerVar is empty.

02: Several RemoveZoneAction() fixes:
-Leave Subroutine still active after removing zone.
-Lappercrash when deleting Zone in not particular order.

03: Several fixes on ErrorMessages (some caused lappercrashes)
04: Error on !ver command. caused by a invalid URL in webcommand
05: Incorrect tracknames from lapper when ShortTrackName contains more than 4 characters.
06: Lappercrash on subStr ($string, 4, 1); when Startindex is larger than the length of the string.
07: Incorrect errormessages for RegisterScheduleAction();
-Returns an errormessage when ID or Sub routine value is empty.
-Returns an errormessage when the time/date field is incorrect.


Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
no
Bass-Driver
S3 licensed
Very nice script.
I have noticed 1 small bug or this isnt one.

The deletebutton for deleting a single servername doesnt work.
Bass-Driver
S3 licensed
Really nice job you did there.

Thanks for your time and effort to creat this update.
This schedule system is much better than the old one for sure.
Bass-Driver
S3 licensed
i use the dutch version of Notepad++. Dont know what the names are in other languages Tongue
Bass-Driver
S3 licensed
Here is my custom syntax highlighting for NotePad++.
This is based on the C# syntax.

How to use:
  • -Save the file anywhere you like.
  • -Start NotePad
  • -Goto 'Languages' Tab
  • -Click on 'Define your language'
  • -Click on the 'import' button
  • -And goto the folder you saved the file and load it into NotePad++
The colored text is less dark than on this picture.
Last edited by Bass-Driver, . Reason : Wrong translation
Bass-Driver
S3 licensed
Thanks for sharing.
Personally i use NotePad++ for LFSLapper scripting with custom syntax highlighting.

I might share that as well soon.
Bass-Driver
S3 licensed
Skinzinho
Are you bored ??

Is it really nesserary to post in every topic, that might be related to "unofficial players"

Please stop paying attention to this. This might work against you in the futute.

Topic closed.
Bass-Driver
S3 licensed
Use CatchEvent/EndCatchEvent instead of Event/EndEvent.

'Event' will only be used in the LFSLapper.LPR file.

Open the file AddonsUsed.LPR and add include ("./SA_test_1.lpr");
Bass-Driver
S3 licensed
Hello,

To enable the Zone/Node action to have you add the RegisterZoneAction/RegisterNodeAction in the 'OnLapperStart' event.

<?php 
CatchEvent OnLapperStart
()
    
#Zone/Node actions in OnLapperStart event
                        #ZoneID,Track,Node,EnterNode,LeaveNode
    
RegisterNodeAction"MyNode""BL1" SA_Test_1"" );
 
                        
#ZoneID,Track,X,Y,EnterZone,LeaveZone
    
RegisterZoneAction"MyZone""BL1" 0,100 SA_Test_1"" );
EndCatchEvent
?>


The way you called the 'SA_Test_1' sub routine is good.

To use the InsimCircles in lapper you have to use the OnCrossingChecker() event. And the $CircleIndex, which is the Index of the circle you used ingame.


<?php 
CatchEvent OnCrossingChecker
($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex)  # Player event
   
IF($CircleIndex == 1THEN
      privmsg
("Blahblah");
   ENDIF
EndCatchEvent
?>


If something isnt working, you have to check the errorlogs first. These files are located in the 'Logs' folder (Bin/Default/Logs)
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
uhm, oke that is weird.
i re-upload Lapper now.
Release : LFSLapper V7.0.4.7
Bass-Driver
S3 licensed
Hello Lapperusers,

I'm proud to release a new version of LFSLapper with some interesting features.

See the changelog below:

+-------------------------------+
|Changes from 7.0.4.6 to 7.0.4.7|
+-------------------------------+

-Editable DriftTop script !drf
-Editable UserTop script !usertop
-Delete Driftscore from database
-Delete Laptimes from database
-Create streets and get info of current street ID
-Updated Errormessages (ERR Files)
-Location Databases changed
-Deleted some old hardcoded functions
-Retrieve list of layouts from server
-RealTime DriftScore
-Several Fixes: LFSlapper Crashes,Typos,Old Bugs

=================================================
New:
=================================================
01: Driftscore table is now editable. // drifttop.lpr

$list = getlisttopdrift( $argv,$flagQual,$flagNear ); #Get List from database

!drf command in LFSLapper.lpr

02: Usertop table is now editable. // usertop.lpr

$list = getlisttopuser( $value,$flagdesc,$flagNear,$filter ); #Get List from stored database

!usertop command in LFSLapper.lpr

03: New functions. Delete records from database (single one or all)

deletedriftrecords(); #Delete driftscores from current track
deletelaptimerecords(); #Delete laptime records from current track

Options:
-Delete a single record from current track: deletelaptimerecords(Username,Car)
-Delete a specific car from current track: deletelaptimerecords(-,Car)
-Delete a specific username from current track: deletelaptimerecords(username,-)

Commands can be found in: utils.lpr Bin/default/includes/utils.lpr
!dellr = Delete laptime record.
!deldr = Delete driftscore record.

04: New Function: Register Street Action

RegisterStreetAction( name of street,trackname,width of street,coordinates of street(separated by commas), callbackfunctionOnEnter,callbackfunctionOnLeave );
Callback command is executed when a street is entered or left by a player

Example:

RegisterStreetAction( Pitlane boulevard,WE1X,7,-201,233,-201,266,-202,316,-202,353,-202,389,-202,439,-202,487,-202,536,-201,561, EnterStreet, LeaveStreet );
On track WE1X, When Coordinate -201,233 is Reached the Sub EnterStreet is executed.
On track WE1X, When Coordinate -201,561 is Reached the Sub LeaveStreet is executed.

Patch for this function is created by Nick Axworthy.

05: New Playervars: according to the the new function above

currstreet
idcurrstreet

06: Load Layout system

###How to get list of layouts###
-LFSLapper MUST be on the same machine as your LFSServer
-Set Path of layoutfolder in LFSLapper.LPR (Line 207) Example: $LayoutFolder = "C:\LFS_0.6R\data\layout";
-Type !LayoutList (in Utils.LPR) to open the list.
-Click

#Features#
-List with layouts that are currently available on the server.
-No need to be a serveradmin anymore to load a layout(admin management)
-Number of layouts for current track
-LayoutName
-Modification Date
-Creation Date
-Editable script like Usertop/DriftTop

###Script idea's##
-Possible to create a Layout rotator system.
-Create a favo layout window.
-Layout Vote system

07: Realtime Driftscore option

$RealTimeDriftScore = -1; Set 1 to enable this feature.
-This may have effect on Lapper performance with many player in the server.
-Do not use this with the buildin DriftMeter Scripts.
=================================================
Update:
=================================================

01: ErrorMessages updated.

Some examples:

OLD: "Incorrect args number in function: Functionname".
NEW: "Incorrect number of parameters in function: Functionname".

OLD: "Need int in 2nd parameter of: Functionname".
NEW: "2nd parameter of function: Functionname. is not a valid Integer value".

02: Location Databases changed.

-Created a map for the Grip & Drift & StoredValue Databases. You can find them in the 'Databases' folder (Bin/default/Databases)

03: Changed hardcoded visible records in Toplist/UserTop/Drifttop from 18 to 24


=================================================
Fix:
=================================================
01: Lappercrash when LeaveZone/LeaveNode sub-routine is enabled.

02: Lappercrash when adminpass is wrong.

03: Typo in Playervars: GetPlayerVar();

OLD: IPAdress
NEW: IPAddress

OLD: DecimalIPAdress
NEW: DecimalIPAddress

04: Added few non-documented PlayerVars to the PlayerVar list
-NumberPlate
-IsHost

05: Undocumented Lapperfunction
-IsNum(); Check if a Playervar or other variable is a numeric value. (Returns 0 or 1)

#Function Fixes:

06: Round(Var,2) : Weird Errormessage when using it with stored Playervars from the database.

07: RemovePrivDelayedcommand() : Weird errormessage when using this function in the OnDisconnect Event.
=================================================
Removed:
=================================================
01: Several Old hardcoded functions for DriftScoreTable and Usertop

closetop();
top();
near();
topqual();
nearqual();
topuser();
nearuser();
drf();
drfqual();
drfnearqual();
drfnear();

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Well ,
As first: according to your avatar, you belong to one of the cracked turkish Community (Osmanligarage or Drift Hane) This is reported to the devs weeks ago. But these community's are still active in demo(Where they advertise to theire cracked servers) Good job devs.
Second: You lied about some code that wanst yours
Third: Begging doesnt help.

So that means you do not get any help from me.

If other players want to help you , that is theire choice.

Another tip: support this game and get proper help.
Bass-Driver
S3 licensed
after some research, i have found the working PlayerVar.

Its 'NumberPlate'.

CASE "!plate":
privMsg("^7Your Numberplate: ".GetPlayerVar($userName,"NumberPlate"));
BREAK;

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
hello,

I have found something in the sourcecode.
But i couldnt find this Playervar in the documents.

So try this.
And let me know if this 'Playervar' works

GetCurrentPlayerVar("Plate");
GetPlayerVar( $userName,"Plate" );

Bass-Driver
S3 licensed
It isnt possible to send someone directly to the pit "SHIFT+P".

but if you want to change the 'kick' command. Find the Sub callback named OnConnectCloseKick( $KeyFlags,$id )

And change the '/kick' in something else, like '/pitlane'.

Sub OnConnectCloseKick( $KeyFlags,$id )
closePrivButton("welc&pos&clos&ref");
cmdLFS("/kick " . GetCurrentPlayerVar("UserName") );
EndSub

Bass-Driver
S3 licensed
First note: you posted in the wrong section
for LFSLapper questions go to: https://www.lfs.net/forum/262-LFSLapper-Development

-Which version do you use?

To store/retreive driftscores/laptimes, you have to change the $DefaultTopCar

Open LFSLapper.lpr (Bin/Default/LFSLapper.LPR)

Check attachment for info.
Bass-Driver
S3 licensed
and?
Did you fixed the buttons? Do they work now?

Please give us more information about the work you have done.
Otherwise it will be a endless thread.
Bass-Driver
S3 licensed
So every command you type must be shown to the players?

The code should work, if you want to display the text someone typed.
OpenGlobalButton( "mensajeadmin1",63,30,79,12,4,5,23,"" );
What is 23? should be 32? (Dark button)
Bass-Driver
S3 licensed
This is a code sample how to create a loop within a Sub routine.
With displaying your current speed.



<?php 
###################################
#Event triggered when lapper start#
###################################
Event OnLapperStart()
    
#Create Global variables
        
Globalvar $Loop_On$Loop_On 0;
EndEvent

#################
#Command actions#
#################
Event 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 )
        
        
#Stop loop & close button for all players
        
CASE "!loopoff":
            
$Loop_On 0;
            
            
#Get list of players sorted by Username
                
$Racers GetListOfPlayers("U");
            
            
#FOREACH Loop
                
FOREACH( $Var IN $Racers )
                    
closeButton$Var["value"], "speed");
                ENDFOREACH
        BREAK;
        
        
#Start loop
        
CASE "!loopon":
            
$Loop_On 1;
            
globalmsg("execute sub Set_Loop()");
            
Set_Loop(); #Goto Set_Loop Sub-routine
        
BREAK;

    ENDSWITCH
EndEvent

Sub Set_Loop
()
    IF (
$Loop_On == 1THEN
        
#Get list of players sorted by Username    
        
$Racers GetListOfPlayers("U");                  
        FOREACH( 
$Var IN $Racers #For each player in the server
        #$Var["value"] = Username
            
openButton$Var["value"], "speed",175,124,25,5,5,2,96,"^7" GetPlayerVar$Var["value"], "InstantSpeed") . " " GetPlayerVar$Var["value"], "UnitSpeed")."^8 (".GetPlayerVar$Var["value"], "Car").")");
            
DelayedCommand1Set_Loop); #1 second delay
        
ENDFOREACH
    ENDIF
EndSub
?>


Last edited by Bass-Driver, .
LFSLapper: Code Examples
Bass-Driver
S3 licensed
Hello,

After getting many scriptrequests on PM and ingame. i think creating this thread is a nice idea for new Lapperusers.
In This thread you will find some examplecode that might be usefull for your lapper project.

You can request more code samples in this subforum: https://www.lfs.net/forum/455-General-Support

List of code samples:
Last edited by Bass-Driver, .
FGED GREDG RDFGDR GSFDG