The online racing simulator
Searching in All forums
(879 results)
Bass-Driver
S3 licensed
Thank you,

Some functions were created for the TimeAttack addon in the beginning of this year. And since then, i didn't do much on LFSLapper.
I had figure out where to add new functions etc LOL.

The biggest challenge was displaying the buttons in the garagemenu.
Adding new parameters breaks all buttonfunctions. So that is a nogo.
So i came up with manipulating the BStyle value. Its working, but i prefer a new parameter that you could set 1 or 0.
Release: LFSLapper V7.0.9.4
Bass-Driver
S3 licensed
Hello Lapperusers,

Here's a new version of LFSLapper that contains multiple new features.
Some of the features require LFS Version D50 or higher(Client and Host)

See the summary of changes below.

See you on the track.


+---------------------------------------------------------------+
|Changes from 7.0.9.3 to 7.0.9.4
+---------------------------------------------------------------+
=================================================
New:
=================================================
1: New Discord Feature MentionDiscordUser()

$DiscordChannelID = "123456789";
$DiscordUserID = "123456789";

MentionDiscordUser($DiscordChannelID,$DiscordUserID);

2: New Function: GetListOfDirectories();

#Get list of directories
$ListOfDirectories = GetListOfDirectories("");

#Get NumberOfDirectories
$DirCount = $ListOfDirectories["NumberOfDirectories"];

#Get through all the directories
FOR($i = 0; $i < ToNum($DirCount); $i = $i + 1)

$NameOfDir = $ListOfDirectories[$i,"DirName"];
$CreationDateOfDir = $ListOfDirectories[$i,"DirCreated"];
$LastAccessedOfDir = $ListOfDirectories[$i,"DirAccessed"];

privmsg("NameOfDir: ".$NameOfDir);
privmsg("CreationDateOfDir: ".$CreationDateOfDir);
privmsg("LastAccessedOfDir: ".$LastAccessedOfDir);

ENDFOR

3: New Function: SetPlayerHandicap(); LFS Version (Client & Host) D50 or higher
Set handicaps for multiple players at once, only when the player is On Track

UserName are capital sensitive.
Mass value 0 - 200
Intake value 0 - 50

SetPlayerHandicap("UserName1:Mass:Intake,UserName2:Mass2:Intake");
SetPlayerHandicap("Bass-Driver:200:50,finland69:100:10");

4: New Function: GetListPlayerHandicap(); LFS Version (Client & Host) D50 or higher
This function executes Event: OnPlayerHandicap(), see below

5: New Event: OnPlayerHandicap(); LFS Version (Client & Host) D50 or higher

#Event will execute when the players handicap has been changed by command or by insim: SetPlayerHandicap()
#LFS Commands:
#/h_mass username X - set added mass for user's car
#/h_tres username X - set restriction for user's car

#$userName = Username of player
#$Flags: 1 = Mass Changed
#$Flags: 2 = Intake Changed
#$Flags: 3 = Both Handicaps Changed

$H_Mass = Current value mass
$H_Tres = Current value Intake restriction

Event OnPlayerHandicap( $userName,$Flags,$H_Mass,$H_Tres) # Player event
globalmsg("Handicap has been changed");
globalmsg("UserName: ".$userName);
globalmsg("Flags: ".$Flags);
globalmsg("Intake Res: ".$H_Tres);
globalmsg("Mass: ".$H_Mass);
EndEvent
=================================================
Update:
=================================================
1: New buttonfunction: Display button in garage.
I've been looking to display the button in the garagemenu
I think its a nice workaround without breaking the buttonfunctions.

Type the number 255 to the ButtonStyle parameter to display the button in the garage.

Example:

openPrivButton( "test",50,60,100,15,0,-1,32+64+255, "Test" );

=================================================
Fix:
=================================================
1: Potential fix for LFSlapper crash when modsystem isnt available from LFS.net

=================================================
Known Issues:
=================================================
1: No encoded characters in (clickable) textbuttons


EDIT: New LFSLapper.exe without debuglines.
https://www.lfs.net/forum/post/2067050#post2067050
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Do the new commands require a new hostversion?

/h_mass username X - set added mass for user's car
/h_tres username X - set restriction for user's car
/teamarrows=no/yes - arrows on non-race small map use name colour

Because i get unknown commands by all of them.
And was adding some LFSLapper functionality with the new ISP_PLH insimpacket.
But cannot test it.
Bass-Driver
S3 licensed
V7.0.8.1

Just stop playing on the illegal version of LFS. And play the legitimate
version of LFS. The chance of support is mugh higher.
Bass-Driver
S3 licensed
you can copy unicode characters into LFS and any texteditor with UTF-8
that should work

7.0.8.0 is just outdated. That version doesnt have MOD support.
Bass-Driver
S3 licensed
You can use the getangle() function.

it calculates the angle between you and the object/location based on the X&Y coords.

Example:
$GetAngleInDegrees = GetAngle($userName,"-387:-635");

IF((ToNum($GetAngleInDegrees) > 80)&&(ToNum($GetAngleInDegrees) < 120))THEN
privmsg(>>>);
ENDIF

Bass-Driver
S3 licensed
In lfslapper.lpr an event named: OnExitPitLane.This event will be executed when someone drives to the end of the pitlane.

within this event add:

cmdLFS( "/p_clear " . GetCurrentPlayerVar( "UserName" ));

Bass-Driver
S3 licensed
Nah, i forgot to delete the include() line in addonsused.LPR during release. Which contains lfsrestapi_info.lpr.
I've used that script during the implementation of the modsystem.

So you can delete that include() line.
Bass-Driver
S3 licensed
Sorry to interrupt the chat.

@ F. Leterme

I've joined the server you are in, which is [PNR] Blackwood GTI
Is this server yours?

-It's defined as a S1 licensed server, which doesn't have mod support. Must be a S3 licensed server.
-You use LFSLapper V 7.0.9.1, which is not the latest but, should be fine with mods.
-You use Schedule V2.09, which is not the latest version of the Yisc[NL] Schedule script, this version does not have mod support.

-Make sure you load the latest version of Yisc[NL] Scripts.
-Allow mods on your server.

IF LFSLapper crashes.

Try to make a screenshot of the LFSLapper console when it crashes.
Copy the last error from the 123.456.789.000-XXXXX-ERR.log (bin\default\logs)
Bass-Driver
S3 licensed
to which version of LFS, you want connect the insim to?
Insim v9 doesn't work on 0.6R

It only works on 0.7A and newer.
Bass-Driver
S3 licensed
Well, you start the app 'Anti ddos guardian' and LFSLapper stopped working.

What do you think what happenend?
Bass-Driver
S3 licensed
I have no experience with MySQL or any knownledge of databases. Or the time / motivation to work on the LFSLapper source. Even with adding a new database system, it will cost ALOT time to figuring out how to add it within LFSLapper. So its a no for me.
It took already alot of time to add the MOD functionality, which i have no idea how i made it work, even with the help of the awesome lfs community.

But still SQlite is fine for the purposes LFSLapper has to offer. No way to add a another complicated system to LFSLapper which may require an external APP to function.

So there are 3 options
  • You use the current SQLite database and its functionality within LFSLapper.
  • You move to Insim.net library.
  • You add MySQL to LFSLapper yourself , the code is opensource.
Bass-Driver
S3 licensed
It whould nice to add "insim nodes" with ID's (1 - 1024 (or more)) as a option in the AutoX editor.

And send a InsimPacket to the insimapp when someone cross a node.

could look something like this (Probably totally wrong LOL)

struct IS_NOX // Insim Node xTime
{
byte Size; // 15
byte Type; // ISP_NOX
byte ReqI; // 0
byte PLID; // player's unique id

word Node; //Node ID
byte Sp1; //Spare 2
byte Sp2; //Spare 3
byte Sp3; //Spare 4

unsigned Time; // hundredths of a second since start (as in SMALL_RTP)
};

Edit: The AutoX object count need to be increased by uhm ALOT.
For example: i run a timeattack server which has 6 stages. If i want to add 1024 nodes on each stage which is in total 6 * 1024 = 6.144 objects.
Or you need to add a seperate SubObject counter like you have done with the restricted area circles.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Either the ip or port is incorrect.
Check firewall aswell
Bass-Driver
S3 licensed
The discord features should work.
Why you using LFS 6R in the first place.

You cannot use S1/S2/S3 content on 6R aswell because you have a demo account.
Bass-Driver
S3 licensed
Don't see anything obvious.
You must do some test with the values and see cause the crashes.
Bass-Driver
S3 licensed
I do see something in your code, that could be the cause of the crashes.
Its about $Heading.

So my question to you is, to try the 'New Code'

Old Code

<?php 
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
?>

New Code

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

Bass-Driver
S3 licensed
Called joinrequest() on many trackconfigs while going out of bounds and also when being "retired", but i cannot reproduce the crashes.
Also tried differend Heading & Z-Axis values

-Which version of LFSLapper do you use?
-And can you show me the location on the map.
Bass-Driver
S3 licensed
@RealistAdam

In the link below, there is some infomation how to get the ip adress from a connected player. I also explained why you not get an IP after someone is connected. You have to code a delay playerdelayedcommand() to get the IP

https://www.lfs.net/forum/thre ... -when-connected-to-server
  • Player connect
  • 1/2 second delay with playerdelayedcommand().
  • Get IP from player: GetPlayerVar($userName,"IPAddress");
Info about playerdelayedcommand:
https://www.lfs.net/forum/post/2051762#post2051762
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
with posting the values, i ment the value output of certain parameters.

Privmsg("X = ".$X_Axis);
Privmsg("Y = ".$Y_Axis);
Privmsg("Z = ".$Z_Axis);
Privmsg("Heading = ".$Heading);
Privmsg("PLID = ".$PLID);
Privmsg("UCID = ".$UCID);

you get the idea now.
Bass-Driver
S3 licensed
Nice that the code works. But that is just a temporary fix.
i whould like to fix that crash, so i need your values i provided in my post above.
Bass-Driver
S3 licensed
Looking into the sourcecode.
And Joinrequest shouldnt execute when Z value is below 0.
so should be something else.

I need all the values before you call joinrequest().

X-Axis
Y-Axis
Z-Axis
Heading
Flags
PLID
UCID
JRRAction

Also give me the name of the trackconfig and the position where you get "retired". (X and Y axis).
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
if i know the values, i can fix it in the Lapper sourcecode.

as a temporary fix you can try:

IF ( ToNum(GetPlayerVar( $userName, "Z" )) >= 0)
THEN
#Call joinrequest
ELSE
#Something else
ENDIF

Bass-Driver
S3 licensed
Not sure if thats possible within the discordbot. Because i do not send any text to the discordbot like "Playing:"
Need to look into their library to see if thats possible.
Bass-Driver
S3 licensed
As you said, LFSLapper crashes when you are below the map.
So i think the Z value (Height position of the car) might be the problem.

Can you provide me the axis values (X & Y & Z), before you call the joinrequest function.

GetPlayerVar($userName,"X");
GetPlayerVar($userName,"Y");
GetPlayerVar($userName,"Z");

Thanks
FGED GREDG RDFGDR GSFDG