The online racing simulator
Quote from rhodyracing :So can I assume that this file lfslapper.lpr is the main file for editing or adding text messages also??
MadDogRhody

Mainly, unless you make your own add-on.

The main commands for text messages are;

privMsg This puts a message for one specified (by script) driver in top left corner (where normal text/talk messages are displayed).
globalMsg Similar to above privMsg, but to all drivers.
privRcm This is the one that puts the large text in middle of screen, but only for one specified driver.
globalRcm Similar to above privRcm,but to all drivers.
openPrivButton Can be used to put text message (like a label) or a variable (like sector time) for one specified driver.
openGlobalButton Similar to above openPrivButton, but to all drivers.
RegisterScheduleAction This can be used to make a globalRcm at a specified time (e.g. midnight warning).
Does anyone know where in lapper.lpr you can add something like this?

!^1TEAM ^7RHODY ^4RACING^7

Welcome to Team Rhody Racing!
HTTP://RHODYRACING.COM
Close Racing and Fassst fun is our Goal.

Would also like a Countdown clock for between races..

Maybe just post the areas of lapper.lpr where I enter it???

Thanks in advance!

MadDogRhody
Does anyone know where in lapper.lpr you can add something like this?

!^1TEAM ^7RHODY ^4RACING^7

Welcome to Team Rhody Racing!
HTTP://RHODYRACING.COM
Close Racing and Fassst fun is our Goal.

Would also like a Countdown clock for between races..

Maybe just post the areas of lapper.lpr where I enter it???

Thanks in advance!

MadDogRhody
Lots of ways of doing what you want.

In the "welcome" message when you've joined server - look for the Event OnConnect part of the lapper script, then for openPrivButton( "welc",25,40,150,15,12,-1,0, langEngine("%{main_welc1}%", $NickName ));

This gives first line of welcome message.

In the Lang "EN" section, search for main_welc1 and change this message to what you want. For instance, I have:

main_welc1 = "^3Welcome {0} ^3to%nl%^1Sin'rs ^3(^1Sin^3anju^1'^3s ^1r^3acing ^1s^3erver)";

where {0} will be the username of the driver (already set up in the script), and %nl% just means new line.

So yours could be;

main_welc1 = "^3Welcome {0} ^3to%nl%^1TEAM ^7RHODY ^4RACING%nl%^7HTTP:RHODYRACING.COM%nl%^7Close Racing and Fassst fun is our Goal";

(not sure if lapper will be happy with the : after HTTP - you'd have to check it).

Or you could just make a sort of logo, and put it in a button (either private or global button), and decide if you want to show it all the time, or just for limited time (all the time you should make global and a fixed number of seconds make private button) - plenty of examples of openPrivbutton and openGlobalbutton text.

For instance, under Event OnNewPlayerJoin( $userName ) I have
openPrivButton( "label_lfslogo",5,181,21,4,1,-1,128,langEngine( "%{label_lfslogo}%" ));

and under Lang "EN", I have label_lfslogo = "^7powered by ^3LFSLapper";

See attached image to see what I mean by welcome message and logo.

(I know my logo looks like a contradiction - a private button with -1 (no time limit), but I close the button in different circumstances, so its not always on).

Or you could make a message that appears every so often like the midnight warning message, which is done via RegisterScheduleAction( "0 0 0 * * * *", SA_mid ); and sub-routine Sub SA_mid() and Lang "EN" line main_midnight = "Midnight warning to all working men!";
Attached images
LFS Text.png
Quote from rhodyracing :Would also like a Countdown clock for between races..
MadDogRhody

Look in the doc folder part of the installed lapper files for file called changes.txt, then search for 'Changes from v5.824 to 5.825', then (%cpt%).

The example is
example:
openPrivButton( "clos",78,120,20,10,10,10,32,"Accept(%cpt%)",OnConnectClose );

write a count down button in the screen
Accept(10)
Accept(9)
...
Accept(0)
Close the button and do action

where the 2nd last number is the time you count down from.

In your instance, you would need to use a global button, and the sub-routine (action) would be to restart race. Something like cmdLFS("/msg restart")
Almost!
Now I get this error??

Syntax error in cfg file Need a item identification on file : "LFSLapper.lpr" at line #1313

I will attach my lfs.lpr file maybe you can help fix it??

Thank you for all you have done here so far! We are getting closer!
Attached files
LFSLapper.rar - 17.7 KB - 292 views
Quote from rhodyracing :Now I get this error??

Syntax error in cfg file Need a item identification on file : "LFSLapper.lpr" at line #1313

I will attach my lfs.lpr file maybe you can help fix it??

Thank you for all you have done here so far! We are getting closer!

i hope i fixed it.
there was something wrong in the overriding options

u had this:
main_welc1 = "^2Welcome {0} ^2to%nl%^1TEAM ^7RHODY ^4RACING! ^1Close ^7Racing ^4and ^1Fassst ^7fun ^4is ^1our ^7Goal^1!";
! %nl%^2Type ^4!help ^4after leaving garage to see commands.";

it must be like this

main_welc1 = "^2Welcome {0} ^2to%nl%^1TEAM ^7RHODY ^4RACING! ^1Close ^7Racing ^4and ^1Fassst ^7fun ^4is ^1our ^7Goal^1!%nl%^2Type ^4!help ^4after leaving garage to see commands.";

Attached files
LFSLapper.rar - 17.7 KB - 284 views
Errors
Hi again...

Ok well that fix it a little bit now here is what I have.

See attached photo. Looks like the text is running over other text.
Or just connect to my racing server you will see what i mean.
Team Rhody Racing USA 1

If you could edit the lapper.lpr in the last post that would be great!

Thank you again!

Attached images
LFS 2010-10-04 20-46-35-79.jpg
Seaching
Looked all over lapper.lpr for this:

Clean racing and have fun ;o)

I want to change that, it comes up just before the race starts..

Any Ideas where thats hiding???
Quote from rhodyracing :Looked all over lapper.lpr for this:

Clean racing and have fun ;o)

I want to change that, it comes up just before the race starts..

Any Ideas where thats hiding???

That's in the OnRaceStart event:


### At race start sub event ORS is executed
Event OnRaceStart( $NumP ) # Lapper event
DelayedCommand( 5, ORS );
EndEvent

### Sub event ORS displays the message set main_brake
Sub ORS()
IF ( $enable_pitboard == "true" )
THEN
OnRaceStart_Pitboard();
ELSE
globalRcm( langEngine( "%{main_brake}%" ) );
ENDIF
EndSub

### main_brake in Lang "EN" section
main_brake = "^3Please, brake in time!";

Quote from rhodyracing :See attached photo. Looks like the text is running over other text.

You've already been given the information on this...

Quote :.... and %nl% just means new line.

So yours could be;

main_welc1 = "^3Welcome {0} ^3to%nl%^1TEAM ^7RHODY ^4RACING%nl%^7HTTP:RHODYRACING.COM%nl%^7Close Racing and Fassst fun is our Goal";

Your text is just one big line - split it up by putting %nl% where you would want one line to end and another to start. Don't put any other punctuation in the line.

========================================================

I think you need to know how to make buttons - this something I posted a while ago...

openPrivButton( "drewpitleave05",50,12,100,10,10,1,32,"^1R E M E M B E R !" );

Buttons and what your line means
openPrivButton is for only driver to see, as against opening a global button for all to see (such as you'd get when race just about to start, etc)
drewpitleave05 is unique button id
50 left out of 200
12 down from top out of 200
100 is width of button
10 is height of button
10 is spacing in multiline text
1 is time in seconds button will appear (use -1 if you don't want button to disappear - or use sub routine to close it)
32 is the background colour and orientation (clear, light or dark, with text left, centred or right)
^1 is the colour of the text on the button (in this case Red [see LFSlapper.lpr file for info on what colour is which])
! REMEMBER is the text that will appear on button.

So if you want button (or in this case, proper word would be label) to appear for 5 seconds, you would have

openPrivButton( "drewpitleave05",50,12,100,10,10,[B][COLOR=Red]5[/COLOR][/B],32,"^1R E M E M B E R !" );

Quote from rhodyracing :Looked all over lapper.lpr for this:

Clean racing and have fun ;o)

I want to change that, it comes up just before the race starts..

Any Ideas where thats hiding???

If you are using ver 6.011 you will find that statement in \includes\pitboard.lpr
How to $IdleExclude = from admin.txt

<?php 
##################################
#Options for idle player on track#
##################################
#$IdleExclude = "Lagamel,Gai-Luron"; # Usernames excluded for idle check
$OnIdleTimeout1 20# Idle timeout for OnIdleAction1 in seconds
Event OnIdle1$userName # Player event
privMsglangEngine"%{main_idle1}%" ) );
EndEvent
$OnIdleTimeout2 
30# Idle timeout for OnIdleAction2 in seconds
Event OnIdle2$userName # Player event
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
privMsglangEngine"%{main_idle2}%" ) );
EndEvent
?>


How would I change $IdleExclude = "Lagamel,Gai-Luron";
to read list from a txt file instead?
Assuming text file is admin.txt in default.

Finally worked out the answer, so I thought I'd post my working code for others to see.

<?php 
##################################
#Options for idle player on track#
##################################

#$IdleExclude = "names here"; # Usernames excluded for idle check

$OnIdleTimeout1 20# Idle timeout for OnIdleAction1 in seconds

Event OnIdle1$userName # Player event
    
privMsglangEngine"%{main_idle1}%" ) );
EndEvent

$OnIdleTimeout2 
30# Idle timeout for OnIdleAction2 in seconds

Event OnIdle2$userName # Player event
    
UserGroupFromFile"admin""./admin.txt" );
    
$UserName GetCurrentPlayerVar("UserName");
    IF( 
UserInGroup"admin",$UserName ) == )
    
THEN
    privMsg
"^3You have admin status and wont be kicked ;)");
    ELSE
    
cmdLFS"/spec " GetCurrentPlayerVar("UserName") );
    
privMsglangEngine"%{main_idle2}%" ) );
    ENDIF
EndEvent
?>


I have set my voting variables to


<?php 
 
$InRaceLapsVoteMinMax 
"0-0";
$VoteRestart = -1;
 
Event OnVoteRestartChange($PlayerOnTrack$Vote $Need# Lapper Event
 
openGlobalButton"bargr1",60,1,10,6,6,30,96,langEngine"%{main_vote_restart1}%"));
 
openGlobalButton"bargr2",70,1,20,6,6,30,96,langEngine"%{main_vote_restart2}%",$Vote,$PlayerOnTrack,$Need ) );
EndEvent
Event OnVoteRestartReach
($PlayerOnTrack$Vote $Need# Lapper Event
 
closeGlobalButton"bargr1&bargr2" );
EndEvent
Event OnVoteRestartZero
() # Lapper Event
 
closeGlobalButton"bargr1&bargr2" );
EndEvent
?>


But players can still vote to restart.

I also tried


<?php 
 
$InRaceLapsVoteMinMax 
"-2";
?>

Players still able to vote after lap 3 had started.
What have I done wrong?
How to convert LapTime into a number?
I'm trying to divide a number (the driftscore) by the amount of time it takes to do a lap, but I can't divide this number by the lapper laptime output.

If I do


<?php 
Event OnLap
$userName # Player event

     
globalMsglangEngine"%{main_n2m_msg}%" GetCurrentPlayerVar("NickName"), GetCurrentPlayerVar("Car"),NumToMSH(GetCurrentPlayerVar("LapTime"))));

EndEvent
?>


And use


<?php 
Lang 
"EN"
main_n2m_msg "DEBUG: Your Laptime {0} in a {1} is: {2}";       # debug message
EndLang
?>


This will output something like

DEBUG: Your Laptime Sinanju in a UF1 is: 1.22.23


So I know that NumToMSH(GetCurrentPlayerVar("LapTime") is working properly, but if I get an output where

$laptime = NumToMSH(GetCurrentPlayerVar("LapTime")

I can't divide by the $laptime answer.

And I can't use

GetCurrentPlayerVar("LapTime");

or
MSHToNum(GetCurrentPlayerVar("LapTime"));

as these both restart lapper.

So, how can I automatically convert something like 1.22.23 into 82.23 (or 0.59.23 into 59.23 or 2.22.23 into 142.23, etc)?

Thinking maybe something like


<?php 
If (NumToMSH(GetCurrentPlayerVar("LapTime")) > "0.59.99")

THEN

....multiply first part of laptime x 60 then add other part of laptime (e.g.2.59.99 => ((2*60)+59.99) => (120+59.99) = 179.99)

ELSE

....
strip first digit and fullstop (0.59.99 59.99#maybe something to do with stringlength?

ENDIF
?>

Hi sin,

Assuming all you really need to do is get laptime in seconds only, then this works in lapperver6.011 for me.


<?php 
 
$lpt 
= (GetCurrentPlayerVar("LapTime")); #make  value of $lpt = raw laptime from DB and
$lptis $lpt/1000;        # convert $lpt into time in seconds only with 2 decimal places.
                            # and store as $lptis
?>

eg. laptime is 1.21.83 and has raw value of 81830 then divide by 1000 to get 81.83

Hope that helps
Thanks for that, but it wouldn't work with version 5.926, which I am restricted to on my server.

However, had a brainwave (of a sort)


<?php 
  $LT 
NumToMSH(GetCurrentPlayerVar"LapTime" ));
  
$LP = (MSHToNum($LT)/1000);
?>

Although I couldn't use $LP = GetCurrentPlayerVar( "LapTime" )); by itself, getting it in proper (NumToMSH) format, then asking for format to be put back into a number (MSHToNum) worked.

EDIT
Using your 'divide by 1000' makes number more managable!
There's always a solution, glad you found yours.
-
(Deejayyaj) DELETED by Deejayyaj
i can not run this program .
what i do ?
error on connect to server DEF1 127.0.0.1/29999
why ?
help plz
Quote from ardalan5090 :i can not run this program .
what i do ?
error on connect to server DEF1 127.0.0.1/29999
why ?
help plz

are you connecting to the right IP?
you have it set to local IP...

Also, make sure in LFS(on the server LFS) you type /insim 29999)
Quote from Fire_optikz001 :are you connecting to the right IP?
you have it set to local IP...

Also, make sure in LFS(on the server LFS) you type /insim 29999)

i cant make it running on gaming solutions machine, but running on my own computer whit same ip, crazy thing, can anyone help me?
-
(khakans) DELETED by khakans
i want one command to End the Race, change the track and load a layout after, how to do this?
CASE "!command":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
cmdLFS( "/end" )
Thread.Sleep(4000)
cmdLFS( "/track BL3" )
Thread.Sleep(10000)
cmdLFS( "/axload layout" );
ENDIF
BREAK;

This doesnt work :-S

Also how to add a Private chat regarding Nicknames? E.g. [TEAM]Michi119 and [TEAM]XYZ should be able to read the message when someone writes "!team test" :-S
Next Problem: Making Admin-Help only visible for admins :S
Quote from m1chi119 :i want one command to End the Race, change the track and load a layout after, how to do this?
CASE "!command":
IF ( UserIsAdmin( $userName ) == 1 )
THEN
cmdLFS( "/end" )
Thread.Sleep(4000)
cmdLFS( "/track BL3" )
Thread.Sleep(10000)
cmdLFS( "/axload layout" );
ENDIF
BREAK;

This doesnt work :-S

Also how to add a Private chat regarding Nicknames? E.g. [TEAM]Michi119 and [TEAM]XYZ should be able to read the message when someone writes "!team test" :-S
Next Problem: Making Admin-Help only visible for admins :S

if i remember correctly there is currently to make lapper sleep... what you could do though is make it so it calls a timer or you could edit the source and add a sleep function yourself

i have the code somewhere where you can send team members messages... i will find it asap
Quote from Fire_optikz001 :if i remember correctly there is currently to make lapper sleep... what you could do though is make it so it calls a timer or you could edit the source and add a sleep function yourself

i have the code somewhere where you can send team members messages... i will find it asap

how to do the thing with timer? :-S sry, i am kinda new to C# :-D
Done with trackchange - changed ctrack code as needed and added + included as new file :-)


does the code check for a Group or does it check the Nickname for a special tag? :-)

And, how to make special parts of Help only visible to special groups? :-S
Quote from m1chi119 :how to do the thing with timer? :-S sry, i am kinda new to C# :-D
Done with trackchange - changed ctrack code as needed and added + included as new file :-)


does the code check for a Group or does it check the Nickname for a special tag? :-)

And, how to make special parts of Help only visible to special groups? :-S

LFSLapper is not C# ... the base is C# but the actual code in the LPRs is GLScript... something that Gai made up...
This thread is closed

Config help
(1112 posts, closed, started )
FGED GREDG RDFGDR GSFDG