The online racing simulator
banned auto on connect from the host
Hi guys,

I want anyone who enter my host..
get a ban from the host if the license name does not exist in TXT file

LFSLapper 6.012 \ bin \ default \ license.txt
my license: 5LooDy-g27
Then you need to do a check in the OnConnect event. First load the file, then check if the username is found in that file.
If not, ban that username.

-Create an empty LPR file and store that in your include directory
-Add the file name to "general includes" in addonsused.lpr
-Use the code below, to fill the empty LPR file you have just created


CatchEvent OnConnect( $userName ) # Player event
OnConnect_License();
EndCatchEvent

Sub OnConnect_License() # Player event
### Load usernames from file license.txt ###
UserGroupFromFile( "X", "./../license.txt" );

### Check if username is found in group X ###
IF ( UserInGroup( "X",GetCurrentPlayerVar( "UserName" ) ) == 0 )
THEN
PrivMsg( "^7Banned for breaking the rules too many times" );
cmdLFS( "/ban " . GetCurrentPlayerVar("Username") . " 14" );
ENDIF
EndSub

.. in the path to the license file, means you go up one directory from the current (which should be the includes folder) directory.
Of course you could put the license.txt in the includes folder as well.
14 means the player is banned for 14 days, of course you could set that to a higher value.
I think 999 days or 9999 days is the maximum (but you should check that, or maybe someone knows the maximum value)
-
(5Loody-g27) DELETED by 5Loody-g27 : .
i edit this code .

cmdLFS( "/ban " . GetCurrentPlayerVar("Username") . " 14" );

to

cmdLFS( "/ban " . GetCurrentPlayerVar("UserName") . " 14" );

Now works correctly, thank you
Is there a code to band 1 day any person who enters the username more people, as it was a scam and Monument?

+ msg ( Connect 5LooDy-g27 from SaudiArabia )
Excuses for the mistake in the ban code, I copied that from an older version of Lapper and didn't check the code properly as I was heading to bed.
The LFS Username is unique, so nobody can use your name.
Of course it is a different story with Nicknames, they can be used by anyone, but since the license check in Lapper is about LFS Usernames, nobody can enter the server as long as its LFS Username isn't in license.txt

In that same OnConnect event, you can add a line to send a global message, like: GlobalMsg ( "^7Connected: " . GetCurrentPlayerVar( "NickName") );

You can't show from which country someone is, since LFS can't detect that.
already can not enter the license, but I want to do because it can ?
Quote from 5Loody-g27 :already can not enter the license, but I want to do because it can ?

I don't understand what you mean.
You asked if it was possible to do a check from within Lapper if people are or aren't allowed to login on your server.
Then I explained how to that and what needs to be done.

You need to create a file called license.txt (for example) and place that somewhere in your Lapper directory.
Then you need to create an LPR file (with the code I have given you) and place that in the "includes" directory of Lapper.
Then you need to adjust the file called "addonsused.lpr" which can also be found in the "includes" directory and add a line under "General includes" pointing to the LPR file you created earlier.
Then restart Lapper and then it will check every person connecting to your server, against the LFS usernames mentioned in the license.txt file.
If your name is in that file, you can procede, if not, you will get a ban.
thanks <3

how to kick idlk auto ?
Have a look in section:

##################################
#Options for idle player on track#
##################################

#$IdleExclude = "Lagamel,Gai-Luron"; # Usernames excluded for idle check

#$OnIdleTimeout1 = 60; # Idle timeout for OnIdleAction1 in seconds

Event OnIdle1( $userName ) # Player event
UserGroupFromFile( "idleExempt", "./idleexempt.txt" );
IF( UserInGroup( "idleExempt",$userName ) == 0 )
THEN
privMsg( langEngine( "%{main_idle1}%" ) );
ENDIF
EndEvent

#$OnIdleTimeout2 = 120; # Idle timeout for OnIdleAction2 in seconds

Event OnIdle2( $userName ) # Player event
UserGroupFromFile( "idleExempt", "./idleexempt.txt" );
IF ( UserInGroup( "idleExempt",$userName ) == 0 )
THEN
cmdLFS ( "/spec " . GetCurrentPlayerVar("Nickname") );
privMsg ( langEngine( "%{main_idle2}%" ) );
ENDIF
EndEvent

thanks, Yisc

Is it possible to run LFSLapper6 more than once?
On more than one server
its possible to run multiple servers on 1 Lapper

Open LFSServers.cfg
Add the same line ( like the one you see below ) below the existing configline.

DEF1|gr1|192.168.XXX.XX|29999|./default|default_1.ini|autowork

There are couple of changes the make:

Change DEF1 to DEF2
Change gr1 to gr2
Change insim port (i'm not sure about this one)

Also be sure the adminpass of the 2 servers is the same.
Thanks Bass-Driver .
Are there explanations wiki depends on the programming lfslapper?

- Functions
- Events
?
Sadly there isn't a proper wiki.
Best thing to do is check "changes.txt" found in the "doc" folder.
That explains every command ever introduced.
Otherwise use this forum as "wiki" Smile
Get a problem when running "to LFSLapper" program
Host: TIMER BOUNDED
and (Lost connection)!

Is there a solution to this problem?
or Is interface one of the members this problem ?
Quote from 5Loody-g27 :Get a problem when running "to LFSLapper" program
Host: TIMER BOUNDED
and (Lost connection)!

Is there a solution to this problem?
or Is interface one of the members this problem ?

Sounds like a timer runs out of time or keeps running.
Check the logfiles of Lapper to see what is really happening.
Can I get a file path?
You need to look for a like with a similar name like this: 127.0.0.1-29990-ERR.log which are located in a "logs" folder.
9/7/2015 2:44:41 PM -> Not a connexion packet! Close connection
Hmm that's not helping to be honest (not your fault).
Did you recently changed something and after that, this started happening?
If so, reverse that change and see if it's gone.
It also might be useful to see if Lapper stops when someone connects to the server, or goes onto the track, etc.
With that, you could check during which event the problem occurs.
I do not understand the meaning of these words, can you clarify that, please?
Have you recently changed any code in Lapper, just before the problem you reported has started appearing?
If so, investigate the code you recently changed.
Besides that, it would be useful to see when the error occurs.
Does it happen when someone connects to your server, joins the track, etc. since that will point you into the direction of the Lapper event that is causing this error.
i'm not done any changed.
What is the appropriate solution in your opinion?
You also could post your lapper in here, so we can look at it. Do not forget to remove your adminpass in the default_1.cfg

-have you tried to get a fresh LFSLapper.
-Are you trying to run 1 or 2 lappers at the same time?
-What are the lines in the file: \bin\default\logs\127.0.0.1-29999-MSS.log and \bin\default\logs\127.0.0.1-29999-ERR.log . You could also upload them so we can take a look at it.
-have you tried to get a fresh LFSLapper.? Yeah.
-Are You trying to run 1 or 2 lappers at the same time? No.

.log File is attached
Attached files
مستند نصي جديد ‫‬.txt - 30 KB - 170 views

banned auto on connect from the host
(67 posts, started )
FGED GREDG RDFGDR GSFDG