The online racing simulator
Searching in All forums
(882 results)
Bass-Driver
S3 licensed
Hello,

As first, you could try to get the users data. You cannot get any info, if the user is offline.
In Lapper there is a function named: GetPlayerInfo();

In the Tutorial section, i have been working on some examplecodes for several functions.
Check the link below about some codes for:


#getplayerinfo(); : Get playerinfo:
#SetPlayerVar(); : Set PlayerVars:
#GetPlayerVar(); : Get PlayerVars:
#setcurrentplayervar(); : Set PlayerVar
#getcurrentplayervar(); : Get PlayerVar

https://www.lfs.net/forum/post/1921131#post1921131

also, checkout the Adminnotify script of Yisc[NL]

https://www.lfs.net/forum/post/1909625#post1909625
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
The startlightcontrol() function exist since version 7.0.4.0


-Be sure you have optimised all objects in autocross editor
-Check the ERR files for any errors.(Bin/Default/Logs/XXX.XXX.XXX.XXX-YYYYY-ERR.txt)

try this instead:

PrivDelayedCommand();

Sub cl($keyflags)
Endsub
Sub cl2($keyflags)
EndSub

Bass-Driver
S3 licensed
You must add the case command in the OnMSO( $userName, $text ) event

Should look like this:

Event OnMSO( $userName, $text ) # Player event

$idxOfFirtsSpace = indexOf( $text, " ");


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

SWITCH( $command )

CASE "!1":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
startlightcontrol (5,149,1,1);
HostDelayedCommand( 3,cl);
ENDIF
BREAK;

ENDSWITCH
EndEvent


Sub cl()
openGlobalButton( "winner_title",78,137,63,19,4,3,3,"READY ");
startlightcontrol (5,149,1,2);
HostDelayedCommand( 3,cl2);
EndSub

Sub cl2()
openGlobalButton( "winner_title2",78,137,63,19,4,3,3,"GO ");
startlightcontrol(5,149,1,8);
EndSub

Bass-Driver
S3 licensed
I think you are looking for this:

https://www.lfs.net/forum/thread/64558

If so , this addon is already added in LFSLapper.

EDIT: @num13er

Please create a for each question a new topic.
But before you create a new topic , Use the search function on this forum first.
Why? There are many examples/scripts that can help you with lapper.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
yes exacly Thumbs up
Bass-Driver
S3 licensed
something like this?

look only to the startlights.

https://www.lfs.net/forum/post/1919394#post1919394
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
LFSLapper has his own databases.

There are 3 types of databases.
  • - Driftscoring: PBdrift.dbs
  • - PB laptimes: gripDB.dbs
  • - Lapper scripts to save User variables: storedvalue.dbs
Topics how to save/load user variables to/from the 'storedvalue' database.
https://www.lfs.net/forum/thread/71158
https://www.lfs.net/forum/thread/90475
Bass-Driver
S3 licensed
New Testversion:

-This version contains a new Lapperfunction: trackuserdistance();
-This version contains everything from the first testversion


With this function you can display the distance between 2 players or between a other location and a player.
See some examples below.

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

There is a testcommand in LFSLapper.LPR you can test.
This command will look like this.


<?php 
CASE "!tud":
    
$TheLocation "-150:26"# X : Y (BL1 at the parking behind the pitlane)
    
privmsg("^8Distance between ^3The location^8 & ^3" .$userName."^8 = ^2"trackuserdistance($TheLocation,$userName). " ^8meters");
BREAK;
?>

EDIT:
===========================================================
===========================================================
i'm thinking to change the Values of the addobject() and removeobject() functions

To add 2 objects the current function looks like this:


<?php 
addobject
($X,$Y,$Z,$Flag,$Type,$Heading#object 01
          
$X,$Y,$Z,$Flag,$Type,$Heading#object 02
?>

I might gonna change it to:

<?php 
$Cone
=       $X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;
$Cone_two=   $X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;
$Cone_three$X.":".$Y.":".$Z.":".$Flag.":".$Type.":".$Heading;

addobject($Cone,$Cone_two,$Cone_three);
?>

Let me know , what you think about this idea

Any feedback whould be nice
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Update : New Lapperfunction (still work in progress)

Track distance between users or objects.

Example of function:

<?php 
==================================================
#Track distance between players.
TrackUserDistance($userName,$userName);

#Track distance between objects or object<>player

$CarShop "-465:234" #(X | Y)
TrackUserDistance($CarShop,$userName);

#Lets say the distance between the player and the carshop is 10 meters

privmsg("Distance between you and the carshop:" .TrackUserDistance($CarShop,$userName). " meters");

outputDistance between you and the carshop10 meters
==================================================
?>

Todo list:
  • -Detection between object/username
  • -Args detection , Function must contain 2 values otherwise return error message
  • -Object X & Y value detection, when 1 value is missing, return error message
Last edited by Bass-Driver, .
Set/Get Playerinfo
Bass-Driver
S3 licensed
List of Playervars: https://www.lfs.net/forum/post/1305877#post1305877
You can also create your own playervars. See the example codes below.

<?php 
##################################################
#getplayerinfo() : Get playerinfo: 
#You can use this in an Event or a Sub:Sub subname($userName)
##################################################
$currPly getplayerinfo($userName );
$currPlyidOfVar ];
==================================================
    
$CurrPly GetPlayerInfo$userName );    # Set var to get playerinfo
IF( $CurrPly["userName"]  != "" THEN    # Retrieves data from the player.
   #Retrieves player Var Nickname and Username
   
privmsg("Nickname: "$CurrPly["nickName"]."/ Username:(".$CurrPly["userName"].")" ); 

   
#Output
   
outputNicknameNicknameUsername:(Username)

   
#Set PlayerVar
   
$CurrPly["playervar_one"] = 12;       # Set a player Var
   
privmsg("Playervar: ".$CurrPly["playervar_one"]);

   
#Output
   
outputPlayervar12
ELSE
   
privmsg("Player is not in the server");
ENDIF
==================================================


##################################################
#SetPlayerVar() : Set PlayerVars:
#GetPlayerVar() : Get PlayerVars:  
##################################################
SetPlayerVar($username ,"idOfVar"$Value);
GetPlayerVar($username ,"idOfVar");
==================================================
SetPlayerVar($username ,"VarOne"23);

privmsg("Value of this playervar: ".GetPlayerVar($username ,"VarOne"));
outputValue of this playervar23
==================================================


##################################################
#setcurrentplayervar(); Set PlayerVar 
#getcurrentplayervar(); Get PlayerVar 
##################################################
Setcurrentplayervar("idOfVar"$Value);
Getcurrentplayervar("idOfVar");
==================================================
Setcurrentplayervar("VarOne"20);

privmsg("Value of current playervar: ".Getcurrentplayervar("VarOne"));
outputValue of current playervar20
==================================================
?>

Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
nice layout, Keep up the good work.

I have load the layout on the '[LFSLapper]Development' server.
So for the one who's interested in driving the layout.
Feel free to join
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Nice nice,
Keep up the good work
LFSLapper List of Functions
Bass-Driver
S3 licensed
Hello,

In this thread you will find a list with functions that are available in LFSLapper.
Also there will be examplecodes available soon.

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

Helpnote:
If you know something about LFSLapper and you have used one of these functions before. I want to ask you to send me some examplecodes that i can add in this thread.



========================================
#List of LFSLapper functions
========================================

#############################################
#Buttons
#############################################
  • textprivbutton( "ButtonID","TEXT OF BUTTON" );
  • textprivbuttonall();
  • openprivtextbutton();
  • opentextbutton();
  • openglobalbutton();
  • closeglobalbutton();
  • openprivbutton();
  • closeprivbutton();
  • openbutton();
  • closebutton();
#############################################
#Set/Get Playervars Goto tutorial
#############################################
  • getplayerinfo();
  • setplayervar();
  • getplayervar();
  • setcurrentplayervar();
  • getcurrentplayervar();
#############################################
#Get/Set database stored values
#############################################
  • setuserstoredvalue();
  • setuserstorednum();
  • getuserstoredvalue();
  • getuserstorednum();
  • setstoredvalue();
  • getstoredvalue();
  • getstorednum();
  • deletestoredvalue();
  • deleteuserstoredvalue();
#############################################
#Sending messages
#############################################
  • privmsg();
  • globalmsg();
  • #Race messages
  • privrcm();
  • globalrcm();
#############################################
#Delayed commands
#############################################
  • removeprivdelayedcommand();
  • privdelayedcommand();
  • removehostdelayedcommand();
  • hostdelayedcommand();
  • removedelayedcommand();
  • delayedcommand();
#############################################
#Set/Remove Zone/Nodes
#Sub will be executed when a player drives throught the Node/Zone you have set
#############################################
  • registernodeaction();
  • removenodeaction();
  • registerzoneaction();
  • removezoneaction();
#############################################
#Timed actions
#Sub will be executed after a amount of time that you have set
#############################################
  • registerscheduleaction();
  • removescheduleaction();
#############################################
#Converting
#############################################
  • numtomsh();
  • numtoms();
  • mshtonum();
  • tokph();
  • tomph();
  • toupper();
  • tolower();
  • sqrt();
#############################################
#Remove records from Database
#############################################
  • deletedriftrecords();
  • deletelaptimerecords();
#############################################
#String Functions
#############################################
  • Insert();
  • Contains();
  • Remove();
  • Replace();
  • substr();
  • trim();
  • indexof();
  • splittoarray();
  • inarray();
  • split();
  • strformat();
  • strlen();

<?php 
================================================================================
#File Functions
================================================================================            
#Create a file
    
CreateFile$FileName$Directory$Action);
    
#Read File (Creates a array)
    
ReadFile$FileName$Directory$Extension);
    
$LinesofFile ReadFile$FileName$Directory$Extension);
    
$NrOfLines $LinesofFile["NumberOfLines"];    
    FOR ( 
$i 0$i $NrOfLines $i $i 1)
        
$Lin $LinesofFile[$i,"Line"];                                    
    ENDFOR
#Delete File
    
DeleteFile$Filename$Directory$BackupFolder$Extension);
    
#Edit File
    
EditFile$FileName$Directory$Text$LineToEdit$Extension);
    
#File Exist
    
IF ( FileExist$Directory$FileName$Extension) == 1THEN
        
#Your code when file exist
    
ENDIF
?>

#############################################
#NOT PLACED IN A GROUP YET
#############################################
  • currentplayerlfsworldpb();
  • currentplayerlfsworldpbfrom();

  • #TopTables
  • getlisttopdrift();
  • getlisttopuser();
  • GetListTop();

  • cleanspb();
  • showspb();

  • dstatsqual();
  • dstats();
  • #PlayerSettings
  • myconfig();
  • http();
  • sort();
  • moveusertogroup();
  • getlistofusersgroup();
  • usergroupfromfile();
  • usergrouptofile();
  • removeuserfromgroup();
  • cleargroup();
  • userisadmin();
  • userisserveradmin();
  • useringroup();
  • getusergrippb();
  • getuserdriftpb();

  • showhand();
  • lapperversion();
  • stats();
  • toplayerunit();
  • langtranslate();
  • langengine();
  • forcerotation();
  • termlapper();
  • groupcmdlfs();
  • cmdlfs();
  • setlicense();
  • setracegrid();
  • requestreo();
  • getlistofplayers();
  • getlappervar();
  • getconfigvar();
  • setconfigvar();
  • getlongtrackname();
  • getlengthtrack();
  • getgrouptrack();
  • getexttrack();
  • reload();
  • crash();
  • getlistoflang();
  • getlistofplayerbuttons();
  • striplfscolor();
  • getwr();
  • startlightcontrol(); #Control light of all autoX startlights or TrackStartlights
  • joinrequest(); #(re)Spawn players
  • allowedplayercars();
  • round(); #Round Numbers
  • tostring(); #Convert Var to a string
  • tonum(); #Convert Var to a number
  • not();
  • unset();
  • return();
  • write(); #write line to console
  • writeline(); #write newline to console
  • dumpvar();
  • arraycount();
  • randomnum();
  • isregexmatch();
  • mod();
  • isnum(); #check if value is a number
  • addobject();
  • removeobject();
  • trackuserdistance();
  • RegisterStreetAction();
Last edited by Bass-Driver, .
SpawnScript - V0.1
Bass-Driver
S3 licensed
Hello Everyone,

Since releasing the LFSLapper version with the JRR insimpacket, i decided creating this spawnscript for public release. https://www.lfs.net/forum/post/1909952#post1909952
But since i have been working on other lapper projects, i havent spend any time on this script.

Now i'm pleased to release the first "working" version.

Note: this script is only usefull if you want to respawn a player to a another location.

Features:
  • -Spawn other players
  • -Add/Remove locations (Go to the location that need to be stored)
  • -Set heading of the car
  • -Select type of spawn (Repair/Not repair)

###############################
#HOW TO INSTALL THE ADDON
###############################

-Be Sure you have the latest version of LFSLapper: https://www.lfs.net/forum/thread/58433-Release.
-Copy and Paste the 'SpawnSystem' folder into the Includes Folder. (\bin\default\includes)
-Open the "addonsused.LPR" file (\bin\default\includes\addonsused.LPR) and add the following lines:
  • include( "./includes/SpawnSystem/SpawnSystem.lpr");
To open the spawnmenu ingame: Type !spawn

Have Fun.
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Quote from A z :


Hello again

i just update the lapper and take the script and its work but ..

the problem the player after sign in the cars stay disable

can i disable the cars for the players who did not sign in ?
after sign in can show the cars ?

and thank you again <3

Questions:

-What kind of script are you using?
-Why disabling cars if you could kick the user from the server?

To disable/enable Playercars: https://www.lfs.net/forum/post/1920550#post1920550

The problem you might have, is that the developer of the script you are using, need to be edited. Which takes some time.
Bass-Driver
S3 licensed
After restarting LFS multiple times, the server is still there. Also the server is not shown in the LFSWorld serverlist.
Bass-Driver
S3 licensed
Maybe not the right topic but.

I have found a server, and while trying connecting to it. it says that the server cannot be found on the masterserver.

it is the same thing like : https://www.lfs.net/forum/post/1915071#post1915071

I have asked other people aswell to find this server in the serverlist. And they face the same issue.
Is there a new crack/Pereulok around??
Connect & Disconnect , Joining & Leaving the race
Bass-Driver
S3 licensed

<?php 
=========================================================
# OnConnect( $userName )
=========================================================
Event OnConnect$userName #Player joined the server
      
privmsg("^3Welcome ".GetPlayerVar($userName,"NickName")." ^8(".$userName.")"); #Send private message to user
      
globalmsg("^3>".GetPlayerVar($userName,"NickName")." ^8(".$userName.") ^7joined the server"); #Send private message to user
EndEvent

=========================================================
# OnDisConnect( $userName, $reason )
=========================================================

#It is not possible to show the nickname in the OnDisConnect event. That because the user is already disconnected before the event is executed
Event OnDisConnect$userName$reason #Player left the server
    
IF( $reason == LEAVR_DISCO THEN  #Normal Disconnect
        
globalmsg("^7User disconnected: ".$userName); #Globalmsg()
    
ENDIF
    IF( 
$reason == LEAVR_LOSTCONN THEN #Lost connection
        
globalmsg("^7User lost connection: ".$userName);
    ENDIF
    IF( 
$reason == LEAVR_KICKED THEN #User Kicked from server
        
globalmsg("^7User kicked: ".$userName);
    ENDIF
    IF( 
$reason == LEAVR_BANNED THEN #User Banned from server
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_TIMEOUT THEN  #Lost connection (Lag)
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_SECURITY THEN #Cheat protection
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_CPW THEN #Cheat protection
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_OOS THEN #Out of Sync With Host (mods)
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_JOOS THEN  #join OOS (initial sync failed)
        #Blah
    
ENDIF
    IF( 
$reason == LEAVR_HACK THEN #Invalid Packets
        #Blah
    
ENDIF
EndEvent

=========================================================
# OnNewPlayerJoin( $userName )
=========================================================

Event OnNewPlayerJoin$userName #Player joined the race
    
globalmsg("^3>".GetPlayerVar($userName,"NickName")." ^7joined the track with ^8(".GetPlayerVar($userName,"Car").")");#Display message about the car of the user
EndEvent

=========================================================
# OnLeaveRace( $userName )
=========================================================

Event OnLeaveRace$userName #Player left the race (Spectate or Pit)
    
globalmsg("^3>".GetPlayerVar($userName,"NickName")." ^7left the race");
EndEvent
?>


Bass-Driver
S3 licensed
EDIT: MADE THIS POST TO LATE

Hello,

It is possible to disable cars for each player.
  • First you have to download LFSLapper V7.0.4.4

  • -Look for the following Event (Onconnect) in the LFSLapper.LPR
    this event will execute everytime when a new player connects to the server.
Event OnConnect( $userName ); #Player joined the server
EndEvent
  • Than add the lines of code into the event:

$Cars = XFG+XRG+FBM; #Cars that will be allowed for this user.
AllowedPlayerCars($UserName,$Cars); #Function that set the allowed cars for this user
  • Your event shall look like this
#Note: this is just an example

<?php 
Event OnConnect
$userName ); #Player joined the server
      
$Cars XFG+XRG+FBM#Cars that will be allowed for this user.
      
AllowedPlayerCars($UserName,$Cars); #Function that set the allowed cars for this user     
EndEvent
?>


Bass-Driver
S3 licensed
Small update:

Today i have made the design for the Qualifyinglist.
The connection between the Judgebox and Bracketlist still need to be coded.
[Project]Qualifying / Best 16 (1vs1)
Bass-Driver
S3 licensed
Hello,

I have start working few months ago on an idea that might be usefull in couple of events for drift/rally or other 1vs1 event, also as a request from a driftteam.

At the moment, ive made a working script for the Best 16 brackets. The Qualification window + judgebox still need to be build.

video of the Best 16 brackets: video

Changelog:

======================================
Version: 0.01
======================================
-Judgebox
- Select between Qualification and 1vs1 mode
- Check username if he/she is in the server.
- Open judgebox with pass (!judgebox <pass>)
- Extra check to see if you have been set as judge
- Set the run/round
- Set Add/remove points for driver 1 and driver 2
- Refresh button when other judge changed something

-DriversBar (1vs1 mode for now)
-2 Drivers
-Drivers Nicknames
-Points for each drivers.

-Global
-List with commands
-Add a judge !addjudge <username> (Only for judges)
-Commands to enable/disable "1vs1comp" mode (looking for a better name for this addon)
======================================
#Version: 0.02
======================================
-Judgebox
-Saving 2 drivers
-Few checks to load the next pair of drivers ( Save score/Next run/Next driver + "Are you sure" question)
-Driver Reset Button

-DriversBar
-Also Available in qualify mode
-Minor design change

-QualifyingList
-Converting from SignUp List (TextFile) to qualifying list (TextFile)
-PlayerInfo from qualifyinglist( Car/Points/Name etc) loaded into Array (For faster loading)
-Each new driver will be added to the list.
-Check online/offline playerstatus
-File saved when Lapper reboots or crashed.

-Global
-Minor bugfixes

#######################
#TODO LIST
#######################
-Admin:
-Change Layouts(Extra LFSLapper sourcecode)
-Select Run scores (max of 3/avg of 3/total of 3)
-Judgebox
-Click on driver instead of entering username
-Load username automaticlly from Qualify
-QualifyingList
-Updating info
-Ranking

-SignUp window
-Best 16 calculation: Pick best 16 players with the highest scores from Qualifyinglist.
-Sqlite3 connecting to website No idea how.

I'm also working on a Rally/Timeattack addon for someone. LFS [PS]Realistic Rally with insim Facebook page
Last edited by Bass-Driver, .
Bass-Driver
S3 licensed
Well i have found 5 servers, which are advertising cracked LFS Content.

DRIFT HANE >CLAN
DRIFT HANE >DRIFT
DRIFT HANE >GEZINTI
DRIFT HANE >S2 << this one is cracked (not showing in the LFS Master serverlist)
DRIFT HANE >TWEAK

I have found the cracked S2 server in the LFSLapper registered Servers.
http://www.frh-team.net/reglapper/
Bass-Driver
S3 licensed
Lucky the insim they are using is LFSLapper. And LFSLapper doesnt contain the insimpacket that get IP data from joined players (IS_NCI // New Conn Info).
Server Team Kaboos TC
Bass-Driver
S3 licensed
Hello,

Maybe this an useless thread. If it is , please delete this thread.

Today i joined one of the "Server Team Kaboos TC" servers.

And a message popped up when i joined the server about that the server is being hacked or something. Maybe this is a joke or not. And dont get rid of the messages, so it is not very player friendly.

I have tried to find a website or something about this team but couldnt find anything.

See the attachment of the messages i got.
Last edited by Bass-Driver, .
OnLapperStart()
Bass-Driver
S3 licensed
OnLapperStart(); Event triggered when LFSLapper starts

In this event you set GlobalVars, these vars will be static and you use them for all your Lapperscripts, until you change them.


<?php 
=====================================
#Examplecode: using GlobalVars
=====================================
Event OnLapperStart();

    
GlobalVar $UserNotWelcome;
    
$UserNotWelcome "Bass-Driver";

EndEvent

#Event when a player joined the server (this event will be explained in a another post)
Event OnConnect$userName ); #Player joined the server

    
IF ($userName == $UserNotWelcome
    
THEN

      privmsg
("^1You are not welcome in this server!"); #Send private message to user
      
privmsg(GetPlayerVar($UserNotWelcome,"NickName")."^8(".$UserNotWelcome.") ^1is not welcome in this server!"); #Send message to everyone
      
cmdLFS("/kick "  $UserNotWelcome ); #kick user from the server

    
ELSE

      
privmsg("Welcome ".GetPlayerVar($userName,"NickName")); #Send private message to user

    
ENDIF

EndEvent
?>


FGED GREDG RDFGDR GSFDG