+-------------------------------+
|Changes from v5.904 to 5.906 |
+-------------------------------+
1. Add new player var TotDistMeter that is the distance in meter do by a player
this value is set to 0 when a player connect to the server
You can set this value by SetCurrentPlayerVar( "TotDistMeter" , 10000 );
2. Add new config var
$distToDo = 100;
it is the amount of meter that player must do to trigger new player event OnDistDone, see below
3. Add new event triggered when a player do a certain distance
$distToDo = 100;
Event OnDistDone( $userName ) # Player event
writeline( "100m dist done by " . $userName . " - total dist :" . GetCurrentPlayerVar("TotDistMeter") );
EndEvent
Sub removeMySched()
FOR( $i = 1; $i < 55;$i = $i + 1 )
$id = "RaceNight_" . strFormat("{0:00}",$i);
RemoveScheduleAction( $id );
ENDFOR
EndSub
FOR( $i = 0; $i < 56;$i = $i + 1 )
RemoveScheduleAction( "Number_" . strFormat("{0:00}",$i));
ENDFOR
Sub rme( $ids )
$ar_id = SplitToArray( $ids,"&" );
FOREACH( $val IN $ar_id )
RemoveScheduleAction($val["value"]);
ENDFOREACH
EndSub
+-------------------------------+
|Changes from v5.904 to 5.905 |
+-------------------------------+
1. Fix bug on scheduledAction
Sub rme( $ids )
$ar_id = SpliToArray( $id$,"&" );
FOREACH( $val IN $ar_id )
RemoveScheduleAction($val["value"]);
ENDFOREACH
EndSub
CASE "!pm":
$tmp = splitToArray( $argv,"," )
privMsg( $tmp[0], "You have received a private message from" . GetCurrentPlayer("UserName" ) );
privMsg( $tmp[0], $tmp[1] );
BREAK;
Sub userMsg( $userOrig,$userDest,$msg )
PrivMsg($userDest,"You have receive a message from " . $userOrig );
PrivMsg($userDest, $msg );
EndSub
+-------------------------------+
|Changes from v5.903 to 5.904 |
+-------------------------------+
1. Add blinking button feature on button, value is 8 or use ISB_BLINK const
Example:
openPrivButton( "clos",78,120,20,10,10,-1,ISB_DARK | ISB_BLINK,langEngine("%{main_accept}%"),OnConnectClose );
or
openPrivButton( "clos",78,120,20,10,10,-1,32 + 8,langEngine("%{main_accept}%"),OnConnectClose );
Better use const for more lisibility
2. new arg in functions
RegisterScheduleAction
RegisterScheduleAction
RegisterZoneAction
DelayedCommand
PrivDelayedCommand
accept a newArg that is an unique id for this Action.
this id is usefull when you want remove a RegisterScheduleAction, RegisterScheduleAction, RegisterZoneAction,DelayedCommand,PrivDelayedCommand
You can also still continue use this function without this arg
Example:
RegisterScheduleAction( "myTest","* * * * * * *", SA_test );
RegisterNodeAction( "MyNode", "SO6" , 337 , SA_Test2 );
RegisterZoneAction( "MyZone", "SO6" , 337 , SA_Test3 );
DelayedCommand( "MyCommand", SA_Test3 );
PrivDelayedCommand( "MyCommand", SA_Test3 );
3. new functions
RemoveScheduleAction( idSched );
RemoveNodeAction( idSched, track );
RemoveZoneAction( idSched, track );
RemoveDelayedCommand( idSched );
RemovePrivDelayedCommand( idSched );
this functions allow to remove a previous registered action
Example:
RemoveScheduleAction( "myTest" );
RemoveNodeAction("MyNode","SO6");
RemoveZoneAction("MyZone","SO6");
RemoveDelayedCommand( "MyCommand" );
RemovePrivDelayedCommand( "MyCommand" );
4. Add a new player Var to know in witch zone the player is
if not in zone value is "NONE" else it's the id of the zone event, identifi you zoneaction now.
usefull when you want command available only in specific zone
Example
CASE "!buyfood":
IF( GetCurrentPlayerVar( "idZone") == "MyZone" ) THEN
... do what you want ...
ELSE
privmsg( "Command not available here");
ENDIF
+-------------------------------+
|Changes from v5.902 to 5.903 |
+-------------------------------+
1. Improve number of simultaneus button allowed on screen to 240 ( LFS limit ) instead 170.
2. Add a timeout feature in script to stop infinite loop. Default is 2000ms
you can set your own value in LFSServers.cfg
timeOutScript=2000; # Time out in ms
3. Add player var retreiveid from Pubstat
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
4. Add a Sub fonction in LFSLapper.lpr script PstInfo, this function display the pubstat info for one player
5. Add new chat command !ps to display your pubstat info or !ps username to display the pubstat info for
a player present on server
6. Add new .lpr file consts.lpr, containing some const usefull to write script
+-------------------------------+
|Changes from v5.901 to 5.902 |
+-------------------------------+
1. new command const, you can put it in sub/event or outside sub to define const
Const are preproced when reading config file, not on execution
const MY_CONST 12; # it's global const
const MY_CONST2 1 + 23; # it's global const
Sub mySub()
const LOCAL_CONST 13; # it's local const const only available in sub
const MY_CONST2 2 + 89; # This override the global const only in this sub;
$i = 12 + MY_CONST + LOCAL_CONST + MY_CONST2; # This is replaced by $i = 12 + 12 + 13 + 2 + 89;
EndSub
2. Fix Bug when setting a local var with global var and global var with localvar