The online racing simulator
I think when you do cmdLfs( "/end " ); the cmdLfs() "HOST" is execute that command. the THE HOST is always a admin
correct me if i'm wrong.
Hi, how to make a Drift points displayed in real-time?
Like that:

Now it looks like this:
hey,

you have to modify the source code of lapper.

But i did that for you.
Replace your current lfslapper.exe with the one i attached in the link below.

https://www.lfs.net/forum/post/1895587#post1895587
Thanks you very much. Smile
Maybe you know why when I stop drifting he still counting points and stop after some time. My server is on VPS server. Sometimes don't stop. i don't understand its problem with this exe file?
he shouldnt count when you stop drifting. Look like you have a laggy server or something. Because the exe i gave you if the same that i'm using now.
Other problems with this exe i get Flood Big grin


With orginal lapper exe everything works fine.
ye thats true, it spams the OnGoodDriftScore event now:

i have add some extra code in "Event OnDriftScore($userName)".
Here's an example (Do not use this):

IF(ToNum($LastDriftScore) >= ToNum($GoodDriftScore))THEN
IF(GetCurrentPlayerVar("GetGoodDriftMessage") == 0)THEN
SetCurrentPlayerVar( "GetGoodDriftMessage",1);
globalmsg(GetCurrentPlayerVar("NickName") ." ^7Made a awesome drift!");
ENDIF
ELSE
SetCurrentPlayerVar( "GetGoodDriftMessage",0);
ENDIF

Hello, please, could any beautiful soul help me with Team Chat history code?

I want to store ONLY last 10 teamchat messages and then display it using 10 privButtons, problem is I only have made simple Teamchat code using openPrivTextButton and "IF useringroup" method which works fine but thats the best I can do, Im stuck Shrug
Quote from LakynVonLegendaus :Hello, please, could any beautiful soul help me with Team Chat history code?

I want to store ONLY last 10 teamchat messages and then display it using 10 privButtons, problem is I only have made simple Teamchat code using openPrivTextButton and "IF useringroup" method which works fine but thats the best I can do, Im stuck Shrug

This isn't too hard to do with Lapper.
Can you please send me the code you already have, then I am willing to look into your request.
Quote from Yisc[NL] :
Quote from LakynVonLegendaus :Hello, please, could any beautiful soul help me with Team Chat history code?

I want to store ONLY last 10 teamchat messages and then display it using 10 privButtons, problem is I only have made simple Teamchat code using openPrivTextButton and "IF useringroup" method which works fine but thats the best I can do, Im stuck Shrug

This isn't too hard to do with Lapper.
Can you please send me the code you already haven, then I am willing to look into your request.

Thank you!

here is the code I am using now

CatchEvent OnConnect( $userName ) # Player event
IF( UserInGroup( "tofus",$userName ) == 1 )
THEN

openPrivTextButton( "sendmessage",1,148,8,4,3,0,"Team Chat","^7Team%nl%^7Chat",120,teammessage );
ENDIF
EndCatchEvent

Sub teammessage ( $username,$teammsg )
$lop = GetListOfPlayers("N");
$NickName = GetCurrentPlayerVar("NickName");
FOREACH ( $de in $lop )
$tofuName = $de["value"];
IF ( UserInGroup( "tofus",$tofuName ) == 1 )
THEN
privMsg ( $tofuName, "^7[^1•^7] Team Chat - " . $NickName);
privMsg ( $tofuName, " ^6" . $teammsg);
ENDIF
ENDFOREACH
EndSub

and here is the idea of what I am trying to achieve

CatchEvent OnConnect( $userName ) # Player event
IF( UserInGroup( "tofus",$userName ) == 1 )
THEN

## openPrivTextButton( "sendmessage",1,148,8,4,3,0,"Team Chat","^7Team%nl%^7Chat",120,teammessage );
openPrivButton( "open_chat_panel",1,148,8,4,3,-1,ISB_NONE,"^7Team%nl%^7Chat",open_chat_panel );

ENDIF
EndCatchEvent


Sub open_chat_panel ( $KeyFlags, $id )

closePrivButton (open_chat_panel);

$lop = GetListOfPlayers("N");
$NickName = GetCurrentPlayerVar("NickName");
FOREACH ( $de in $lop )
$tofuName = $de["value"];
IF ( UserInGroup( "tofus",$tofuName ) == 1 )
THEN

openPrivButton( "chat_history_msg10",50,68,90,8,8,-1,ISB_DARK+64,$team_msg10,"" );
openPrivButton( "chat_history_msg9",50,76,90,8,8,-1,ISB_DARK+64,$team_msg9,"" );
openPrivButton( "chat_history_msg8",50,84,90,8,8,-1,ISB_DARK+64,$team_msg8,"" );
openPrivButton( "chat_history_msg7",50,92,90,8,8,-1,ISB_DARK+64,$team_msg7,"" );
openPrivButton( "chat_history_msg6",50,100,90,8,8,-1,ISB_DARK+64,$team_msg6,"" );
openPrivButton( "chat_history_msg5",50,108,90,8,8,-1,ISB_DARK+64,$team_msg5,"" );
openPrivButton( "chat_history_msg4",50,116,90,8,8,-1,ISB_DARK+64,$team_msg4,"" );
openPrivButton( "chat_history_msg3",50,124,90,8,8,-1,ISB_DARK+64,$team_msg3,"" );
openPrivButton( "chat_history_msg2",50,132,90,8,8,-1,ISB_DARK+64,$team_msg2,"" );
openPrivButton( "chat_history_msg1",50,140,90,8,8,-1,ISB_DARK+64,$team_msg1,"" );
openPrivTextButton( "sendmessage",50,148,90,8,8,32+64,"Team Chat","^3Write message",120,teammessage );
openPrivButton( "close_chat_panel",50,156,90,8,8,-1,ISB_DARK,"Close",close_chat_panel );
ENDIF
ENDFOREACH
EndSub

Sub close_chat_panel ( $KeyFlags, $id )
closePrivButton("sendmessage&close_chat_panel&chat_history_msg1&chat_history_msg2&chat_history_msg3&chat_history_msg4&chat_history_msg5&chat_history_msg6&chat_history_msg7&chat_history_msg8&chat_history_msg9&chat_history_msg10");
openPrivButton( "open_chat_panel",1,148,8,4,3,-1,ISB_NONE,"^7Team%nl%^7Chat",open_chat_panel );
EndSub

Sub teammessage ( $username,$teammsg )
$lop = GetListOfPlayers("N");
$NickName = GetCurrentPlayerVar("NickName");
FOREACH ( $de in $lop )
$tofuName = $de["value"];
IF ( UserInGroup( "tofus",$tofuName ) == 1 )
THEN
privMsg ( $tofuName, "^7[^1•^7] Team Chat - " . $NickName);
privMsg ( $tofuName, " ^6" . $teammsg);
ENDIF
ENDFOREACH
EndSub

Right, after a couple of hours I think I came up with the script you want.
Here are the steps to activate it:

-Download the file and rename it to teamchat.lpr
-Then store it in the "includes" folder of Lapper
-Open file "addonsused.lpr"
-Add a line under "General includes" saying: include( "./teamchat.lpr");
-Open file "teamchat.lpr"
-Adjust the path to tofus.txt , to the location it has in your Lapper directory (*)
-Start Lapper and the script should work

(*) Using ".." means you go one directory up from the current directory

Let me know if this is what you want or what you would like to be changed/added (I will help if requests are reasonable, but trying first your self, would be a good thing to learn to code within Lapper)
Attached files
teamchat.txt - 3.2 KB - 258 views
Quote from Yisc[NL] :Right, after a couple of hours I think I came up with the script you want.
Here are the steps to activate it:

-Download the file and rename it to teamchat.lpr
-Then store it in the "includes" folder of Lapper
-Open file "addonsused.lpr"
-Add a line under "General includes" saying: include( "./teamchat.lpr");
-Open file "teamchat.lpr"
-Adjust the path to tofus.txt , to the location it has in your Lapper directory (*)
-Start Lapper and the script should work

(*) Using ".." means you go one directory up from the current directory

Let me know if this is what you want or what you would like to be changed/added (I will help if requests are reasonable, but trying first your self, would be a good thing to learn to code within Lapper)

Sir, this works just perfect! I realize you did not have to do this, so BIG THANK YOU for your time and willingness. You are awesome!

PS: I am actually really amazed, this would take me probably days to figure out. Thank you again, Sir!
I'm glad I could help you.
There is enough room for improvements on the script, but it's very functional as it is already.
Quote from Yisc[NL] :I'm glad I could help you.
There is enough room for improvements on the script, but it's very functional as it is already.

Hello, I made some little changes, this is how it looks



I attached .txt file with the code if someone is interested.

Have a good one!
Attached files
teamchat_w_history.txt - 3.7 KB - 245 views
I am back with another newb question:

Is it possible NOT to build new PB IF PB or SP > WRpb or WRsp?

I searched the whole Lapper folder with bunch of different keywords to PB related, but I cannot find it. Am I being very silly or is this not possible with Lapper?
As far as I know, that isn't possible.
The whole code that is used to do things with PB, is hardcoded in Lapper.
Thank you!
hi
i have a small issue.
it has something todo with calling a sub without the $keyflag var

Sub SoccerCalcTime($argv) #$argv in seconds
$Minutes = round(($argv/60),0);
$Time = (round(($argv/60),2)-$Minutes);
$Seconds = round(($Time*60),0);

IF($Seconds < 0)THEN # when seconds are negative
$Minutes = $Minutes-1;
$Seconds = 60 + $Seconds;
ENDIF
Timer($Minutes,$Seconds);#Goto Countdowntimer
EndSub

Sub Timer($Minutes,$Seconds)
IF($Minutes >= 0)THEN
openGlobalButton( "timer",80,0,40,6,1,$Seconds,36,"^3##### ^7TimeLimit: ".$Minutes."^7:%cpt% ^3#####",Timer);
$Seconds = 59;
$Minutes=$Minutes-1;
ELSE
SoccerTimeLimitExpires();
ENDIF
EndSub

Every minute it does recall the sub. , but it also recalls the sub when you click on the button.
I have tried to add the $Keyflags into the sub, but that doesnt work :S

Is there a way to block the clicking, or do i miss something easy.
Maybe I am stating the obvious, but wouldn't it be an idea to just remove the action from the button?
Then it can't be clicked.
I have removed the action from that button and added a DelayedCommand( $Seconds, Timer ); . The button disappear. when $Seconds are 0.

Tried to add vars to the calling sub.
DelayedCommand( $Seconds, Timer($Minutes,$Second));

It will hang my lapper.
I'm still not sure what exactly you are trying to accomplish.
Will send you a private message.
The error i receiving in my console does not have any effect to my lapperscripts.
but its nice to get rid of it.

I cannot find anything in the debugfiles about this error.
Is there a solution to get rid of this error?

Lapper does read each line right.

I might have a small idea about fixing the error, but i'm not sure if it works this way.
For example: when the first lapperfile has 1000 lines and the 2nd file has 700.
the error will be in the 2nd file than?


EDIT : Error fixed. Was indeed the idea i had. A nasty " ` " was hidden in my scripts
Attached images
error char.jpg
includes.jpg
Hi,

I have a small issue with one of the scriptfunction inside Lapper.

its about: RegisterzoneAction() and RemovezoneAction();

What i have for RegisterzoneAction is :
RegisterzoneAction( RedGoalPos,getLapperVar( "ShortTrackName" ),$RedGoal_X,$RedGoal_Y,$RedGoal_W, RedTeamScored, "");

Which is working well, so thats not the problem.

However i try to remove the ZoneAction with RemovezoneAction.
What i have for RemovezoneAction is:
RemovezoneAction(RedGoalPos, getLapperVar( "ShortTrackName" ));

If i do that my lapper will crash when i drive over the deleted zone.

When i'm looking into the Lappercode it siad.
[b]
RegisterzoneAction:[/b]
listOfZoneEvent.Add(idTask, args[0].ToString(), x1, y1, dist, args[4].ToString(), args[5].ToString());

//ID , CurrentTrack , X_axis , Y_Axis , Width, Sub enter , Sub Leave

[b]RemovezoneAction:[/b]
listOfZoneEvent.Remove(args[0].ToString(), args[1].ToString()); // ID , Current track

I've found nothing on the lapper forum about this ( or i'm blind).

i hope there's a solution for it.


Edit: Havent changed any code. A reboot was enough to solve this issue :S
I can't see any obvious problem and do see you worked your way around the wrong syntax being displayed in 'changes.txt' when it comes to RegisterzoneAction Thumbs up
Since your Lapper crashes as soon as you entered a supposedly deleted zone, it looks like Lapper still tries to fire the "Enter zone event" but only finds a corrupt line of code and then crashes.
All the latest Lapper crashes I recently ran into, were caused by missing () or ;
So you might want to inspect these creepy little fellows.
Stopping these crashes (even when the code is wrong, Lapper should never crash on that) is high on my list when ever my friend has some spare time and is willing to work on Lapper some more for me/us.
This thread is closed

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