The online racing simulator
Hello,

For adminmsg you can do that in GLScript in easy with listOfPlayer and group like your C# code. No reason to Add in LFSLapper. Maybe you can write a utils.lpr with GLScript usefull functions.

For contains function you have indexOf function

bye Gai-Luron

Gai-Luron
Sector number?
If something not already available, can there be way for lapper to tell and output which sector a driver is currently in?

From what I can see, all the player variables available to do with splits and sectors appear to be all time related functions (sector/split times and comparisons to previous/best sector/split times).

Looking for something like

IF (GetCurrentPlayerVar( SectorIDNumber )==2) # in other words, if driver in 2nd sector
THEN
-do something-
ELSE
-do something different or ignore
ENDIF
Hello,

When you say sector, do you mean node. If node, you have RegisterNode Action. If you mean zone on track, you have zoneRegisterAction

Gai-Luron
Gai-Luron already set you in the right direction, although it's not exactly what you need. With his commands you have to define your zones manualy and then use them later. It would be a nice addon to have an option to manualy create zone starting at X and ending at y.
Gai - Sorry, no.

Don't want to use !zone or !node because I then have to find and set them for every single track and configuration, forward and reverse.

I already have to do this for my enter pits/exit pits warning, and few other things too. Comfortable with these, but this would be pain for what I need.

There must already be defined sections of the track where one sector ends and other sector starts (the obvious one is the start/finish line), otherwise you couldn't measure sector/split times.

I'm wanting to set up a yellow flag warning system, where if there is a crash in a sector, only people in that sector, and previous sector advised. If you're in front of the sector (maybe up to 2 sectors on longer tracks), then you don't need to know until you start new lap. And even then, you might never need to know, as flag may no longer be needed.

There must be something to tell LFS or Lapper that a sector is finished for the sector/split times to then show when past this point?

Would be nice to have sector zones, and Yisc's idea is a good one too.
Quote from sinanju :Gai - Sorry, no.

Don't want to use !zone or !node because I then have to find and set them for every single track and configuration, forward and reverse.

I already have to do this for my enter pits/exit pits warning, and few other things too. Comfortable with these, but this would be pain for what I need.

There must already be defined sections of the track where one sector ends and other sector starts (the obvious one is the start/finish line), otherwise you couldn't measure sector/split times.

I'm wanting to set up a yellow flag warning system, where if there is a crash in a sector, only people in that sector, and previous sector advised. If you're in front of the sector (maybe up to 2 sectors on longer tracks), then you don't need to know until you start new lap. And even then, you might never need to know, as flag may no longer be needed.

There must be something to tell LFS or Lapper that a sector is finished for the sector/split times to then show when past this point?

Would be nice to have sector zones, and Yisc's idea is a good one too.

easy... On split have it set a current player var setting the split number
Fire_Optikz is right...use the OnSplit1, OnSplit2 and OnSplit3 functions to set a player var like this (Sector 1 is from Start/Finish to Split 1):


<?php 
CatchEvent OnLap
$userName # Player event
    # Update event lap count
    
SetCurrentPlayerVar "Sector");
    
$RaceLaps GetCurrentPlayerVar ("RaceLaps");
    
$RaceLaps $RaceLaps 1;
    
SetCurrentPlayerVar "RaceLaps"$RaceLaps );
    
SetUserStoredValue "RaceLaps"$RaceLaps);

        
# Update the PB if the current lap is faster than the PB
    
$RacePB GetCurrentPlayerVar("RacePB");
    
$CurrLapTime GetCurrentPlayerVar ("LapTime");
    IF ( 
ToNum($RacePB) < || ToNum($CurrLapTime) < ToNum($RacePB) )
    
THEN
        SetCurrentPlayerVar 
"RacePB"$CurrLapTime );
        
SetUserStoredValue "RacePB"$CurrLapTime);
    ENDIF

    
RaceTickerUpdate();
EndCatchEvent

CatchEvent OnSplit1
$userName # Player event
    
SetCurrentPlayerVar "Sector");
EndCatchEvent

CatchEvent OnSplit2
$userName # Player event
    
SetCurrentPlayerVar "Sector");
EndCatchEvent

CatchEvent OnSplit3
$userName # Player event
    
SetCurrentPlayerVar "Sector");
EndCatchEvent

?>


NB: This code is from a race tracker that I will release soon. it's main purpose is to track a racers state if they disconnect or pit/re-enter, and also to provide custom race reporting for our web site.
New Function/Var requests
Hi GL,

Please have a look at the attached patch file for soem additional vars and functions that I would like intergrated into your next release to help support a number of race tracking and managing addons that I am in the process of creating. Here is a summary of what's in the patch:

Functions
closePrivButtonRegex & closeButtonRegex - these functions will close all of the active buttons that match the given Regular Expression, so to close all of the buttons on the !who command, just use:

<?php 
closePrivButtonRegex 
("dowho.*");
?>

Events
OnPracStart - This event is run when a practice session is started

Lapper Vars
raceinprog - this lapper vars will return the current race state that match the following entries in the consts.lpr file:

<?php 
# Race type
const RACEINPROG_NONE        0# Race not in progress
const RACEINPROG_RACE        1# Race
const RACEINPROG_QUALIFY    2# Qualify
?>

raceid - this lapper var returns a unique identifier for the race based on the race start time. This is used to track if a player has already been in the race prior to a disconnect, and also lets us gather stats based on the raceid for series points calculations.

Many thanks.

* Updated patch file attached *
Attached files
krayy_100210b_patch.txt - 7.6 KB - 400 views
Quote from Krayy :Fire_Optikz is right...use the OnSplit1, OnSplit2 and OnSplit3 functions to set a player var like this (Sector 1 is from Start/Finish to Split 1)......
CatchEvent OnSplit1( $userName ) # Player event
SetCurrentPlayerVar ( "Sector", 2 );

Thanks both of you.

Apologies too, as I forget you can set things like this yourself - I'm more used to only having choices from a look up table or drop down list.

To get information back out of setting player variable like this, can I use

$sector=GetCurrentPlayerVar ("Sector");

and/or

IF (GetCurrentPlayerVar ("Sector") >=2)
THEN....
The two work
Quote from Krayy :Hi GL,

Please have a look at the attached patch file for soem additional vars and functions that I would like intergrated into your next release to help support a number of race tracking and managing addons that I am in the process of creating. Here is a summary of what's in the patch:

Functions
closePrivButtonRegex & closeButtonRegex - these functions will close all of the active buttons that match the given Regular Expression, so to close all of the buttons on the !who command, just use:

<?php 
closePrivButtonRegex 
("dowho.*");
?>

Events
OnPracStart - This event is run when a practice session is started

Lapper Vars
raceinprog - this lapper vars will return the current race state that match the following entries in the consts.lpr file:

<?php 
# Race type
const RACEINPROG_NONE        0# Race not in progress
const RACEINPROG_RACE        1# Race
const RACEINPROG_QUALIFY    2# Qualify
?>

raceid - this lapper var returns a unique identifier for the race based on the race start time. This is used to track if a player has already been in the race prior to a disconnect, and also lets us gather stats based on the raceid for series points calculations.

Many thanks.

* Updated patch file attached *

The attached patch file has modified some of the code that was not required and updated the RaceID so that it can be used with the SplitToArray function.
Attached files
krayy_100210b_patch.txt - 7.6 KB - 414 views
hey Gai u think you could give us a little heads up on whats in the next update like if ur renameing openprivbutton or what this would help me get a small head start on my script
-
(Fire_optikz001) DELETED by Fire_optikz001
Updated utils.lpr & who.lpr
Hi Gai,

These files update the !who command to use a standardised Dialog box layout, and also adds these new utility functions:

DialogCreate ( $userName, $DialogPrefix, $origL, $origT, $Width, $Height, $Title, $showClose, $secondsDisplayed)
This function creates a standardised Dialog so that it creates continuity with the user interface

DialogClose
This function is called from the standardised DialogCreate function, and closes the entire dialog

ButtonExists( $userName, $ButtonToFind )
This function returns TRUE if a button already exists for a user, or FALSE if it doesn't. Called like this:

<?php 
    
IF ( ButtonExists(GetCurrentPlayerVar("UserName"), $DialogPrefix ".*bg") == FALSE)
    
THEN
        DialogCreate 
GetCurrentPlayerVar("UserName"), $DialogPrefix$origL-1$origT$Width$Height$DialogTitle$ShowClose$secondsDisplayed);
    ENDIF
?>

DEBUG ($msg)
This function will output a message to any Lapper Admins with the preface "DEBUG: ". Very useful for debugging messages, and easily disabled using the Global variable $DebugOn.
Attached images
lfs_00000015.jpg
lfs_00000014.jpg
Attached files
who.txt - 6.8 KB - 399 views
utils.txt - 2.3 KB - 366 views
When executing an OnLap, OnPB, OnPBQual or OnSplitX, how about passing the lap or split time as a parameter. That would save a call back in GL to retrieve the relevant playervar with very little overhead.

Maybe also the gap times for the OnNewGapPlayerBehind and OnNewGapPlayerBefore functions?
would be coold if you cold do this...


<?php 
include( "http://yoursite.com/LFSLapper-Scripts/YourScript.lpr" );
?>

in other words ability to run scripts off the web with out having to download
How about a Global stored value database that resides in the Lapper.exe directory so that you can store common variables across all Lapper instances, like Player membership status, last server joined etc. Used like:


<?php 
SetGlobalUserStoredValue
$uName"H_Mass"GetPlayerVar($uName,"H_Mass"));
$uMass GetGlobalUserStoredValue$uName"H_Mass");
?>

Quote from Krayy :How about a Global stored value database that resides in the Lapper.exe directory so that you can store common variables across all Lapper instances, like Player membership status, last server joined etc. Used like:


<?php 
SetGlobalUserStoredValue
$uName"H_Mass"GetPlayerVar($uName,"H_Mass"));
$uMass GetGlobalUserStoredValue$uName"H_Mass");
?>


that would be cool
Here's a short patch to add some extra functionality, and a potential bugfix for FinishedPos:

New GetPlayerVars: ucid, plid

New functions:
getplayervarbyucid
getplayervarbyplid
userisserveradmin
Quote from Krayy :Here's a short patch to add some extra functionality, and a potential bugfix for FinishedPos:

New GetPlayerVars: ucid, plid

New functions:
getplayervarbyucid
getplayervarbyplid
userisserveradmin

Dang, my casts were causing a crash, so this is the correct patch file:
Attached files
krayy_patch_100318.txt - 9.5 KB - 446 views
ability to have the storedvalue.dbs online (ftp)

OR

ability to use a mysql database(one on my site)
got a little bored today so i changed the code up on dialog create

and made it so that it gets centered on your screen

(and also fixed the bug with [ Close ] where it was not centered correctly on the dialog box)


<?php 
DialogCreateCentered 
$userName$DialogPrefix$Width$Height$DialogTitle$ShowClose$secondsDisplayed);
?>


<?php 
Sub DialogCreateCentered 
$userName$DialogPrefix$Width$Height$Title$showClose$secondsDisplayed#$origL & $origT are no longer needed up here
$origL round(ToNum(ToNum(200 $Width)/2),0);
$origT round(ToNum(ToNum(200 $Height)/2),0);

DialogCreate $userName$DialogPrefix$origL$origT$Width$Height$Title$showClose$secondsDisplayed);
EndSub
?>


i am also developing where a button will have a colored background (^color)
-
(Fire_optikz001) DELETED by Fire_optikz001
-
(Fire_optikz001) DELETED by Fire_optikz001
i was wondering if you could add a way to check if a user uses a mouse wheel or keyboard to drive
Quote from Fire_optikz001 :i was wondering if you could add a way to check if a user uses a mouse wheel or keyboard to drive

There is.


#################
#Control Allowed#
#################
# Racer flags
# "Y" = Yes
# "N" = No
# "*"" = Yes or No
# Local variable
#-------------------------------------------------------------------
$SwapSide = "*";
$AutoGears = "*";
$Shifter = "*";
$HelpBrake = "*";
$AxisClutch = "*";
$AutoClutch = "*";
$Mouse = "[COLOR=red]N[/COLOR]";
$KbNoHelp = "[COLOR=red]N[/COLOR]";
$KbStabilised = "[COLOR=red]N[/COLOR]";
$CustomView = "*";

Event OnNotMatchFlags( $userName ) # Player event
... do some thing
EndEvent

I want to Lapper filtered (not recorded in the database) results, some worse. For example, for BL1 @ XRG set limit 1.36.00, 1.35.94 then the result will be recorded as the result of 1.36.12 - ignored.
PS: Sorry for my English, i'm from Ukraine :rolleyes:

FGED GREDG RDFGDR GSFDG