The online racing simulator
About IP address transfer and Discord
Hello. I've searched all the LFS forums but couldn't find any rational data. The problem is that I am using lapper version 7.0.8.1. Thanks to the bass driver, we fixed some problems. I don't want to disturb him either, from discord all the time. That's why I wanted to create an open topic.
First of all, I want the ip address of the players connected to the game to be transferred to any discord channel. Currently, we have a bot that transmits the server chat, but there is no code that transmits ip.
Secondly, I can ban someone from the server with the /ban command in discord or throw an ip ban. Is something like this possible? I would be glad if you help.Petals
I'd like to help you, but I see on your discord server that you're selling them for an exorbitant amount of money.
If you search a little, there is a topic I opened about the ip address.
It's up to me to give away everything I've translated and worked for. I don't think you have the right to question or criticize this.
By the way, I didn't know that I was a close follower. Big grin
That's not what I wanted to tell you, it's just strange that you get help from us for free and sell it for a very expensive price, in addition (except for the demo) why should I closely follow the owner of a crack server
Anyone can talk to each other on the forum. Everything shared is also in English. I'm not willing to translate it into my own language and let people use it for free. You also have dozens of posts on the forum. Would you share the things you do with others for free? The answer is obviously no.
Also, I don't play on cracked servers. If I have a cracked server, I'll play there, I don't pay for the lfsye host.
Of course, I don't give it directly ready-made, but I don't hesitate to help. There is not much point in extending the subject, as I said at the beginning, there is a topic I opened about getting an ip address in the past.
https://www.lfs.net/forum/thread/104071
I tried this encoding but stats are lost. Maybe I put it in the wrong range. What line spacing should I put it in? I tried several times but it didn't work.
Can you review the photo I posted?
Did you do it using sub?
YEP
@RealistAdam

In the link below, there is some infomation how to get the ip adress from a connected player. I also explained why you not get an IP after someone is connected. You have to code a delay playerdelayedcommand() to get the IP

https://www.lfs.net/forum/thre ... -when-connected-to-server
  • Player connect
  • 1/2 second delay with playerdelayedcommand().
  • Get IP from player: GetPlayerVar($userName,"IPAddress");
Info about playerdelayedcommand:
https://www.lfs.net/forum/post/2051762#post2051762
Quote from arda556 :Did you do it using sub?

Which line spacing did you add your code to?
-
(arda556) DELETED by Yisc[NL]
-
(RealistAdam) DELETED by Yisc[NL]
#Connect messages when a player joins the server#
Sub dcgiris($username)


$Message = "```fix\n " . $username . " sunucuya katıldı. ".GetPlayerVar( $username,IPAddress)." (" . getLapperVar( "ShortTime" ) .")``` ";
$DiscordChannel = "1153325072413634611";
sendmessagetodiscord($DiscordChannel,$Message);



EndSub

We add the code to the (#Connect messages when a player joins the server#) line, then we need to add a delay. For this, we go to the (#DisConnect messages when a player leaves the server#) line and add it.

#DisConnect messages when a player leaves the server#

Event OnConnect( $userName ) # Player event



PrivDelayedCommand( 1, dcgiris );
EndEvent

Be careful, there should only be 1 line (Event OnConnect( $userName ) # Player event) in your lapper file. If there is more than one line, delete it. Have a nice day.

FGED GREDG RDFGDR GSFDG