⁉️Setup Server
How to setup server for GPT
SSN / Citizen ID System [FOR ESX]
If you already use system like this just skip this part
Go to your es_extended / server / main.lua and find variable "loadPlayer"
if you find that, add in this
id
like on screenshot below.

Next scroll to function LoadESXPlayer and add
ssn = nil
in userData tableNext add
userData.ssn = tonumber(result.id
belowresult

Next scroll to
local xPlayer = CreateExtendedPlayer
and adduserData.ssn
in argumentsNext add
Core.playersBySsn[userData.ssn] = xPlayer
like on screenshot

Next scroll to
playerDropped
event handler and addCore.playersBySsn[xPlayer.ssn] = nil
also do it inesx:playerLogout

Next go to server / common.lua and add
Core.playersBySsn = {}

Next go to server / functions.lua and add new function like on screenshot

Next go to server / classes / player.lua and add
ssn
argument in functionCreateExtendedPlayer
Next add
self.ssn = ssn
and add statebagstateBag:set("ssn", self.ssn, true)

Thats all, at the end make sure ur column
id
in users are auto increment
VIN System
You can skip this part if you already use one.
Go to your vehicle shop server side file and find MySQL execute to database like on screenshot.

Next add vin in columns and values like on screenshot below.

And thats all, if you want to add vin for givecar script, its very similiar.
exports['piotreq_gpt']:GenerateVIN() -- only server side
Last updated