The online racing simulator
GripPB save IP address
Hello ,

I want , when any player enters the game, Save the ip address and username to the file. such a thing can be done ?
Yes, that can be done.
Not in GripPB but in storedvalue.dbs

DriftPB = Storing driftscores (file can only be handled by Lapper it self)
GripPB = Storing laptimes (file can only be handled by Lapper it self)
storedvalue = Storing everything a user wants to store
-
(cargame.nl) DELETED by Yisc[NL]
I did something like this , the data does not save . How can i make this system ?

Code



$StoredValueDbs = "storedvalue";

Event OnConnect( $userName )
globalMsg( langEngine( "%{main_saveipadress}%" , GetPlayerVar($userName,"IPAdress") ) );
EndEvent

Lang "EN"
main_saveipadress ="^7IP Adres Save";
EndLang


globalMsg means sending a message to every player and since it is in the OnConnect event, it means that it sends a message to all connected players at the moment a new player connects.
Have a look in the Lapper section to find several scripts how to deal with saving and retrieving values.
I did some research , I couldn't find anything about this topic. Could you make a script for?
I'm sorry to bother you
I already made a registration system for Lapper.
This doesn't do anything with IP addresses, but if you understand the code, it wouldn't be too hard to include that.
See this posting for the actual script: https://www.lfs.net/forum/post/1921021#post1921021
Sorry , your code is very complicated . I have begun new lapper , I don't know much
Tonyslayt I agree with you , Yisc[NL] can you write us a plugin for this?
Tonyslayt and Stakikety

-May i ask, in which server this script is gonna be used?
-if you guys have a proper Demo license, why dont i see any progress in your online stats. I assume you having a cracked LFS. or show me that i'm wrong.

We are not going to help any players with a Cracked version of LFS.

So,Buy LFS and enjoy the legal content. And get more help with Lapper etc.
I came to such a conclusion. But I can not get the IP address ?


CatchEvent OnLapperStart()
RegisterScheduleAction( "0 * * * * * *", Timer_Sub );
EndCatchEvent

Sub Timer_Sub1()
$Players = GetListOfPlayers();
FOREACH ($NickName IN $Players)
SetUserStoredValue($NickName["value"], "IPAdress", GetPlayerVar($NickName["value"],"IPAdress"));
ENDFOREACH
EndSub

-
(cargame.nl) DELETED by Yisc[NL]
Your syntax is wrong, that's why IPAdress is saved as text instead of being a variable.
Will you fix the missing part and give me the code?
Haven't tested the code below (as I don't have the latest version of Lapper running on my machine, but I think it should be something like this:

Event OnConnect( $userName )
SetStoredValue( $userName . "IPAdress", GetPlayerVar($userName,"IPAdress") );
EndEvent

Tried again, and I think the problem is in variables

The code below can be used in a seperate Lapper module (see included file) and will save the IP Adress of a player when he joins the track.
As you can see, there are two ways of getting the IPAdress, by either using the CurrentPlayer variable as well as reading any players variable using PlayerVar combined with the username.
The screenshot is to proof that the data is actualy stored in the Lapper database.

CatchEvent OnNewPlayerJoin( $userName ) # Player event
OnNewPlayerJoin_IP_Saving();
EndCatchEvent

Sub OnNewPlayerJoin_IP_Saving()
$userName = GetCurrentPlayerVar( "UserName" );
PrivMsg ("^7DEBUG 1: " . GetPlayerVar($userName,"IPAdress") );
PrivMsg ("^7DEBUG 2: " . GetCurrentPlayerVar( "IPAdress" ) );
SetStoredValue( $userName . "IPAdress", GetPlayerVar( $userName,"IPAdress" ) );
#SetStoredValue( $userName . "IPAdress", GetCurrentPlayerVar( "IPAdress" ) );
EndSub

Change the extension of the file to .lpr and add them to addonsused.lpr to be able to use it.
Attached images
Capture.PNG
Attached files
ip_saving.txt - 617 B - 227 views
Thank you for everything Thumbs up
How can I open the .dbs files and view their contents?
This thread is closed

GripPB save IP address
(18 posts, closed, started )
FGED GREDG RDFGDR GSFDG