The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
Quote from LFSCruise :Is it possible to make each player to show only those cars which he has have?

As
ISP_PLC, // 53 - instruction : player cars

Very soon it will be..watch the forums
Krayy
S2 licensed
Download the source from the link in the releases thread to get the source code and project files to build it.
Krayy
S2 licensed
Quote from LFSCruise :And how is it to edit the button? And what scriptFunctions.cs file?

If you don't know how to edit the source of Lapper using Visual C#, then you won't be able to modify it.

What exactly do you want to do?
Krayy
S2 licensed
Quote from LFSCruise :Can you tell me where to find myConfig Sub?

<?php 
CASE "!myconfig":
            
myConfig( );
            BREAK;
?>


myConfig is actually an internal command to Lapper which is defined in the scriptFunctions.cs file. It's not the best place to be as it's functionality can be emulated using the storedvalues functions.
Krayy
S2 licensed
Quote from Vukas91 :I have no admin.txt file.
If you mean that I have to make it.

I made it and put in my username(just my username) and nothing happens.

Where did you put the admin.txt file, because it should be in something like c:\LFSLapper\<your lapper instance name> eg. c:\lfslapper\default

Also put your lfs username into the superusers.txt file in the same directory
Krayy
S2 licensed
Quote from Vukas91 :I've tried that '!zone' command.
Nothing happens.

Make sure that you are an admin by putting your LFS username in the admin.txt file in the lapper instance directory (same dir as the LFSLapper.lpr file)
Krayy
S2 licensed
This IS the insim that gives you changeable clipping points. Zones can be used to simulate clipping points on corners, although you need to be careful with their placement as they are a circle from point X,Y with a radius of i.

Basically what you need to do is (with Lapper running), drive around the course to the corner that you want to set the clipping point at. Position your vehicle on the grass, ripple strip or wherever teh centre of your clipping circle will be (use the V key to cycle through until you are in top down view to make sure you are placed correctly). Use the "!zone" command to display what the x and y coords are (in the screenshot i'm at x=236, y=447).

Now you can use the RegisterZoneAction to create an event for when someone hits the clipping point.


<?php 
RegisterZoneAction
"Clip1""BL1" 236447EnterClip1ExitClip1 );
?>

This creates a zone that is 6 units in diameter (radius = 3) and the 2 params at the end are the functiosn taht are called when a racer enters the zone.

have a play with that and see what you can do.
Last edited by Krayy, .
Anyone actually using Lapper on Linux?
Krayy
S2 licensed
Hi guys,

I'm just doing a quick poll to see if there's anyone out there running Lapper on a Linux host as their platform of choice. This is just to determine ongoing demand for this functionality as some of the later .NET functions or resource DLLs might not be available in Mono.

So let us know what you're running.
Krayy
S2 licensed
In that case you'll need to wait for an upcoming version that contains that functionality. It shouldn't be too long in coming though as I have some of that in a different branch for our servers and will submit it in the next couple of weeks for inclusion in the next lapper.
Krayy
S2 licensed
So you only want to get a count of unique players who had ever joined your server, or do you want their names as well?

Alos what about last logon date or other stats?
Krayy
S2 licensed
In it's current state, Lapper I'm not sure that Lapper can do what you need. Can you give us some examples of how you would use this table in a Lapper script and then I can see if I can figure out a way for it to what you need.

The SetPlayerVar command requires you to specify a Player name, otherwise it defaults to the current player, so getting a whole list of player names is not possible using that method.
Krayy
S2 licensed
Theres a long winded explanation for this, but I'll try and kep it short.

When Lapper starts it reads in all of the .lpr files and others that have been included form say the addonsuser.lpr file. After it has read all the files, it goes through them and starts assigning any variables that are outside of any functions or events and this includes the OnIdleTimeout1 & 2 along with a whole host of others listed below the fixed code.

Events and functions get read after this has occured, so when you try and run this:

<?php 
    $OnIdleTimeout1 
$TimeIdleWarning;  # Idle timeout for OnIdleAction1 in seconds
?>

The OnLapperStart Event has not been read, so $TimeIdleWarning has not yet been defined. lapper then thinks you're assigning a blank to OnIdleTimeout1 which will error. The answer is to move the assignments of these variables into an event or function that will assign a new value to it after the initial one like this:


<?php 
$OnIdleTimeout1 
120# Idle timeout for OnIdleAction1 in seconds
$OnIdleTimeout2 240# Idle timeout for OnIdleAction2 in seconds

CatchEvent OnLapperStart()
    
GlobalVar $Idlesystem;
    
GlobalVar $TimeIdle;
    
GlobalVar $TimeIdleWarning;
    
GlobalVar $IdleAction;

    
$Idlesystem "on";                   
    
$TimeIdle 600;
    
$TimeIdleWarning 540;
    
$IdleAction "spec";

    
$OnIdleTimeout1 $TimeIdleWarning;  # Idle timeout for OnIdleAction1 in seconds
    
$OnIdleTimeout2 $TimeIdle# Idle timeout for OnIdleAction2 in seconds
EndCatchEvent
?>


The top 2 variables are global and need to have a valid integer. The CatchEvent then assigns new values to those variables. Note that you can reassign those values in any function, not just OnLapperStart, so you can write your own command to set the variables if you want.

These variables are defined outside of any function and initially need to have a valid string or integer argument:

<?php 
    enum configVarReadWrite
    
{
        
adminfile,
        
adminemail,
        
smtpserver,
        
loginmail,
        
passmail,
        
messagetime,
        
showplayercontrol,
        
defaulttopcar,
        
swearwordslist,
        
swearwordsmax,
        
handicapusers,
        
swapside,
        
autogears,
        
shifter,
        
helpbrake,
        
axisclutch,
        
autoclutch,
        
mouse,
        
kbnohelp,
        
kbstabilised,
        
customview,
        
votelifesec,
        
voterestart,
        
votequalify,
        
voteend,
        
autorestartracesec,
        
autorestartonfirstfinished,
        
rotateeverynbraces,
        
enablerotation,
        
rotatetracks,
        
rotatecars,
        
showsplitpb,
        
refreshqualusers,
        
qualusers,
        
maxfloodlines,
        
maxfloodlinestime,
        
maxsessionlaps,
        
minanglevelocity,
        
maxnbinstunt,
        
maxallowedlaptime1,
        
maxallowedlaptime2,
        
onidletimeout1,
        
idleexclude,
        
onidletimeout2,
        
gooddriftscore,
        
minimumdriftscore,
        
minimumdriftspeed,
        
minimumdriftangle,
        
maximumdriftangle,
        
accelerationstartspeed,
        
accelerationendspeed,
        
accelerationstartspeedmph,
        
accelerationendspeedmph,
        
accelerationprivatemaxtime,
        
maxfastdriveonpit,
        
pitwindowstart,
        
pitwindowstop,
        
maxcarresets,
        
reordergrid,
    }
?>

Krayy
S2 licensed
Download SQLlite Admin so that you can open the database file and look at its contents. Then you should be able to use that information to craft your SQL queries using the sqlite php library.

The database schema is pretty simple. You're looking for the fi_user_value table which has the following schema:


<?php 
CREATE TABLE fi_user_value 
(
    
idUserValue INTEGER PRIMARY KEY  NOT NULL DEFAULT '',
    
key CHAR50 ),
    
userName CHAR20 ),
    
nickName CHAR20 ),
    
nickNameStripped CHAR20 ),
    
numval INTEGER,
    
strval CHAR(50)
)
?>

Cash, Distance and Health will be entries that can be queried using the key (in game Variable Name) and userName fields.
Krayy
S2 licensed
Quote from Bass-Driver :hi

how do i convert a variable to a integer??
i have tried ToInt($TimeIdleWarning) but that didnt work.

The correct function is ToNum, not ToInt e.g.:


<?php 
 $OnIdleTimeout1 
ToNum($TimeIdleWarning);
?>

Remember that there is an OnIdleTimeout2 var as well.
Krayy
S2 licensed
Quote from Vukas91 :Does 'complex drift scoring' script exist ?
I mean 'drift scoring' with clipping points.

Clipping points arent supported unless you put them in. What you could do is create specific zones on each track that represent the clipping points. To do this, use the !zone command to se what the x and y co-ordinate is for the position, then use the following command to set an action to take:


<?php 
RegisterZoneAction
"BL1" , -60,106FuncOnEnterFuncOnExit);
?>

The third numeric parameter is the distance from the x/y co-ord to use to execute, so make it low for right on the point, or large for an approximation.

Check some of the cruise stuff for how to use zones
Krayy
S2 licensed
Quote from T3charmy :Alright, I received a reply back from Gai, He said that I could Continue development on this for now, for now, I plan to just keep it simple as possible such as adding access to new packets! (If you don't hear back from me in the next few hours... I have probably given up...

Edit: looking on how to add new packets now so...

I've already added collisions and admin packet processing in a forked build if you need it.
Krayy
S2 licensed
Quote from Bass-Driver :hi

In which file can i find: drfNear( ) and drf( ); function

LFSClient\scriptFunctions.cs, but they call the TopDrift function in the LFSClient\cmdLapper.cs file, just with different parameters.
Krayy
S2 licensed
Here's an oldie but a gooide...the GetListOfPlayers function returns an array that only contains the player vars that are strings. Replace the code for the function below and it will include numeric fields as well as strings.

In scriptFunctions.cs:

<?php 
        
public void getlistofplayers(GLScript.unionVal valArrayList args)
        {
            
string ident val.nameFunction;
            
ArrayList lply = new ArrayList();
            
            
val.typVal GLScript.typVal.setOfVar;
            
val.setVars = new GLScript.SetOfVars( );
            foreach (
DictionaryEntry de in listOfPlayers.playersUCID)
            {
                
InfoPlayer CI = (InfoPlayer)de.Value;
                if (
CI.UCID == 0)
                    continue;
                
lply.Add(new LOP(CI.userNameUtils.stripLFSColorCI.nickName )));
            }
            
lply.Sort(new sortByUName());
            if (
args.Count == 1)
            {
                
string sort = (string)args[0];
                if (
sort.ToLower() == "n")
                    
lply.Sort(new sortByNName());
            }
            for (
int i 0lply.Counti++)
            {
                
val.setVars.Set(i.ToString(), new GLScript.unionVal(0Utils.quote((lply[i] as LOP).userName), GLScript.typVal.str));
            }
        }
?>

Krayy
S2 licensed
Quote from Yisc[NL] :Don't want to sound impatient, but any news on the array fix and maybe other fixed / addons?

There was, but it'll be easier to use the GetListofPlayers function.

I'll look at it when I get a bit more time from updating my Lapper for a series we're starting
Krayy
S2 licensed
Sounds good
Krayy
S2 licensed
Yep, because they are overriding the first line
Quote from sinanju :Do you mean remove the last 3 lines from the 4 in the file?

AU1,Autocross,Autocross Autocross,0
AU1,Autocross,Autocross Skid Pad,0
AU1,Autocross,Autocross Drag Strip,0
AU1,Autocross,Autocross 8 Lane Drag,0

Krayy
S2 licensed
Quote from sinanju :Not sure if it's a lapper issue or due to the recent LFS updates, but my lapper scripts now showing error with AU1 track.

Long Track Name [Short Track Name] should give me AutoCross [AU1], instead it gives me Autocross 8 lane drag [AU1].

Code extract

<?php 
getLapperVar
("LongTrackName"),getLapperVar("ShortTrackName"),
?>

Can anyone check if they're having same problem?

Remove the extra AU1 line from the trackList.cfg file in your main Lapper directory
Krayy
S2 licensed
Actually the IS_NPL packet that gets sent when a player joins the race does allow for checkking if the player has ABS or Traction Control enabled:


<?php 
// Setup flags (for SetF byte)
#define SETF_SYMM_WHEELS    1
#define SETF_TC_ENABLE        2
#define SETF_ABS_ENABLE        4
?>

It's just that Lapper ignores this value in it's code:


<?php 
            
public NPL(byte[] pak)
            {
                
PLID pakGetBytepak3);
                
UCID pakGetBytepak);
                
PType pakGetBytepak);
                
Flags pakGetWord(pak6);
                
nickName pakGetString(pak824);
                
Plate pakGetString(pak328);
                
CName pakGetString(pak404);
                
SName pakGetString(pak4416);
                
TyreRearLeft = (tyre)pakGetByte(pak60 );
                
TyreRearRight = (tyre)pakGetByte(pak61);
                
TyreFrontLeft = (tyre)pakGetByte(pak62);
                
TyreFrontRight = (tyre)pakGetByte(pak63);
                
H_Mass pakGetByte(pak64);
                
H_TRes pakGetByte(pak65);
                
Pass pakGetByte(pak67);
// SetF should be read here!!!!
                
NumP pakGetByte(pak73);
            }
?>

Maybe in a future version. I use a heavily modified Lapper code base, and will probably enable this later on.
Krayy
S2 licensed
Comment out the lines in the OnPB event:


<?php 
Event OnPB
$userName # Player event
#    globalMsg( langEngine( "%{main_onnewpb}%" , GetCurrentPlayerVar("NickName"), GetCurrentPlayerVar("Car"),NumToMSH(GetCurrentPlayerVar("LapTime")) ) );
#    globalMsg( langEngine( "%{main_onnewpb_rank}%" ,GetCurrentPlayerVar("PosAbs") ) );
    
privMsglangEngine"%{main_onnewpb_sesslaps}%" GetCurrentPlayerVar("SessLaps") ) );
    
privMsglangEngine"%{main_onnewpb_servlaps}%" GetCurrentPlayerVar("Laps") ) );
    
privMsglangEngine"%{main_onnewpb_avgspeed}%" ,ToPlayerUnitGetCurrentPlayerVar("AvgSpeed") ),GetCurrentPlayerVar("UnitSpeed") ) );
    
privRcm(  langEngine"%{main_onnewpb_rank2}%" ,GetCurrentPlayerVar("Car"),GetCurrentPlayerVar("PosAbs") ) );
EndEvent
?>


Krayy
S2 licensed
That message also appears if you have a type in one of your LPR scripts. Check the error logs to see if there is an error e.g:


<?php 
6
/3/2011 4:26:28 PM -> Syntax error in cfg file "./cif/config_event.lpr" at line #179
    
'THEN' needed
    
Function 'raceeventinit' script aborted
?>


means I had a syntax error in my raceeventinit.lpr script on line 179
FGED GREDG RDFGDR GSFDG