The online racing simulator
LFSLapper List of Functions
(3 posts, closed, started )
LFSLapper List of Functions
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();
Set/Get Playerinfo
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
==================================================
?>

Hello,

I whould like to ask someone who's interested in creating examplecodes/tutorials about several Button functions for LFSLapper.

If you are interested, please send me a PM.

See the buttonfunctions below:


<?php 
#############################################
#Buttons
#############################################


textprivbutton"ButtonID","TEXT OF BUTTON" );
textprivbuttonall();
openprivtextbutton();
opentextbutton();
openglobalbutton();
closeglobalbutton();
openprivbutton();
closeprivbutton();
openbutton();
closebutton();
?>

When the examplecodes are ready, i will overwrite this message
This thread is closed

LFSLapper List of Functions
(3 posts, closed, started )
FGED GREDG RDFGDR GSFDG