Persistent Records & Tablet
How to set up Pro Laser 4 tablet.
Last updated
Was this helpful?
How to set up Pro Laser 4 tablet.
Last updated
Was this helpful?
By default, Pro Laser 4 will store the last 100 clocks to the player's machine, which will be loaded on player join.
The section below describes a centralized database for tracking clocks server side.
- SQL interface resource. Alternatively you can modify sv_lidar.lua
if you use another resource.
If you do not have an existing database you'd like to use, you can create one, see example below. Notice: this must be the same database you connect to in your server.cfg.
Example:
I use a database called resources
and my connection string looks like this in my server.cfg:
During testing, hangs/server crashes occurred when connectTimeout=60000;acquireTimeout=60000;timeout=60000
was not included, your mileage may vary. I would recommend including these just in case.
Now with your desired database selected you can execute setup.sql
included with the resource, it will build a table with columns below.
rid
INT
Record ID / Primary Key
timestamp
DATETIME
Time at which clock occurred.
speed
INT
Estimated speed from clock.
distance
FLOAT
Estimated distance from clock.
targetX
FLOAT
Target entity's GTA X coordinate.
targetY
FLOAT
Target entity's GTA Y coordinate.
player
TEXT
Lidar user's name.
street
TEXT
Street (and cross street if detected) of target vehicles location.
selfTestTimestamp
DATETIME
Time at which the lidar self-test occurred,
0000-00-00 00:00:00
if self-test disabled in config.
Configure logging settings in config.lua
. Then use /lidarrecords
in game to open the tablet and review records.
Uncomment these two oxmysql lines from fxmanifest:
The Pro Laser 4 can use Imgur as an upload endpoint for "printing" lidar records from the tablet. These are more screenshots than prints but, are roleplayed as such. In order to be able to upload these images to Imgur you will need to generate an API client ID.
Register an application, select "OAuth 2 authorization without a callback URL"
Copy Client ID field.
Paste in to config in the following format: cfg.imgurApiKey = 'Client-ID XXXXXXXXXXXXXXX'
where XXXXXXXXXXXXXXX
is the client ID you copied in step 4.
Restart Pro Laser 4 and test out your print functionality in the tablet.
The Pro Laser 4 can also use Discord as an upload endpoint for "printing" lidar records from the tablet. Discord webhook messages include record data and a screenshot of the record document. In order to be able to upload these images to Discord you will need a Discord webhook on a channel.
Open "Edit Channel" for the channel where you would like these posted.
Navigate to "Integrations" tab.
Click "Webhooks", then "New Webhook" if you don't already have one.
Then "Copy Webhook URL" and paste in cfg.discordWebhook
. See example below.
Restart Pro Laser 4 and test out your print functionality in the tablet.
Note: customizing the icon or name for the webhook is not necessary, ProLaser4 will set the webhook name and image when posting.
Navigate to
Navigate to: