⁉️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

  1. Go to your es_extended / server / main.lua and find variable "loadPlayer"

  2. if you find that, add in this id like on screenshot below.

Example
  1. Next scroll to function LoadESXPlayer and add ssn = nil in userData table

  2. Next add userData.ssn = tonumber(result.id below result

Example
  1. Next scroll to local xPlayer = CreateExtendedPlayer and add userData.ssn in arguments

  2. Next add Core.playersBySsn[userData.ssn] = xPlayer like on screenshot

Example
  1. Next scroll to playerDropped event handler and add Core.playersBySsn[xPlayer.ssn] = nil also do it in esx:playerLogout

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

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

Example
  1. Next go to server / classes / player.lua and add ssn argument in function CreateExtendedPlayer

  2. Next add self.ssn = ssn and add statebag stateBag:set("ssn", self.ssn, true)

Example
  1. 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.

  1. Go to your vehicle shop server side file and find MySQL execute to database like on screenshot.

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

Example
  1. And thats all, if you want to add vin for givecar script, its very similiar.

exports['piotreq_gpt']:GenerateVIN() -- only server side

Last updated