double driftscoreinthistick = this.absangle * speed * speed / 10000d;
if (speed < minspeed)
{
this.driftticks = 0;
this.totaldriftscore = 0;
this.lastdriftscore = 0;
}
else
{
if (this.absangle > minangle && this.absangle < maxangle)
{
this.driftticks++;
this.lastdriftscore += driftscoreinthistick;
this.totaldriftscore += driftscoreinthistick;
//System.Console.WriteLine(string.Format("DRIFT: {0} {1} {2} {3} score: {4}", this.UserName, this.NickName, this.UniqueID, this.ConnectionNumber, this.driftscore));
}
else
{
this.driftticks = 0;
}
}
+-------------------------------+
|Changes from v5.841RC to 5.842 |
+-------------------------------+
1. 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} of 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%
2 - Add new GLScript command
myConfig();
This show the Lapper config panel for the player
3 - Remove shift + I command.
4 - Add !myconfig in default LFSLapper.lpr file to call the player config panel
5 - Add language bloc translation in config file
Syntax :
Lang idLang
...
EndLang
You can create many block you want. Many block as you want for Lang "EN".
idMessage = Message;
idMessage is an idenditification of the message.
Message is the message displayed on the screen. You can put in it {0} ... {n} parameter. Look at strFormat
Example:
Lang "EN"
main_welc1 = "^7Welcome {0} ^7to ^1LFSLapper ^7powered server !&^2Type ^7!help ^2after leaving garage to see commands.";
main_welc2 = "^7Your actual friendly Position (all visitors) : ^7{0}&^2Your actual League prequalify Position : {1}^6Estimate Pool : {2}&Don't use swearwords on this server&respect other player&otherwise you can be banned";
main_accept = "Accept";
EndLang
Lang "EN"
main_deny = "Deny";
essai = "My test value 1 = {0}, value 2 = {1}";
EndLang
Lang "FR"
main_welc1 = "^7Bienvenue {0} ^7sur ce serveur Géré par ^1LFSLapper^7!&^2Tapez ^7!help ^2 pour voir les commandes après avoir quitté le garage";
main_welc2 = "^7Votre position absolue (Tous les visiteurs) : ^7{0}&^2Votre position de préqualification : {1}^6Estimation de poule : {2}&Ne pas employer de mots grossiers sur ce serveur&Respecter les autres joueurs&sinon vous risquez d'être banni";
main_accept = "Accepter";
main_deny = "Refuser";
essai = "Mon essai valeur 1 = {0}, valeur 2 = {1}";
EndLang
6 - Add new GLScript command
GlobalMsg( "Message" );
if same as cmdLFS("/msg Message"), but GlobalMsg support automatic translation ( see below )
7 - Add new GLScript command
GlobalRcm( "Message" );
if same as cmdLFS("/rcm Message") and cmdLFS("/rcm_all"), but GlobalRcm support automatic translation ( see below )
8 - Add new GLScript command
PrivRcm( "Message" );
if same as cmdLFS("/rcm Message") but for the current player, privRcm support automatic translation ( see below )
9 - Add new GLScript command
langEngine("%{idMessage}%", param,...,param )
but this function don't return the translated message, but set the translate
engine for the global messaging. This function must be used everywhere in message function
example:
langEngine("%{main_welc2}%",$Posabs,$Posqual,$Groupqual )
main_welc2 is defined in language block for the different language
the value is english is :
"^7Your actual friendly Position (all visitors) : ^7{0}&^2Your actual League prequalify Position : {1}^6Estimate Pool : {2}&Don't use swearwords on this server&respect other player&otherwise you can be banned"
in main_welc2 message
{0} is replaced by value of $Posabs
{1} is replaced by value of $Posqual
{2} is replaced by value of $Groupqual
10 - Add new GLScript command
langTranslate("%{idMessage}%", param,...,param ) same as langTranslate
but this function return the translated message.
idMessage , same id who is defined in block message
param1,..,paramn , parameter to fusion with message. look at strformat
11 - Add the choice of the lang in the !myconfig command.
12 - Fix minor bug in info when an error occur un script
13 - Fix bug in releasing button when type shift+I
14 - Language pack for EN ( English ) and FR ( French )
IF ($AKM == "The Greatest") THEN
Greatest();
ELSE
Worst();
ENDIF