The online racing simulator
LFSLapper insim4 Release
(2101 posts, closed, started )
hallo,

it means something to store users divergent variables, like 1D array

$array[1] = 1;
$array[2] = 123;

... etc, where inside of brackets is username (string) identifier instead of number, this is i belive correct method used in C as well in JavaScript etc.:

$array["Scawen"] = 1;
$array["Victor"] = 123;

to store into variable $array[]; - if (for exapmple) username Victor tried to join 123 times in race... variable $array[] to store if colects 123 points... or variable $array_swearwords[]; to store his overall swearwords... etc.


thanx for support!

dnine


Quote from Yisc[NL] :I'm not totaly sure I understand what you want but I think that's possible already. You could use a FOR or WHILE loop and add actions to that when some criteria are met. Maybe you could try it or give a more detailed example.

Quote from Andy King :Hi Yisc,
Still no joy, heres the full code and its in OnConnect....

openPrivButton( "pos",55,66,90,10,8,-1,32,"^3Your Current Ranking on this Server is ^6" . $Posabs . "&^3Your Personal Best ^3at ^6" . $CurrTrack . " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" )) . "& &^3Type ^6!help ^3to see all Server Commands&^3Type ^6$next ^3to view our Event Calendar& &^2Website - ^3http://www.AKM-Racing.co.uk");

That chucks an error when starting Lapper.exe

You forgot to define $CurrTrack


$CurrTrack = GetLapperVar ( "ShortTrackName" );

openPrivButton( "pos",55,66,90,10,8,-1,32,"^3Your Current Ranking on this Server is ^6" . $Posabs . "&^3Your Personal Best ^3at ^6" . $CurrTrack . " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" )) . "& &^3Type ^6!help ^3to see all Server Commands&^3Type ^6$next ^3to view our Event Calendar& &^2Website - ^3http://www.AKM-Racing.co.uk");

Besides that I think dat $next should be !next
-
(Gai-Luron) DELETED by Gai-Luron
Quote from [d9] :...
$array[1] = 1;
$array[2] = 123;

... etc, where inside of brackets is username (string) identifier instead of number, this is i belive correct method used in C as well in JavaScript etc.:

$array["Scawen"] = 1;
$array["Victor"] = 123;

...

Yes you can do this, but you can't have an array with multiple dimensions combined

$ar[1] = 12;
$ar[1,1] = 12;

Error on execution

if you want use the same name array, you must unset var before

$ar[1] = 12;
$unset( $ar );
$ar[1,1] = 12;

Correct but $ar[1] is lost

Gai-Luron


PS: All built-in variable ( $userName, $TrackName, $PBLtime, etc... ) for the previous version can be retreived with
GetCurrentPlayerVar()
GetPlayerVar();
GetLapperVar()
ConfVar["name_of_conf_var"];
Hi Gai,
I am getting a massive error from Lapper.exe using the following..

openPrivButton(
"pos",55,66,90,10,8,-1,32
,"^3Your Current Ranking on this Server is ^6" . GetCurrentPlayerVar( "Posabs" )
. "&^3Your Personal Best ^3at ^6" . GetLapperVar( "CurrentTrackName" )
. " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" ) )
. "& &^3Type ^6!help ^3to see all Server Commands&^3Type ^6$next"
. "^3to view our Event Calendar& "
. "&^2Website - ^3http://www.AKM-Racing.co.uk"
);

If I comment out the . " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" ) ) line it works OK without the PBLapTime
Quote from Gai-Luron :Yes you can do this, but you can't have an array with multiple dimensions combined

$ar[1] = 12;

thanx, well

$ar[$UserName] = 12;

will work?

dnine
Quote from Andy King :hi Gai,
Could an import feature be introduced as very reluctant to loose nearly 2000 drivers stats.

How do I get PBLapTime to display as its showing 104090 and not my PB

Put the same name of the old PB file in gripDatabase config without extension. Put your old file, with .txt in the same directory as Lapper. Launch Lapper.

Example:
Old Dbs is myDBS.txt

in config file put

$gripDatabase = "myDbs";

Launch LFSLapper, normally your base will be imported

Gai-Luron
Quote from [d9] :thanx, well

$ar[$UserName] = 12;

will work?

dnine

Normally, yes ^^
Quote from Andy King :Hi Gai,
I am getting a massive error from Lapper.exe using the following..

openPrivButton(
"pos",55,66,90,10,8,-1,32
,"^3Your Current Ranking on this Server is ^6" . GetCurrentPlayerVar( "Posabs" )
. "&^3Your Personal Best ^3at ^6" . GetLapperVar( "CurrentTrackName" )
. " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" ) )
. "& &^3Type ^6!help ^3to see all Server Commands&^3Type ^6$next"
. "^3to view our Event Calendar& "
. "&^2Website - ^3http://www.AKM-Racing.co.uk"
);

If I comment out the . " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" ) ) line it works OK without the PBLapTime

I already solved your problem, see a few post up or the code below


$Posabs = GetCurrentPlayerVar("Posabs");
$CurrTrack = GetLapperVar ( "ShortTrackName" );

openPrivButton( "pos",55,66,90,10,8,-1,32,"^3Your Current Ranking on this Server is ^6" . $Posabs . "&^3Your Personal Best ^3at ^6" . $CurrTrack . " ^3is ^6" . NumToMSH(GetCurrentPlayerVar( "PBLapTime" )) . "& &^3Type ^6!help ^3to see all Server Commands&^3Type ^6$next ^3to view our Event Calendar& &^2Website - ^3http://www.AKM-Racing.co.uk");

Hi Yisc,
You haven't as I had already defined...

$Posabs = GetCurrentPlayerVar("Posabs");
$CurrTrack = GetLapperVar ( "ShortTrackName" );

and am still getting this error. Its showing Trackname and Posabs fine the only issue is its not showing PBLapTime like 1.42.05 its just showing a 7 didgit number like 3600000.

Update: Even defining like this....
$CurrPBLapTime = NumToMSH(GetCurrentPlayerVar( "PBLapTime" ));

Chucks an error also
Quote from Andy King :Hi Yisc,
You haven't as I had already defined...

$Posabs = GetCurrentPlayerVar("Posabs");
$CurrTrack = GetLapperVar ( "ShortTrackName" );

and am still getting this error. Its showing Trackname and Posabs fine the only issue is its not showing PBLapTime like 1.42.05 its just showing a 7 didgit number like 3600000.

Update: Even defining like this....
$CurrPBLapTime = NumToMSH(GetCurrentPlayerVar( "PBLapTime" ));

Chucks an error also

Then your problem is somewhere else.
I just copy/paste my code again and see the result in attached screenshot.
Attached images
Image1.png
Hi Yisc,
Cheers I was affraid you was gonna say that damm damm damm lol

Thanks for your input.
Quote from Andy King :Hi Yisc,
Cheers I was affraid you was gonna say that damm damm damm lol

Thanks for your input.

No problem.
I had to follow the Lapper 5.8x university so I should know what I'm doing
Hi Yisc,
Even with default Lapper.lpr as soon as I add NumToMSH its throws errors still.

Can you mail me your Lapper.lpr with my OnConnect message added that works on your machine to try here.
Hello,

Can you post the error message?

Gai-Luron

PS: ADD in you on connect
WriteLine( "Username is " . GetCurrentPlayerVar( "UserName" ));
WriteLine( "PBLTime is " . GetCurrentPlayerVar( "PBLapTime" ));
WriteLine(" HMS( PBLTime ) is " . NumToMSH( GetCurrentPlayerVar( "PBLapTime" )));
And tell me what's is displayed on your console screen
Quote from Andy King :Hi Yisc,
Even with default Lapper.lpr as soon as I add NumToMSH its throws errors still.

Can you mail me your Lapper.lpr with my OnConnect message added that works on your machine to try here.

I've emailed you the file on your msn address.
Hi Gai and Yisc,
I have tried the Lapper.lpr you sent Yisc, I have added the lines Gai asked me to add and still getting error.

Here is the error report attached...

Error.txt

Hope this helps
Attached files
Error.txt - 4.1 KB - 259 views
I have a problem with the online PB stat page (from link in 1st post).

I can't set the Formula BMW, it also is not in def.txt ... any options to make it happen?


Page:

http://rielity.org/lfs/viewpb.php
Quote from Andy King :Hi Gai and Yisc,
I have tried the Lapper.lpr you sent Yisc, I have added the lines Gai asked me to add and still getting error.

Here is the error report attached...

Error.txt

Hope this helps

Try this new exe:
Attached files
LFSLapper.zip - 91.2 KB - 274 views
Hi Gai,
Fixed nice one matey, the new exe worked a treat.
can i just have the pitspotter? and not the other stuff???
Quote from whitey6272 :can i just have the pitspotter? and not the other stuff???

I think, you are Lost here . Go to LFSRelax Thread


Gai-Luron
Hi Gai & Yisc,
Got myself another problem, I have defined the following GlobalVars...

GlobalVar $WR_FXR;
$WR_FXR = "1.40.88";
GlobalVar $WR_FXR_25;
$WR_FXR_25 = $WR_FXR + "0.00.25";
GlobalVar $WR_FXR_50;
$WR_FXR_50 = $WR_FXR + "0.00.50";
GlobalVar $WR_FXR_75;
$WR_FXR_75 = $WR_FXR + "0.00.75";

Then when I call them they don't work, here is call coding....

If (GetCurrentPlayerVar("Car") == "FXR" && NumToMSH(GetCurrentPlayerVar("PBLapTime")) <= $WR_FXR_75 && NumToMSH(GetCurrentPlayerVar("PBLapTime")) > $WR_FXR_50 ) Then
cmdLFS("/msg " . GetCurrentPlayerVar("NickName") . " ^2= ^6" . GetCurrentPlayerVar("Car") . " ^3Class ^6A* ^3Licence");
Else

Its ignoring the $WR_FXR_75 and $WR_FXR_50

Update: It seems to be ignoring the +++ Plus Sign in GlobalVar

Any ideas guys
Hello, operation on Time are different now. All to be in numerical value. Do the correct conversion before do test.

GlobalVar $WR_FXR;
$WR_FXR = MSHToNum( "1.40.88" );
GlobalVar $WR_FXR_25;
$WR_FXR_25 = $WR_FXR + MSHToNum( "0.00.25" );
GlobalVar $WR_FXR_50;
$WR_FXR_50 = $WR_FXR + MSHToNum( "0.00.50" );
GlobalVar $WR_FXR_75;
$WR_FXR_75 = $WR_FXR + MSHToNum( "0.00.75");

...

If (GetCurrentPlayerVar("Car") == "FXR" && GetCurrentPlayerVar("PBLapTime") <= $WR_FXR_75 && GetCurrentPlayerVar("PBLapTime") > $WR_FXR_50 ) Then
cmdLFS("/msg " . GetCurrentPlayerVar("NickName") . " ^2= ^6" . GetCurrentPlayerVar("Car") . " ^3Class ^6A* ^3Licence");
Else
Quote from Andy King :Hi Gai & Yisc,
Got myself another problem, I have defined the following GlobalVars...

GlobalVar $WR_FXR;
$WR_FXR = "1.40.88";
GlobalVar $WR_FXR_25;
$WR_FXR_25 = $WR_FXR + "0.00.25";
GlobalVar $WR_FXR_50;
$WR_FXR_50 = $WR_FXR + "0.00.50";
GlobalVar $WR_FXR_75;
$WR_FXR_75 = $WR_FXR + "0.00.75";

Then when I call them they don't work, here is call coding....

If (GetCurrentPlayerVar("Car") == "FXR" && NumToMSH(GetCurrentPlayerVar("PBLapTime")) <= $WR_FXR_75 && NumToMSH(GetCurrentPlayerVar("PBLapTime")) > $WR_FXR_50 ) Then
cmdLFS("/msg " . GetCurrentPlayerVar("NickName") . " ^2= ^6" . GetCurrentPlayerVar("Car") . " ^3Class ^6A* ^3Licence");
Else

Its ignoring the $WR_FXR_75 and $WR_FXR_50

Update: It seems to be ignoring the +++ Plus Sign in GlobalVar

Any ideas guys

First you have to convert all values to MSH and then when the math is done, you have to convert them back.


GlobalVar $WR_FXR;
$WR_FXR = MSHToNum("1.40.88");
GlobalVar $WR_FXR_25;
$WR_FXR_25 = NumToMSH($WR_FXR + MSHToNum("0.00.25"));
GlobalVar $WR_FXR_50;
$WR_FXR_50 = NumToMSH($WR_FXR + MSHToNum("0.00.50"));
GlobalVar $WR_FXR_75;
$WR_FXR_75 = NumToMSH($WR_FXR + MSHToNum("0.00.75"));

This thread is closed

LFSLapper insim4 Release
(2101 posts, closed, started )
FGED GREDG RDFGDR GSFDG