<?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
Val = one
Val = two
Val = 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
########################################################
?>
<?php
##########################################################################################
#Action on Event when a players changed interface mode
##########################################################################################
/*
#### $Mode ####
NORMAL, // 0 - not in a special mode
OPTIONS, // 1
HOST_OPTIONS, // 2
GARAGE, // 3
CAR_SELECT, // 4
TRACK_SELECT, // 5
SHIFTU, // 6 - free view mode
NUM
#### $SubMode : When a player edit a Object ####
PLAIN, // 0 no buttons displayed
BUTTONS, // 1 buttons displayed (not editing)
EDIT_CHALK, // 4
EDIT_CONES, // 5
EDIT_TYRES, // 6
EDIT_MARKERS, // 7
EDIT_OTHER, // 8
EDIT_CONCRETE, // 9
EDIT_CONTROL, // 10
EDIT_MARSH, // 11
#### $SelObject: When $SubMode = 11 (EDIT_MARSH) ####
MARSH_IS_CP = 252; // insim checkpoint
MARSH_IS_AREA = 253; // insim circle
MARSH_MARSHALL = 254; // restricted area
MARSH_ROUTE = 255; // route checker
*/
Event OnInterfaceMode($userName,$Mode,$SubMode,$SelObject,$Time) # Player event
/*
privmsg("UserName: ".$userName);
privmsg("Mode: ".$Mode);
privmsg("SubMode: ".$SubMode);
privmsg("Selected Object: ".$SelObject);
privmsg("Time: ".$Time);
*/
EndEvent
?>
=================================================
New:
=================================================
01: New Function: CarSwitches(); //More info in Docs/CarSwitches
-Set switches of your car lights,horn,siren,flash,signals
NOTE: You must be a host to enable this function.
02: New Lapperoption: DebugSettings , in LFSLapper.LPR
When setting one of these options below, it will displayed the executed subs/events/Loops in your Lapper console.
$DisplaySubs = 0; #Player created subs
$DisplayLoops = 0; #DelayedCommand functions,
$DisplayEvents = 0; #(Catch)Events
#Note: These settings are in a testfase, there is a chance that some subs not will be displayed in the console.
=================================================
Updates:
=================================================
01: Sqlite Database libraryfiles. (not mono yet)
Case "!loadlayout":
cmdLFS("/axload <Layoutname>");
BREAK;
Function: groupcmdlfs("");
-Create multiple files and multiple Zones within the file.
-It stores the X / Y / Z axis and the carheading , the carheading will only be used for testing.
-Test single Zone's (Button will displayed with the text: 'Entered Zone' / 'Leaving Zone')
-Test Entire files
-Delete Zones
-Delete files.(Under development
-CruiseServers: Set/store your locations like : The Cardealer / The Store etc.
-Creating checkpoints. Respawn to your last checkpoint.
-Off/OnTrack Detection
#-148|39|10|2|testzoneid|tralala|trololol|329
#X-Axis | Y-Axis | Z-Axis | WidthOfArea | ZoneID | EnterZone | LeaveZone | CarHeading
#$Line[0] | $Line[1] | $Line[2] | $Line[3] | $Line[4] | $Line[5] | $Line[6] | $Line[7]
<?php
CatchEvent OnLapperStart()
GlobalVar $GetFileDir;
GlobalVar $GetFileName;
$GetFileDir = "includes/ZoneBuilder/Files/"; #Folder of where the file of zones is saved
$GetFileName = "Name Of The File Here"; #Name of the file that need to be loaded
#Get zones from the files
UserGroupFromFile("". $GetFileName, "" . $GetFileDir. "" . $GetFileName. ".txt" );
#Convert them to a array
$GetListFromFile = GetListOfUsersGroup("". $GetFileName );
#Calculate the amount of zones in the file.
$GetMaxLinesFromFile = arrayCount( $GetListFromFile );
#Get List from File
#X-Axis | Y-Axis | Z-Axis | WidthOfArea | ZoneID | EnterArea | LeaveArea | CarHeading
#$Line[0] | $Line[1] | $Line[2] | $Line[3] | $Line[4] | $Line[5] | $Line[6] | $Line[7]
FOR ($NrOfRows=0;$NrOfRows<$GetMaxLinesFromFile;$NrOfRows=$NrOfRows+1)
$Line = SplitToArray($GetListFromFile[$NrOfRows], "|");
#Check if the Arrays aren't empty
IF (($Line[0] != "")||($Line[1] != "")||($Line[4] != "")) THEN
RegisterZoneAction("".$Line[4]."", getLapperVar("ShortTrackName") , $Line[0] , $Line[1] , $Line[3], $Line[5], $Line[6]);
ENDIF
ENDFOR
EndCatchEvent
?>
$Number = 1.26456
$RoundedNumber = Round($Number,0);
Output: 1
$RoundedNumber = Round($Number,1);
Output: 1,3
$RoundedNumber = Round($Number,2);
Output: 1,26
IF(GetPlayerVar($userName,"P_Tres") == ToNum(247 - Round(GetUserStoredValue($userName," 1XRT") / 2.86 ),0)) THEN
01: First textline error when type !chat <Text> again while chatwindow is opened.
02: When joining a another server, enter chatwindow and close it.
The textlines are still there while the background is gone. After Reentering the command and writing a another textmessage.
Everything is fine
2/20/2018 5:29:50 PM -> The database file is locked
database is locked :
COMMIT TRANSACTION
-----------------------------------------------------------------------------
2/20/2018 5:29:50 PM
Lapper Instance 192.168.178.14/29994 abort!
The database file is locked
database is locked
LFSLapper
bij LFSDbs.DbsAccess.executeNonQuery2(String _command)
bij LFSDbs.DbsAccess.executeNonQuery(String _command)
bij LFSDbs.storedDbs.updateRow2(String key, String value)
bij LFSDbs.storedDbs.updateRow(String key, String value)
bij LFSLapper.LFSClient.setstoredvalue(unionVal val, ArrayList args)
bij GLScript.GLApp.parseBackcall(SetOfVars GVAR, SetOfVars LVAR, unionVal val, ArrayList args)
bij GLScript.Parseur.getval(SetOfVars GVAR, SetOfVars LVAR, executeParsedFunction BC)
bij GLScript.GLApp.retrieveEvalVar(String funcName, TokenParse tkparse, TokenBuffer currTokenBuffer, SetOfVars GVAR, SetOfVars LVAR, Boolean breakFunc, Char& breakCar)
bij GLScript.GLApp.privExecuteTokensPart(Int32 level, String funcName, SetOfVars GCAR, SetOfVars LVAR, Boolean breakable, Boolean inSwitchCase, Int32 start, Int32 end)
bij GLScript.GLApp.privExecuteFunction(String funcName, String[] argsVals)
bij GLScript.GLApp.executeFunction(String funcName, String[] argsVals)
bij Configurator.lexConfigurator.executeFunction(String funcName, infoPlayer pcurrInfoPlayer, String[] par)
bij LFSLapper.LFSClient.managePacket(BTC btc)
bij LFSLapper.LFSClient.Loop(Connect insimConnection)
bij LFSLapper.LFSClient.doloop()
bij LapperInstances.LapperInstance.doConnection()
Int64 executeNonQuery2(System.String)
Closing Instance...
-----------------------------------------------------------------------------