======================================
#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
CatchEvent OnDriftScore($userName) # Player event
Driftscore($userName);
EndCatchEvent
Sub DriftScore($userName)
#Blaaaaah
EndSub
<?php
public byte[] MST(string msg)
{
int msgLen = msg.Length > 63 ? 63 : msg.Length;
byte[] packet = new byte[68];
packet[0] = 68;
packet[1] = (byte)TypePack.ISP_MST;
packet[2] = 0;
packet[3] = 0;
InSim.CodePage.GetBytes(msg, 0, msgLen, packet, 4);
return packet;
}
?>
<?php
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 )
ENDSWITCH
EndEvent
?>
<?php
SWITCH( $command )
CASE "!yourcommand":
#Yourcode
BREAK;
ENDSWITCH
?>
Event OnDriftScore($userName) # Player event
$AngleVelocity = GetCurrentPlayerVar( "AngleVelocity" );
IF (($AngleVelocity > 0)&&($AngleVelocity < 11)) THEN
#Button
ENDIF
IF (($AngleVelocity > 10)&&($AngleVelocity < 21)) THEN
#Button
ENDIF
IF (($AngleVelocity > 20)&&($AngleVelocity < 31)) THEN
#Button
ENDIF
#etc
EndEvent
+-------------------------------+
|Changes from 7.0.4.5 to 7.0.4.6|
+-------------------------------+
=================================================
New:
=================================================
01 New function: layoutinfo(); Layout information ISP_AXI Insimpacket
-Number of objects
-Number of Checkpoints
-Number of startarrows
-Layoutname: (only when lapper is loaded on a local server)
02 New PlayerVars: Extra player info ISP_NCI Insimpacket (DONE)
//These vars are set after the player has joined the server
GetPlayerVar($userName,"LFS_Language"));
GetPlayerVar($userName,"LFS_UserID"));
GetPlayerVar($userName,"DecimalIPAdress"));
GetPlayerVar($userName,"IPAdress"));
To retreive extra info about the players AFTER lapper is loaded:
connectioninfo();
03 New PlayerVars: AFKTimer/IdleTimer
GetPlayerVar($userName,"AFKTime")); # Not being active in the server (Driving/Sending messages)
GetPlayerVar($userName,"IdleTime")); #Not driving the car (on the road).
=================================================
Updated:
=================================================
01: Max stored laptime is now 30 minutes instead of 5 minutes.
//Laptimes higher than 30 minutes will not be stored in the Lapper database.
//Reason: For very long layouts.
02: Few document updates.(Docs folder)
=================================================
Fixed:
=================================================
01: Lapper Crash: After loading/clearing layouts
02: Lapper Crash: After loading new track
<?php
RegisterNodeAction( TESTID, getLapperVar( "ShortTrackName" ) , getCurrentPlayerVar("CurrNode") , test,"" );
Sub test($UserName,$ZoneID)
privmsg("ID=".$ZoneID); #output is TESTID
EndSub
?>
CASE "!btn":
br_fixture_leftt($KeyFlags);
BREAK;
Sub br_fixture_leftt($KeyFlags)
EndSub
CASE "!btn":
br_fixture_leftt($userName);
BREAK;
Sub br_fixture_leftt($userName)
EndSub
<?php
CatchEvent 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 "!sort": #!sort asc or !sort desc
SortValues($argv);
BREAK;
ENDSWITCH
EndCatchEvent
Sub SortValues($TypeSort)
$SaveNumber = 0;
$Numbers = "3|2|10|45|21|4|5|11|1|0|300|276|112";
$GetNumber = SplitToArray($Numbers,"|");
$Count_GetNumber = arrayCount( $GetNumber );
#Add a '0' to the number to create a 2 or 3 digit number
#This will also converts string to Numeric characters
FOR ($i=0;$i<$Count_GetNumber;$i=$i+1)
### Array with values from 0 - 10 ###
IF (ToNum($GetNumber[$i]) < 10) THEN
$GetNumber[$i] = "00".$GetNumber[$i];
ENDIF
### Array with values from 0 - 100 ###
IF ((ToNum($GetNumber[$i]) > 9) && (ToNum($GetNumber[$i]) < 100)) THEN
$GetNumber[$i] = "0".$GetNumber[$i];
ENDIF
ENDFOR
###############
###Ascending###
###############
IF($TypeSort == "asc") THEN
#Sort values of array in Ascending order
FOR ($a=0;$a<$Count_GetNumber;$a=$a+1)
FOR ($i=$a;$i<$Count_GetNumber;$i=$i+1)
IF( $GetNumber[$a] > $GetNumber[$i]) THEN
$SaveNumber = $GetNumber[$i]."";
$GetNumber[$i] = $GetNumber[$a]."";
$GetNumber[$a] = $SaveNumber."";
ENDIF
ENDFOR
ENDFOR
privmsg("^7[Ascending sort]:");
#Display Values
FOR ($i=0;$i<$Count_GetNumber;$i=$i+1)
privmsg("Pos: [".$i."] = ".$GetNumber[$i]);
ENDFOR
ENDIF
################
###Descending###
################
IF($TypeSort == "desc") THEN
#Sort values of array in Descending order
FOR ($a=0;$a<$Count_GetNumber;$a=$a+1)
FOR ($i=$a;$i<$Count_GetNumber;$i=$i+1)
IF( $GetNumber[$a] < $GetNumber[$i]) THEN
$SaveNumber = $GetNumber[$a]."";
$GetNumber[$a] = $GetNumber[$i]."";
$GetNumber[$i] = $SaveNumber."";
ENDIF
ENDFOR
ENDFOR
privmsg("^7[Descending sort]:"); #New line
#Display Values
FOR ($i=0;$i<$Count_GetNumber;$i=$i+1)
privmsg("Pos: [".$i."] = ".$GetNumber[$i]);
ENDFOR
ENDIF
EndSub
?>
Sub SortValues($userName)
$TempNumber = 0;
$Numbers = "3|2|10|45|21|4|5|7|9|11";
$GetNumber = SplitToArray($Numbers,"|");
$ValueCount = arrayCount( $GetNumber );
FOR ($i=0;$i<$ValueCount;$i=$i+1)
FOR ($a=1;$a<$ValueCount;$a=$a+1)
IF ($GetNumber[ToNum($i)] < $GetNumber[ToNum($a)]) THEN
$TempNumber = $GetNumber[ToNum($i)];
$GetNumber[ToNum($i)] = $GetNumber[ToNum($a)];
$GetNumber[ToNum($a)] = $TempNumber;
ENDIF
ENDFOR
ENDFOR
### Display list ###
FOR ($j=0;$j<$ValueCount;$j=$j+1)
privmsg("| ".$j." / ".$GetNumber[ToNum($j)]);
ENDFOR
EndSub
#######################################################################################
#Get info about objects when adding/removing objects in AutoX editor
#######################################################################################
$DisplayObjectInfo = -1; #Set -1 to disable this event
Event OnObjectInfo($userName,$NumO,$Action,$X,$Y,$Z,$Flags,$Type,$InDex,$Heading) # Player event
EndEvent