The online racing simulator
Searching in All forums
(966 results)
Gai-Luron
S3 licensed
Hello,

Try to update mono version on your Linux.

LFSLapper work fine on our Linux system. DLL provided are installed in exe directory?

Gai-Luron
Gai-Luron
S3 licensed
closePrivButton ("PlayerList_".$currUserName."_".$i."_remove");

but i think, i don't understand what you want

or Maybe

GlobalVar $arToClose;

$i = 0
...

$arToClose[$i] = "PlayerList_".$currUserName."_".$i."_remove";
openPrivButton ( $arToClose[$i],$top left_x+31,$topleft_y+1,4,5,5,-1,16,"^3X",Remove_Registered);
$i = $i +1;
...

For closing all

$i = 0;
...
$i=$i+1;
closePrivButton( $arToClose[$i] );
...
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
No no i really write groupToArray .

I also include const token to have the ability to define it

Example of use of const

<?php 
const ISB_C1             1        // you can choose a standard
const ISB_C2             2        // interface colour using
const ISB_C4             4        // these 3 lowest bits - see below
const  ISB_CLICK        8        // click this button to send IS_BTC
const  ISB_LIGHT        16        // light button
const  ISB_DARK         32        // dark button
const  ISB_LEFT         64        // align text to left
const  ISB_RIGHT       128        // align text to rightconst 

openPrivButton ("player_".$userName."_".$id."_remove",$topleft_x+6,$topleft_y+1,
25,5,5,-1,ISB_LEFT ISB_LIGHT,"Remove",Remove_Registered)

more clear than

openPrivButton 
("player_".$userName."_".$id."_remove",$topleft_x+6,$topleft_y+1,
25,5,5,-1,80,"Remove",Remove_Registered)
?>

And i provide a set of const for your use, retreived from insim.txt doc of LFS.


EDIT : Shame on me, this funtion already exist : it's getlistofusersgroup. I forgot this. it's Alzheimer, i'm to old
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
You can also in more easy way without having a global $ListOfPlayer ( better limit the use of global if possible).



<?php 
 
...
openPrivButton ("player_".$userName."_".$id."_remove",$topleft_x+6,$topleft_y+1,25,5,5,-1,80,"Remove",Remove_Registered)
...

Sub Remove_Registered$KeyFlags,$receiveId )
    IF (
$receiveId != "")
    
THEN
        $ar 
SplitTOArray(  $receiveId ,"_" );
        
privMsg("DEBUG: uName = " $ar[1] . "; id = " .  $ar[2]);
    ENDIF
EndSub  
?>


In Next Release

groupToArray()
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
SUB TRI_split1_2 it's your add, do you define it and where. it need username in args


Sub TRI_split1_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great1}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split1_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good1}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split2_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great2}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split2_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good2}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split3_0( $userName ) # Player event
globalMsg( langEngine( "%{main_great3}%", NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_split3_1( $userName ) # Player event
globalMsg( langEngine( "%{main_good3}%",NumToMSH(GetCurrentPlayerVar("SplitTime")),GetCurrentPlayerVar("Nickname") ) );
EndSub

Sub TRI_lap_0( $userName ) # Player event
globalMsg( langEngine( "%{main_greatlap}%",NumToMSH( GetCurrentPlayerVar("LapTime") ), GetCurrentPlayerVar("Nickname" ) ) );
EndSub

Sub TRI_lap_1( $userName ) # Player event
globalMsg( langEngine( "%{main_goodlap}%", NumToMSH( GetCurrentPlayerVar("LapTime") ), GetCurrentPlayerVar("Nickname") ) );
EndSub

Gai-Luron
S3 licensed
Hello!

You are right, i add one or two feature that turn in my mind in GLScripting and do this fork.

Gai-Luron
Gai-Luron
S3 licensed
Release 5.9.0.1 beta available for test purpose.

There is a major change in configuration script to allow more flexibility in scripting. Update your main lpr file with new one. All modification to this main file is not a good thing, instead use myInc.lpr to overlap sub or event and catchevent, catchsub to add your feature to an existing main lpr file event or sub in you include files.

Now a script can be added without modify main lpr file
  • All release's include script are modified by myself to use new catch feature, take a look in it to modify you own include script and send me the result if you want include new script in main release
  • Script that are used are now in addonsused.lpr, modify this file to activate or deactivate a script. that's all
  • Add driftmeter.lpr in default release. To activate it go in addonsused.lpr and remove # before the include
  • In the future I only include script that don't modify main lpr file
  • All player event now receive the userName who triggered the event, your old LFSLapper.lpr file is obsolete, modify it or take a freshen version
Sorry for this important modifications, but it's for improve LFSLapper scripting

send me feedback.


+-------------------------------+
|Changes from v5.852 to 5.901 |
+-------------------------------+
1. GetListOfPlayer accept an optional argument to sort the list og player
Example:
$list = GetListOfPlayers("U"); # List sorted by userName
Or
$list = GetListOfPlayers("N"); # List sorted by nickName

2. Fix groupCmdLfs( cmd ); order in other serv

3. Add GLScript command reload() to stop lapper and reload config

4. CatchEvent eventName structure
Add new structure feature, it's offer the ability to define code in this struct
and catch an existing event located in the main lpr file. LFSLapper execute code located
in event then jump to code located in one or more catchEvent. it's very usefull for creating
script without modify the original lpr file.
To add a new functionality to lapper just add include(newScript) at the end
of lpr file and to remove put a # before the include.
newScript must use this CatchEvent.

CatchEvent eventName
...
EndCatchEvent

Example:
CatchEvent OnConnect( $userName )
WriteLine( "OnConnect appended");
EndCatchEvent

Before Event OnConnect( $userName ) is executed then execute code
located into one or more CatchEvent OnConnect( $userName )

5. CatchSub subName --> Same as CatchEvent but for sub
Add new structure feature, it's offer the ability to define code in this struct
and catch an existing sub located in the main lpr file. LFSLapper execute code located
in sub then jump to code located in one or more catchSub. it's very usefull for creating
script without modify the original lpr file.
To add a new functionality to lapper just add include(newScript) at the end
of lpr file and to remove put a # before the include.
newScript must use this CatchSub.

CatchSub mySub
...
EndCatchSub

Example:
CatchSub MySub( )
WriteLine( "MySub appended");
EndCatchSub

Before Sub MySub( ) is executed then execute code
located into one or more CatchSub MySub( )

6. Add userName in args passed to event player
OnMSO,OnAuthAllowed,OnAuthNotAllowed,OnAuthReached,OnSwearWords1
OnSwearWords2,OnToLowHandicap,OnNotMatchFlags,OnConnect,OnDisConnect
OnSplit1,OnSplit2,OnSplit3,OnLap,OnSpbSplit1,OnSpbSplit2,OnSpbSplit3
OnSpbLast,OnFlood,OnMaxSessionLaps,OnAngleVelocity,OnMaxNbInStunt
OnMaxAllowedLapTime1,OnMaxAllowedLapTime2,OnIdle1,OnIdle2,OnDriftPB
OnDriftLap,OnDriftScore,OnPB,OnPBQual,OnAcceleration,OnBeginPit
OnEndPit,OnPit,OnNotPitWindow,OnBeginPitWindow,OnEndPitWindow
OnFastDriveOnPitL1,OnFastDriveOnPitL2,OnMaxFastDriveOnPit,OnFalseStartL1
OnFalseStartL2,OnLeaveRace,OnDriftTooLow,OnGoodDrift,OnNewGapPlayerBehind
OnNewGapPlayerBefore,OnNewPlayerJoin,OnChangeTyres,OnFinish,OnResult
OnCarReset,OnMaxCarResets,OnExitPitLane,OnEnterPitLane,OnNameChange

7. Patch to allow storing data as another user. I.e: ( krayy )

SetUserStoredValue( "hmass", GetPlayerVar($uName,"h_mass"));
OR
SetUserStoredValue( $uName, "hmass", GetPlayerVar($uName,"h_mass"));

GetUserStoredValue( "hmass" );
OR
GetUserStoredValue( $uName, "hmass" );

8. Fix SQL error when userName have a single-quote (') in it in PB, Drift and stored

9. Add new GLScript function SplitToArray, this function allow splitting a string by a split char and put result into array

Example:
$tosplited = "Un,Deux,Trois,Quatre";
$splites = SplitToArray( $tosplited,"," );
WriteLine( "The result for pos 2 is " . splites[1] );
FOREACH( $val IN $splites)
WriteLine( "Val = " . $val["value"]);
ENDFOREACH

Result on Screen
The result for pos 2 is Deux
Val = Un
Val = Deux
Val = Trois
Val = Quatre

Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Hello,

Okay, my mistake, i fix for the next Release. It's a lowercase case issue in N

use for Now before my next release ( soon )

GetCurrentPlayerVar("UnameBefore") the N is in wrong Lowercase in you LFSLapper beta version.

Sorry!

Gai-Luron
Gai-Luron
S3 licensed
Okay , when i read split, i think about LFS splitting, not the split command. It's for this i don't understand what you say.

You are rigth, i do it ASAP : SplitToArray

Thank's

Gai-Luron
Gai-Luron
S3 licensed
Quote from Krayy :Ahhhh...I wondered ...

Let me know if my "suggestions" start get annoying

No no problem you can continue, it's a better way to learn on how work Lapper. If i don't want suggestions, i don't release source and i make a "closed" app. you can't know everything on Lapper, me too i forgot many things on LFSLapper and some user know my app better than me

Gai-Luron
Gai-Luron
S3 licensed
Hello,

Can you give me an example, i don't understand what you say
Gai-Luron
S3 licensed
Ok thank's i have what i nedd to correct this issue.

Gai-Luron
Gai-Luron
S3 licensed
Reference language guide
Gai-Luron
S3 licensed
Qualification feature
Gai-Luron
S3 licensed
Upload Feature
Gai-Luron
S3 licensed
Web connectivity

When you send a request to a web server LFSLapper attemps to receive a GLScript code and execute it.

Example
You send a request to know if player is allowed, http("http://www.demourl.nl/lfs_plugin.php?u=". GetCurrentPlayerVar("UserName") );
and GetCurrentPlayerVar("UserName") -> "gai-luron"

web response can contain this glScript lines:

$allowed = 1;
$userName = "gai-luron";
doMyCode( $userName,$allowed );

OR

doMyCode( "gai-luron",1 );

LFSLapper interpret this GLScript code and in this code you can see you have a call to subroutine. This subroutine can be declared in lpr file.

In you lpr file tou have:
SUB doMyCode( $userName,$allowed )
... Do what you want if lpr file
IF( $allowed == 0 ) THEN
cmdlfs( "/kick " . $userName );
ELSE
privMsg("Allowed");
ENDIF

ENDSUB

And other way is to put all code in the returned webcommand
Request = http("http://www.demourl.nl/lfs_plugin.php?u=". GetCurrentPlayerVar("UserName") );

Returning web commands if allowed:

privMsg("Allowed");

Returning web commands if not allowed:

cmdlfs( "/kick gai-luron");

Gai-Luron

PS: You can put any GLScript command in returned web, like top(), topuser(), etc...
Last edited by Gai-Luron, .
Gai-Luron
S3 licensed
Multi Language management
Gai-Luron
S3 licensed
Replacing Event or Multiple catching event
Gai-Luron
S3 licensed
Player Variables in LFSLapper

This can be retreived with function:
GetCurrentPlayerVar( idOfVar )
GetPlayerVar( username, idOfVar )
or
$currPly = getplayerinfo($userName );
$currPly[ idOfVar ];


<?php 
 NickName
,               // nickName of the player
            
NickNameStripped,       // nickName without color code
            
UserName,               // User Name or LFS Name
            
Car,                    // CUrrent car for the player
            
PitWork,                // Work do on car on the pit
            
PlayerFlags,            // Current players control flags
            
PosAbs,                 // Current pos in top in format pos/total
            
GroupQual,              // Current Group qualification if user is in the group qualification -> A,B,C,...
            
PosQual,                // Current pos in qualification in format pos/total
            
UnitSpeed,              // km/h or mph relative t o the player choice
            
UnitDist,               // miles or kms relative t o the player choice
            
Typ,                    // Spb type "PB" server, "Sess" Session, "WR" Worls record
            
Dist,                   // dist for the player in km on this server
            
SessDist,               // dist for the player in km on this session
            
UNameBehind,            // UserName of the player behind you in race
            
GapBehind,              // Gap between you and player behin in Race
            
UnameBefore,            // the username of the player before you in race
            
GapBefore,              // gap between you and the player before you in race
            
OldTyreRearLeft,        // Old Tyre on rear left before pit
            
OldTyreRearRight,       // Old Tyre on rear right before pit
            
OldTyreFrontLeft,       // Old Tyre on front left before pit
            
OldTyreFrontRight,      // Old Tyre on front right before pit
            
TyreRearLeft,           // Current Tyre on rear left
            
TyreRearRight,          // Current Tyre on rear right
            
TyreFrontLeft,          // Current Tyre on front left
            
TyreFrontRight,         // Current Tyre on front right
            
AuthLevel,              // Player authorization level
            
PenaltyNew,             // Player penalty new
            
NumCarResets,           // Number of Car reset
            
Laps,                   // Total number of laps done on the current track and with the current car
            
Pos,                    // current position of the player in top
            
SessLaps,               // Total number of laps done this session on current track and with the current car
            
TotalPitTime,           // Cumuled Time used for a pit stop on session
            
PitTime,                // Time used in Pit
            
PitStops,               // Number of pitstop do by a player in session
            
SwearWordsRem,          // Remaining number of swearwords to be used before OnSwearWords2 is triggered
            
LapsDone,               // Total laps done for player current car/track
            
P_Mass,                 // Current player Mass
            
P_Tres,                 // Current Player  Restriction
            
H_Mass,                 // Current Required Handicap User mass
            
H_Tres,                 // Current Required Handicap Restriction
            
Split1,                 // Last First Split, updated when doing new Split1
            
Split2,                 // Last Second Split, erased when doing Split1
            
Split3,                 // Last third Split, erased when doing Split1
            
LapTime,                // Current Lap Time, erased when doing New LapTime
            
PBLapTime,              // Current PB on current Combo
        
PBDrift,                // Current Drift PB on current Combo
            
DiffLapTimeToPB,        // Laptime - PBLTime, Last PBLTime is new realised
            
SplitTime,              // Last Split time done by player
            
WR,                     // World record for this player Combo
        
PSDistance,            // online statistics of one racer - distance in metres
        
PSFuel,            // online statistics of one racer - fuel burnt in cl
        
PSLaps,            // online statistics of one racer - laps
        
PSHostsJoined,        // online statistics of one racer - hosts joined
        
PSWins,            // online statistics of one racer - Wins
        
PSSecond,            // online statistics of one racer - Second
        
PSThird,            // online statistics of one racer - third
        
PSFinished,            // online statistics of one racer - finished
        
PSQuals,            // online statistics of one racer - quals
        
PSPole,            // online statistics of one racer - pole
        
PSDrags,            // online statistics of one racer - drags
        
PSDragWins,            // online statistics of one racer - drag wins
        
PSCountry,            // online statistics of one racer - country
            
SectorSplit1,           // Last First sector Time, updated when doing new Split1
            
SectorSplit2,           // Last Second sector Time, updated when doing new Split2
            
SectorSplit3,           // Last third sector Time, updated when doing new Split3
            
SectorSplitLast,        // Last Last sector Time, erased when doing Split1
            
BestSectorSplit1,       // Best Split duration for the sector 1
            
BestSectorSplit2,       // Best Split duration for the sector 2
            
BestSectorSplit3,       // Best Split duration for the sector 3
            
BestSectorSplitLast,    // BestSplit duration for the last sector
            
DiffSectorSplit1,       // SectorSplit1 - BestSectorSplit1
            
DiffSectorSplit2,       // SectorSplit2 - BestSectorSplit2
            
DiffSectorSplit3,       // SectorSplit3 - BestSectorSplit3
            
DiffSectorSplitLast,    // SectorSplitLast - BestSectorSplitLast
            
IsBestSectorSplit1,     // 1 if this sector split is best than previous Best, otherwise 0
            
IsBestSectorSplit2,     // 1 if this sector split is best than previous Best, otherwise 0
            
IsBestSectorSplit3,     // 1 if this sector split is best than previous Best, otherwise 0
            
IsBestSectorSplitLast,  // 1 if this sector split is best than previous Best, otherwise 0
            
AvgSpeed,               // Avg Speed on last Lap Time
            
InstantSpeed,           // Instant speed for the player
            
BestSpeed,              // Best Speed done on this combo by player
            
Tpb,                    // Theoretical PB using best sector split
            
DriftScore,             // last Drift score
            
AngleVelocity,          // Last Angle velocity in degrees
            
LastDriftScore,         // Last drift score
            
AccelerationStartSpeed// Min value for the acceleration feature relative to user unit km or mph
            
AccelerationEndSpeed,   // Max value for the acceleration feature relative to user unit km or mph
            
AccelerationTime,       // Acceleration time achieved from start to end speed
            
AccelerationStartSpeed2// Min value for the acceleration feature relative to user unit km or mph
            
AccelerationEndSpeed2,   // Max value for the acceleration feature relative to user unit km or mph
            
AccelerationTime2,       // Acceleration time achieved from start to end speed
            
MaxAllowedLapTime1,     // Max Allowed Time before trigger Event OnMaxAllowedLapTime1
            
MaxAllowedLapTime2,     // Max Allowed Time before trigger Event OnMaxAllowedLapTime2
            
RemainFDIP,             // Remain count for fast drive in pit
            
FinishedPos,            // finish or qualify pos (1 = win / 256 = not added to table)
            
RaceTotalTime,          // race time (ms) the use of NumToMsh is needed
            
RacePBTime,             // race personnal best time in ms the use of NumToMsh is needed
            
CurrNode,               // is the node on the track where the player is, -1 is player is not on track
            
OnTrack,                // 1 if player is on track, otherwise 0
            
X,                      // Coordonate X axis of the player on the map
            
Y,                       // Coordonate Y axis of the player on the map
            
Z,                       // Coordonate Z axis of the player on the map
            
TotDistMeter,            // Session distance in meter done by a player
            
ViewSPBSplit,            // What split PB to Show, S = Session, P = PB, W = World record ( Can be SET )
            
ShowSplitPb,            // Does the split PB iare showed 1 = Yes, 0 = No  ( Can be SET )
            
UnitSpeedKmh,            // What's unit is used for speed and distance 1 = kms 0 = miles  ( Can be SET )
            
IdLang,                    // Id of the player lang  ( Can be SET )
            
Heading,                // Direction of forward axis : 0 = world y direction
            
Direction,                // Car's motion if Speed > 0 : 0 = world y direction
?>

Last edited by Bass-Driver, .
Gai-Luron
S3 licensed
(Catch)Events overview
These events can you use in your scripts.
Every eevent will be closed with EndEvent

If you use the same Event in a another script you have to write CatchEvent/EndCatch event

CatchEvent <Eventname>
EndCatchEvent


<?php 
Event OnAcceleration
$userName );  #Acceleration from 0 to 100
Event OnAcceleration2$userName ); #Acceleration from 100 to 160
Event OnAngleVelocity$userName ); #Driftangle for example
Event OnAuthAllowed$userName );
Event OnAuthNotAllowed$userName );
Event OnAuthReached$userName,$level );
Event OnBeginPit$userName );
Event OnBeginPitWindow$userName );
Event OnButtonFunction($userName$SubT);
Event OnCarReset$userName ); #User Reset Car
Event OnChangePos($userName$lastPos$currPos);
Event OnChangeTyres$userName$FL_Changed$FR_Changed$RL_Changed$RR_Changed );
Event OnConnect$userName ); #User Connect to server
Event OnDisConnect$userName$reason ); #User Disconnect from server
Event OnDistDone$userName );
Event OnDriftLap$userName );
Event OnDriftPB$userName );
Event OnDriftResetScore$userName );
Event OnDriftScore$userName );
Event OnDriftTooLow$userName );
Event OnEndPit$userName );
Event OnEndPitWindow$userName );
Event OnEnterPitLane$userName$reason );
Event OnExitPitLane(  $userName );
Event OnFalseStartL1$userName );
Event OnFalseStartL2$userName );
Event OnFastDriveOnPitL1$userName );
Event OnFastDriveOnPitL2$userName );
Event OnFinish$userName );
Event OnFlood$userName );
Event OnGoodDrift$userName );
Event OnIdle1$userName );
Event OnIdle2$userName );
Event OnLap$userName );
Event OnLapperStart();
Event OnLeaveRace$userName );
Event OnMaxAllowedLapTime1$userName );
Event OnMaxAllowedLapTime2$userName );
Event OnMaxCarResets$userName );
Event OnMaxFastDriveOnPit$userName );
Event OnMaxNbInStunt$userName );
Event OnMaxSessionLaps$userName );
Event OnMSO$userName$text );
Event OnNameChange($userName$oldNickName$newNickName);
Event OnNewGapPlayerBefore$userName$split );
Event OnNewGapPlayerBehind$userName$split );
Event OnNewPlayerJoin$userName );
Event OnNotMatchFlags$userName );
Event OnNotPitWindow$userName );
Event OnPB$userName );
Event OnPBQual$userName );
Event OnPit$userName );
Event OnPracStart$numP );
Event OnQualStart$NumP );
Event OnRaceEnd( );
Event OnRaceStart$NumP );
Event OnREO $NumP$ReqI$GridOrder );
Event OnResult$userName,$flagConfirm );
Event OnRotateCar();
Event OnRotateTrack();
Event OnSpbLast$userName );
Event OnSpbSplit1$userName );
Event OnSpbSplit2$userName );
Event OnSpbSplit3$userName );
Event OnSplit1$userName );
Event OnSplit2$userName );
Event OnSplit3$userName );
Event OnSwearWords1$userName );
Event OnSwearWords2$userName );
Event OnToLowHandicap$userName );
Event OnVoteEndChange($PlayerOnTrack$Vote$Need);
Event OnVoteEndReach($PlayerOnTrack$Vote$Need);
Event OnVoteEndZero();
Event OnVoteQualifyChange($PlayerOnTrack$Vote$Need);
Event OnVoteQualifyReach($PlayerOnTrack$Vote$Need);
Event OnVoteQualifyZero();
Event OnVoteRestartChange($PlayerOnTrack$Vote$Need);
Event OnVoteRestartReach($PlayerOnTrack$Vote$Need);
Event OnVoteRestartZero();
Event OnObjectHit($userName,$ObjectFlag,$ObjectHitTime,$Object_X,$Object_Y,$Object_Z,$ObjectType,$ObjectInDex); #When User hit an opject
Event OnCarContact($PlayerA,$PlayerB,$PlayerA_Speed,$PlayerB_Speed,$PlayerA_X,$PlayerB_X,$PlayerA_Y,$PlayerB_Y); #Collision between 2 drivers
Event OnCrossingChecker($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex);
Event OnCarStateChanged($userName,$StateOfCar#User cars state changed
?>

Last edited by Bass-Driver, .
Gai-Luron
S3 licensed
LFSLapper Functions
  • -getplayerinfo();
  • -openprivbutton();
  • -closeprivbutton();
    openbutton();
    closebutton();
    setracegrid();
    requestreo();
    getlistofplayers();
    setplayervar();
    getplayervar();
    getplayervarbyucid();
    getplayervarbyplid();
    getlappervar();
    getconfigvar();
    setconfigvar();

    #Converting
    numtomsh();
    numtoms();
    mshtonum();
    tokph();
    tomph();
  • -toupper()

    $string = "example";
    $example = toupper($string); $example = "EXAMPLE";


  • -tolower()

    $string = "EXAMPLE";
    $example = tolower($string); $example = "example";


    toplayerunit();
    langtranslate();
    langengine();
    forcerotation();
    termlapper();
    groupcmdlfs();
    cmdlfs();
    setlicense();
    setcurrentplayervar();
    getcurrentplayervar();

    closetop();
    closedrf();
    closetopuser();

    #Sending messages
    privmsg();
    globalmsg();


    cleanspb();
    showspb();
    showhand();
    lapperversion();
    stats();
    dstats();
    statsqual();
    dstatsqual();
    topuser();
    nearuser();
    currentplayerlfsworldpb();
    currentplayerlfsworldpbfrom();

    top();
    near();
    topqual();
    nearqual();

    getlisttop();
    drf();
    drfqual();
    drfnearqual();
    drfnear();
    privrcm();


    #Buttons
    textprivbutton( "ButtonID","TEXT OF BUTTON" );
    textprivbuttonall();
    openprivtextbutton();
    opentextbutton();

    #Delayed commands
    removeprivdelayedcommand();
    privdelayedcommand();
    removehostdelayedcommand();
    hostdelayedcommand();


    myconfig();
    setuserstoredvalue();
    setuserstorednum();
    getuserstoredvalue();
    getuserstorednum();
    openglobalbutton();
    globalrcm();
    closeglobalbutton();
    http();
    moveusertogroup();
    getlistofusersgroup();
    usergroupfromfile();
    usergrouptofile();
    removeuserfromgroup();
    cleargroup();
    userisadmin();
    userisserveradmin();
    useringroup();
    getusergrippb();
    getuserdriftpb();
    setstoredvalue();
    getstoredvalue();
    getstorednum();
    removedelayedcommand();
    delayedcommand();
    getlongtrackname();
    getlengthtrack();
    getgrouptrack();
    getexttrack();
    registerscheduleaction();
    removescheduleaction();
    registernodeaction();
    removenodeaction();
    registerzoneaction();
    removezoneaction();
    reload();
    crash();
    getlistoflang();
    getlistofplayerbuttons();
    striplfscolor();
    getwr();
    startlightcontrol();
    joinrequest();
    allowedplayercars();
  • -substr()

    $string = "example";
    $example = substr( $string,0,3 ); #Start at the begining ( 0) and give the next 3 characters $example = "exa";
    $example = substr( $string,4,2 ); #Start the the 4e character and give the next 2 characters $example = "pl";

  • -trim()

    $string = "example";
    $example = trim( subStr( $string,2 ) ); #Remove the first part of a string to the 2nd character $example = "ample";

  • -round() #Round Numbers

    round( 12.34,1 ) -> 12.3


  • -strformat()

    Add new GLScript function
    strFormat( formatStr,arg1,..,argn );
    example:
    strFormat( "The player {0}, there is actually {1} players on track", GetCurrentPlayerVar("nickName"), GetLapperVar( "nbPlayersOnTrack" ) )

    This function is a very powerfull fonction to format text
    The following table lists format controls supported by the C# String.Format() method together with examples of each control:
    Control Type Description Example
    • C Currency
      Displays number prefixed with the currency simple appropriate to the current locale
      {0:C} of 432.00 outputs $432.00
    • D Decimal
      Displays number in decimal form with optional padding
      {0:D4} of 432 outputs 00432
    • E Exponential
      Displays number in scientific form with optional value for fractional part
      {0:E5} of 432.32 outputs 4.32320E+002
    • E Fixed
      Displays the number including the specified number of decimal digits
      {0:F3} of 432.324343 outputs 432.324
    • N Number
      Converts a number to a human friendly format by inserting commas and rounding to the nearest 100th
      {0:N} 123432.324343 outputs 123,432.32
    • X Hexadecimal
      Converts a number to hexadecimal
      {0: X} of 432 outputs 1B0
      0:0... Zero Padding
      Adds zeros to pad argument
      {0:0000.00} of 43.1 outputs 0043.10
      0:0#... Space Padding
      Adds spaces to pad argument
      {0:####.##} of 43.1 outputs 43.1
    • % Percentage
      Multiplies the argument by 100 and appends a percentage sign
      {0:00.00%} of .432 outputs 43.20%


  • -tostring() #Convert Var to a string
  • -tonum() #Convert Var to a number


  • -not()
  • -indexof()

    <?php 
     
         $NickName 
    GetPlayerVar($UserName"NickName");    
         
    $NickStrip StripLFSColorToLower($NickName) );     
         
    $IdxOfTag indexOf$NickStrip "[LFS]");
        
         IF( 
    $IdxOfTag != -)    #Check if the user has a tag on with [LFS]
         
    THEN    
            WriteLine
    (GetPlayerVar($UserName"NickName")." has a [LFS] tag");  
         ENDIF  
    ?>

  • -splittoarray()


    <?php 
                $tobesplit 
    "one,two,three";
                
    $splits SplitToArray(  $tobesplit,"," ); 
                
    ########################################################

                //Result on screen with a single line

                    
    WriteLine"The result for pos 1 is " $splits[1] ); #Displayed "one" in command window
                    
    WriteLine"The result for pos 2 is " $splits[2] ); #Displayed "two" in command window
                    
    WriteLine"The result for pos 3 is " $splits[3] ); #Displayed "three" in command window
                ########################################################
                ########################################################

                //Display results with a FOREACH loop
                
                
    FOREACH( $val IN $splits)
                        
    WriteLine"Pos = " $val["value"]);
                ENDFOREACH
                
                
    #Result on screen
                
    Pos =  one
                Pos 
    =  two
                Pos 
    =  Three
                
    ########################################################
                ########################################################

                //Display results with a FOREACH loop
                
                
    $i 1;    
                WHILE(
    $i 4)
                    
    WriteLine"Pos ".$i."=" $splits[$i]);
                    
    $i=$i+1#Count up
                
    ENDWHILE

                    
    Results that will be displayed in Command window
                    Pos 1 
    one
                    Pos 2 
    two
                    Pos 3 
    Three
                
    ########################################################
                ########################################################

                //Display results with a FOR loop
                
                
    FOR($i=1;$i<4;$i=$i+1)
                    
    WriteLine"Pos ".$i."=" $splits[$i]);
                ENDFOR

                    
    Results that will be displayed in Command window
                    Pos 1 
    one
                    Pos 2 
    two
                    Pos 3 
    Three
                
    ########################################################
    ?>

  • -split()
  • -unset()
  • -return()

  • -write()

  • -writeline()

  • -strlen()

    $string = "example";
    $example = StrLen( $string ); #Gives the lenght of a string $example = 7;



  • -dumpvar()
  • -arraycount()
  • -randomnum()
  • -isregexmatch()
  • -sqrt()
  • -mod()

  • -isnum() #check if value is a number
    #check if value is a number
    IF ( IsNum($var) == TRUE ) THEN
    ENDIF

Last edited by Bass-Driver, .
Gai-Luron
S3 licensed
Basic LFSLapper configuration. lpr file
Gai-Luron
S3 licensed
Configuring multiple LFS server on one LFSLapper
Gai-Luron
S3 licensed
Quick Start Guide (Install/Start LFSLapper)
  • [1]-Download the latest version of LFSLapper: DOWNLOAD
  • [2]-Place the LFSLapper directory somewhere you can find it easily.
  • [3]-Open 'LFSServers.cfg' (LFSLapper directory/Bin/LFSServers.cfg) and go the next line that like similar like this.

DEF1|gr1|127.0.0.1|29999|./default|default_1.ini|autowork
#Unique ID|GroupId|IP|InsimPort|WorkDir|IniFile|autowork

-Set IP Adres of the computer were LFSLapper is running on.
-Set Insimport . Default insimport = 29999. This could be differend, if you bought a server.
-Save the file.

  • [4]-Open default_1.ini (LFSLapper directory/Bin/default/default.ini)
    -Set the Serveradminpass: $password = "YourAdminPassHere";
    -Save the file.


  • [5]-Open superusers.txt and admin.txt in default folder (LFSLapper directory/Bin/default)

    -Enter the usernames, who may have adminrights to LFSLapper
    -Save the files.


  • [6]Start LFSLapper by clicking on LFSLapper.exe in the 'Bin' Folder.
  • [7]Have fun
Last edited by Bass-Driver, .
HowTo!
Gai-Luron
S3 licensed
Hello, because somes persons are better than me in using LFSLapper ( yes, yes, i'am a dev man not a parameter man :razzSmile i need your help for writing a HowTo for LFSLapper. I think this howto must contain somes sections like ( not complete, if you have another ideas ).If you have time to write a part of one or more sections, this will be a very good thing for all the community. Put you reply here, i update the correct post in this HowTo as soon i receive your contribution.

Thank's

Gai-Luron
Last edited by Bass-Driver, .
FGED GREDG RDFGDR GSFDG