Well here we go:
- declare a uservar on first connect, set it to 0 and store it in the database (new user)
- retrieve an already stored value from the database (already registered user)
- measure the distance driven and when a user disconnects, add it to the created/retrieved value and store that value into the database
- when distance driven is bigger then 50km, make a buy button for xfg available
- when distance driven is bigger then 200km, make a buy button for xrg available
Not too hard to code and certainly a very good way to learn a program like Lapper.