The online racing simulator
[Solved] Insim button load problem
Ok so basically in:
Quote :Event OnNewPlayerJoin( $userName ) # Player event
EndEvent

I am putting in the following to add a logo in the bottom left:
Quote :openPrivButton( "logo",0,150,30,15,12,-1,16, langEngine("%{main_logo}%" ) );

The problem being that when you end the race it shows the logo part, but it doesn't show the racers menu's that would normally be there? Any help?

Thanks
with Shift+I you remove every insim button.
Quote from Bass-Driver :with Shift+I you remove every insim button.

Is there any way to hide it when it is in the END race menu? and show only when driving and outside of the pits?
You can choose to show and hide your "logo" using the EVENT ON... player events.

Very much like you are doing with the Event OnNewPlayerJoin... when you have your line

openPrivButton( "logo",0,150,30,15,12,-1,16, langEngine("%{main_logo}%" ) );

You could also have it appear at the end of each lap, as in Event OnLap..., or other events such as Event OnFinish.... or Event OnPit... or Event OnEnterPitLane..., etc.

You can also make your logo button close either by other events, such as Event OnExitPitLane... [where your code would be closePrivButton( "logo");] or Event OnSplit1..., etc.,
or even change your code slightly so that instead of using -1 for the time (meaning never end), you could put something like 8 (meaning logo would only show for 8 seconds before self closing).

Personally, I prefer logo only to be showing if spectating or in pits, and lots of drivers don't like things cluttering up their field of view when on track.
Ok Thanks!
Ok, so i am going to need two, an Open and a Close for the privbutton.

Is there an event for when a person is in their car, and when they are not? if not then i can do an IF?
Events that occur when player leaves track;

Event OnLeaveRace( $userName )
# Actions to execute when player spectates or disconnects (leaves race)

Event OnBeginPit( $userName )

Event OnPit( $userName ) # Player teleported to pit ( Shift + P )

Event OnEnterPitLane( $userName,$reason )

Event OnRaceEnd( ) # Lapper event generated when server returns to main menu, ending the race (CTRL-X vote)

Events that occur when player joins server and/or joins track;

Event OnConnect( $userName ) # Connect messages when a player joins the server

Event OnNewPlayerJoin # New PLayer joining race or leaving pits

Event OnRaceStart( $NumP )

Event OnQualStart( $NumP )

Event OnExitPitLane( $userName )


An event that is triggered by driving certain distance on track;

Event OnDistDone( $userName ) # Action when a predefined distance is done by player


If you have Krayy's latest V6.014, then drill down into /doc then open his Lapper Events.txt, you will see all the lapper events available.
Event OnNewPlayerJoin
openPrivButton( "logo",0,150,30,15,12,-1,16, langEngine("%{main_logo}%" ) );
EndEvent

Event OnRaceEnd( )
closePrivButton( "logo");
EndEvent

Ok, would this work? - I am new to insim and LFSLapper, great work by the way!


Ok, just had a try using the following code, but it doesn't work for some reason?

Quote :Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "logo",0,162,32,15,12,-1,32, langEngine("%{main_logo}%" ) );
EndEvent

Event OnRaceEnd( )
closePrivButton( "logo" );
EndEvent

/////////////////////////////////////////////////////////////////////////////////////////////////////////
I am also doing some editing on the PitBoard, i have changed the original co-ordinates for the pitboard and my aim is to remove the config page at the start. Is there a shortcut to go in OnNewPlayerJoin, to make it load, and one to go in the OnRaceEnd of course Thankss so much, been looking ages for it, there are close ones but no open ones. Thanks
I am the author of the Pitboard and people can change to co-ordinates of the Pitboard them selfs.
They can also configure wether they want to get the config page every time they enter the server or not.
I have attached Pitboar version 2.06B which I haven't released yet, but will release very soon, along with a bunch of other scripts I updated recently.
All build for and tested in LFS Lapper 6.014_b15
Attached files
pitboard.txt - 126.5 KB - 235 views
Ahh Thank you, will install that, what line is the config on for changing the coords and config settings in the new file?
There's no need to change co-ordinates in the script.
Just type !pbconfig to bring up the config screen.
Then you can set both top/bottom as left/right coordinates and press "Test position" to see if the new position is right for you.
You can also select wether you want the config screen to be shown on connect, do so under "Show config screen on connect".
Save the settings when you are done and that's it.
I mean, i want to set these defaults for all users?
Nevermind, got it, Thanks for the help! Let us know if you do any major updates?
Now that problem is solved, how about the original -

I have this code but it doesn't work

Quote :Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "logo",0,162,32,15,12,-1,32, langEngine("%{main_logo}%" ) );
EndEvent

Event OnRaceEnd( )
closePrivButton( "logo" );
EndEvent

Event OnRaceEnd( ) is a fairly new event that's been added to lapper, so it's not something I've used myself.

Try Event OnRaceEnd($userName) to see if that works.

If it doesn't, maybe try

Event OnSplit1( $userName )
closePrivButton( "logo" );
EndEvent

to see if logo disappears after 1st sector?
I have tried all 3, neither of them work? :L
Have you checked the log-file to see if any error is in there?
Lapper is good with reporting problems in there.

*edit*

I took a look at the Lapper script and found this:

Event OnRaceEnd( ) # Lapper event generated when server returns to main menu, ending the race (CTRL-X vote)

So this particular event, is only executed when people vote to end the race and go back to the main menu (to load a different track or so)

If you want to do something at the end of each race, you will have to use this event:

Event OnFinish( $userName ) # Player event
EndEvent

*edit 2*

With the following code (you made it your self) it is working:


Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "logo",0,150,30,15,12,-1,16, langEngine("%{main_logo}%" ) );
EndEvent

Event OnFinish( $userName ) # Player event
closePrivButton( "logo" );
EndEvent

Lang "EN"
main_logo = "^7D E B U G - D E B U G - D E B U G";
EndLang

The problem is that i need them to hide when people do /end or Shift+X, otherwise no options show on the new race page and I cant see what racers are on grid
Quote from lgrhacking :The problem is that i need them to hide when people do /end or Shift+X, otherwise no options show on the new race page and I cant see what racers are on grid

Because the "OnRaceEnd" event is a Lapper event, you can't use closePrivButton there.
Use the following code instead:


Event OnRaceEnd( ) # Lapper event generated when server returns to main menu, ending the race (SHIFT-X vote)
$mList = GetListOfPlayers("N");
$mCount = arrayCount( $mList );
$plyNum=0;

WHILE ($plyNum < $mCount)
$uName = $mList[$plyNum];
closeButton( $uName,"logo" );
$plyNum=$plyNum+1;
ENDWHILE
EndEvent

Thanks! I have used the following to close them all and they work perfectly
Quote :Event OnRaceEnd( ) # Lapper event generated when server returns to main menu, ending the race (SHIFT-X vote)
$mList = GetListOfPlayers("N");
$mCount = arrayCount( $mList );
$plyNum=0;

WHILE ($plyNum < $mCount)
$uName = $mList[$plyNum];
closeButton( $uName,"logo&info" );
closeButtonRegex ($uName, "rcm_*");
closeButtonRegex ($uName, "pitboard_*");
$plyNum=$plyNum+1;
ENDWHILE
EndEvent

New Problem:
How do i open them again? the Events onnewplayerjoin, onracestart, onqualstart and onpracstart, do not open the windows as soon as you join / do one of those events. I have to pit then join again? Thanks!!! Great Work!

edit:
the code to reopen:
Quote :openPrivButton( "logo",0,142,32,13,12,-1,32, langEngine("%{main_logo}%") );
openPrivButton( "info",140,0,24,9,12,-1,32,langEngine("%{main_info}%") );
OnNewPlayerJoin_Pitboard();

Re-open them on the following event:


Event OnRaceStart( $NumP ) # Lapper event
$mList = GetListOfPlayers("N");
$mCount = arrayCount( $mList );
$plyNum=0;

WHILE ($plyNum < $mCount)
$uName = $mList[$plyNum];
openButton( $uName,"logo",0,142,32,13,12,-1,32, langEngine("%{main_logo}%") );
openButton( $uName,"info",140,0,24,9,12,-1,32,langEngine("%{main_info}%") );
$plyNum=$plyNum+1;
ENDWHILE
EndEvent

Thanks!
This thread is closed

FGED GREDG RDFGDR GSFDG