RotateIn -> Races remaining before Rotation
HostName -> Current host Name
ShortTrackName -> Track Name in Short format : SO6
LongTrackName -> Track Name in long format : South City Chicane
ShortTime -> Server Time in short format
LongTime -> Server Time in long format
ShortDate -> Date in short format
LongDate -> Date in long format
CurrRotateCar -> Current rotated Car
CurrRotateTrack -> Current rotated Track
CurrLongRotateTrack -> Current rotated Track
NextRotateCar -> Next rotated Car
NextRotateTrack -> Next rotated Track
NextLongRotateTrack -> Next rotated Track
RequiredFlags -> Flag(s) required on this server
<?php
getLapperVar( "nbConnectedPlayers" )
?>
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
<?php
cmdLFS("/ws ". $track. " " . $car . " pb ". $user);
or
cmdLFS("/ws XFG pb iol(qc)");
or
globalMsg(cmdLFS("/ws ". $track. " " . $car . " pb ". $user));
?>
<?php
globalMsg( langEngine( "^7User: {0} pb: {1}",$user,cmdLFS( "/w pb " . $user)));
?>
<?php
$info = getPlayerInfo( $user );
globalMsg( "". $info); #returns the string "Array"
globalMsg( "". $info["PSCountry"]); #returns nothing
globalMsg( "". $info[0]); #returns nothing
?>
<?php
Event OnGreenLight($UserName ) # Possible to make this as a player Event?
WHILE (ToInt(GetCurrentPlayerFunctionReturn(GasIsPressed())) != 1)
$reactionTime = StartCounting();
ENDWHILE
...
?>
<?php
Event OnSplit1( $userName ) # Player event
IF(ToNum(GetCurrentPlayerVar("sp1")) == 0)
THEN
setCurrentPlayerVar( "sp1",ToNum(GetCurrentPlayerVar("Split1")));
$tData = SplitToArray( ToNum(GetCurrentPlayerVar("sp1")),"?");
dumpVar($tData);
ENDIF
IF (ToNum(GetCurrentPlayerVar("sp1")) != 0 && ToNum(GetCurrentPlayerVar("Split1")) > ToNum(GetCurrentPlayerVar("sp1")))
THEN
$difference = ToNum(GetCurrentPlayerVar("Split1")) - ToNum(GetCurrentPlayerVar("sp1"));
setCurrentPlayerVar( "sp1",ToNum(GetCurrentPlayerVar("Split1")) );
privMsg( langEngine( "^7First split difference: ^2-{0}",ToNum($difference)));
ENDIF
IF (ToNum(GetCurrentPlayerVar("sp1")) != 0 && ToNum(GetCurrentPlayerVar("Split1")) < ToNum(GetCurrentPlayerVar("sp1")))
THEN
$difference = ToNum(GetCurrentPlayerVar("sp1")) - ToNum(GetCurrentPlayerVar("Split1"));
privMsg( langEngine( "^7First split difference: ^1+{0}",ToNum($difference)));
ENDIF
?>
[SIZE=2]Sub DisplaySpeed( $userName )[/SIZE]
[SIZE=2]$topSpeed = GetCurrentPlayerVar("topSpeed");[/SIZE]
[SIZE=2]$instantSpeed = GetCurrentPlayerVar("InstantSpeed");[/SIZE]
[SIZE=2]globalMsg ("^7DEBUG: current player topSpeed = " . $topSpeed);[/SIZE]
[SIZE=2]globalMsg ("^7DEBUG: current player instant Speed = " . $instantSpeed);[/SIZE]
[SIZE=2]globalMsg ("^7DEBUG: IF " . $topSpeed . " is zero : display first pass");[/SIZE]
[SIZE=2]IF ($topSpeed == 0)[/SIZE]
[SIZE=2]THEN[/SIZE]
[SIZE=2]setCurrentPlayerVar( "topSpeed",$instantSpeed );[/SIZE]
[SIZE=2]$topSpeed = GetCurrentPlayerVar("topSpeed");[/SIZE]
[SIZE=2]privMsg( langEngine( "First Pass: ^3{0} ^7{1} " , $instantSpeed,GetCurrentPlayerVar("UnitSpeed") ) );[/SIZE]
[SIZE=2]ENDIF[/SIZE]
[SIZE=2]globalMsg ("^7DEBUG: ^7IF " . $topSpeed . " not zero and (" . $instantSpeed . " > " . $topSpeed .") : display New" );[/SIZE]
[SIZE=2]IF ($topSpeed != 0 && $instantSpeed > $topSpeed)[/SIZE]
[SIZE=2]THEN[/SIZE]
[SIZE=2]$difference = $instantSpeed - $topSpeed;[/SIZE]
[SIZE=2]setCurrentPlayerVar( "topSpeed",$instantSpeed );[/SIZE]
[SIZE=2]$topSpeed = GetCurrentPlayerVar("topSpeed");[/SIZE]
[SIZE=2]privMsg( langEngine( "New top speed: ^3{0} ^7{1} ^2+{2}",$topSpeed,GetCurrentPlayerVar("UnitSpeed"),$difference));[/SIZE]
[SIZE=2]ENDIF[/SIZE]
[SIZE=2]globalMsg ("^7DEBUG: IF " . $topSpeed . " not zero and (" . $instantSpeed . " < " . $topSpeed . ") : display Speed" );[/SIZE]
[SIZE=2]IF ($topSpeed != 0 && $instantSpeed < $topSpeed)[/SIZE]
[SIZE=2]THEN[/SIZE]
[SIZE=2]$difference = $topSpeed - $instantSpeed;[/SIZE]
[SIZE=2]privMsg( langEngine("Speed: ^3{0} ^7{1} ^1-{2}",$instantSpeed,GetCurrentPlayerVar("UnitSpeed"),$difference));[/SIZE]
[SIZE=2]ENDIF[/SIZE]
[SIZE=2][SIZE=2]EndSub[/SIZE]
[/SIZE]
IF ()
THEN
...
ELSE IF ()
THEN
...
ENDIF
Sub DisplaySpeed( $userName )
$topSpeed = GetCurrentPlayerVar("topSpeed");
$speed = GetCurrentPlayerVar("InstantSpeed");
IF ($topSpeed == 0)
THEN
setCurrentPlayerVar( "topSpeed",$speed );
$topSpeed = GetCurrentPlayerVar("topSpeed");
privMsg( langEngine( "^7Première passe: ^3{0} ^7{1} " , $speed,GetCurrentPlayerVar("UnitSpeed") ) );
ENDIF
IF ($topSpeed != 0 && $speed > $topSpeed)
THEN
$difference = $speed - $topSpeed;
setCurrentPlayerVar( "topSpeed",$speed );
$topSpeed = GetCurrentPlayerVar("topSpeed");
privMsg( langEngine( "^7N o u v e a u t o p s p e e d: ^3{0} ^7{1} ^2+{2}",$topSpeed,GetCurrentPlayerVar("UnitSpeed"),$difference));
ENDIF
IF ($topSpeed != 0 && $speed < $topSpeed)
THEN
$difference = $topSpeed - $speed;
privMsg( langEngine("^7Vitesse: ^3{0} ^7{1} ^1-{2}",$speed,GetCurrentPlayerVar("UnitSpeed"),$difference));
ENDIF
EndSub
Sub ExitDisplaySpeed( $userName )
PrivMsg( "Sorti du Speedtrap" );
/* 302 to 1019
$listOfPlayers = GetListOfPlayers();
$currTopSpeed = GetStoredValue( "GlobaltopSpeed" );
$newTopSpeed = 0;
FOREACH( $currUname IN $listOfPlayers )
{
$currTopSpeed = getPlayerVar( $currUname,"topSpeed" );
IF($currTopSpeed > $newTopSpeed)
{
$newTopSpeed = $currTopSpeed;
$unit = GetPlayerVar( "$currUname","UnitSpeed" );
$nom = getPlayerVar( "$currUname","NickName" );
}
ENDIF
}
ENDFOREACH
IF($newTopSpeed > GetStoredValue( "GlobaltopSpeed" ))
{
SetStoredValue( "GlobaltopSpeed", $newTopSpeed );
globalMsg( langEngine( "F a s t e s s s p e e d t r a p: {0} {1}{2}", $nom,$newTopSpeed,$unit ) );
}
*/
ENDIF
EndSub
Event OnLapperStart()
RegisterNodeAction( "BL1" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "BL1R" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "BL2" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "BL2R" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "FE1" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "FE1R" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "FE2" , 300 , DisplaySpeed,ExitDisplaySpeed );
RegisterNodeAction( "FE2R" , 300 , DisplaySpeed,ExitDisplaySpeed );
...
else if (infos.autoStart == infoInstance.autoStartVal.AUTO_WORK)
{
#region workMode
openStbMode();
SendMsg("[B][SIZE=3]LFSLapper go in Work State[/SIZE][/B]");
...
}
Event OnRaceStart( $NumP ) # Lapper event
SetStoredValue( "GlobaltopSpeed", 0 );
$ListOfPlayers = GetListOfPlayers();
FOREACH( $CurrUname IN $ListOfPlayers )
{
[SIZE=3][B]setPlayerVar( $CurrUname, "topSpeed",0 );[/B][/SIZE]
}
ENDFOREACH
EndEvent
FOREACH( $CurrUname IN $ListOfPlayers )
{
...
}
ENDFOREACH
FOREACH( $CurrUname IN $ListOfPlayers )
...
BREAK;
ENDFOREACH
/insim 29999
for($i = 0, $i < getLapperVar( totalPlayers ), $i = $i +1)
{
$topSpeed = 0;
$playerTopSpeed = GetPlayer[i]Var("topSpeed");
IF($playerTopSpeed > $topSpeed)
{
$playerName = GetPlayerVar( player[i], "NickName" )
$newTopSpeed = $playerTopSpeed;
}
}
IF($newTopSpeed>globalTopSpeed)
{
setLapperVar( "GlobaltopSpeed",$newTopSpeed );
globalMsg( langEngine( "N o u v e a u T o p S p e e d: {0} driver: {1}", $newTopSpeed,$playerName));
}