📖
Goat Scripts Doc
Discord
  • Home
  • G_CORE
    • Installation
      • QBCore
      • ESX
      • QBox
      • VORP
    • Developer
      • Events
        • Server
        • Client
      • Exports
        • Server
        • Client
      • Variables
  • G_LIFESTYLE
    • Installation
      • QBCore / ESX
      • QBox
    • Events
  • G_MONEYWASH
    • Installation
      • QBCore / ESX
      • QBox
  • G_SCRAPYARD
    • Installation
      • QBCore / ESX
      • QBox
    • Mini Games
  • G_SPEEDLIMITER
    • Installation
      • QBCore
      • QBox
  • G_USABLELIGHTS
    • Installation
      • QBCore / ESX
      • QBox
  • G_DOCKJOB - STDENIS
    • Installation
  • G_DEALER
    • Developer
      • Exports
        • Client
Powered by GitBook
On this page
  • Introduction
  • Step 1: Ensure Order
  • Step 2: Config
  • Step 3: Inserting Event
  • Client Side
  1. G_LIFESTYLE

Events

WE SUGGEST YOU HAVE SOME KNOWLEDGE ABOUT CODING BEFORE CONTINUING. IF YOU BREAK SOMETHING, WE WILL NOT TROUBLESHOOT THROUGH IT WITH YOU.

Introduction

This page will guide you through how to use our custom events so the UI will be displayed at just the right time for your new players. Please read each step carefully and do NOT skip any steps.

Step 1: Ensure Order

Be sure that g_core is started before any script your trying to incorporate g_lifestyle with because we are going to be using some exports that require our core (which makes it easy for you).

Example of how it should look

ensure ox_lib
ensure your_framework
ensure your_inventory
ensure your_target3rdeye
ensure g_core
ensure g_lifestyle
ensure your_script_here

Step 2: Config

Open the config.lua file and find cfg.openauto and switch from true to false

Step 3: Inserting Event

Client Side

This code will work for ESX, QBCore & QBox

local xcoreid = GetPlayerServerId(PlayerId())
if GetResourceState('qbx_core') == 'started' then
    local gPlayer = QBX.PlayerData
    TriggerServerEvent('g_lifestyle:sv:getdatabase', xcoreid, gPlayer.citizenid)
elseif GetResourceState('qb-core') == 'started' then
    local QBCore = exports['qb-core']:GetCoreObject()
    local gPlayer = QBCore.Functions.GetPlayerData()
    TriggerServerEvent('g_lifestyle:sv:getdatabase', xcoreid, gPlayer.citizenid)
elseif GetResourceState('es_extended') == 'started' then
    local ESX = exports.es_extended:getSharedObject()
    local gPlayer = ESX.GetPlayerData()
    TriggerServerEvent('g_lifestyle:sv:getdatabase', xcoreid, gPlayer.identifier)
end
PreviousQBoxNextInstallation

Last updated 2 months ago

Insert all lines below into the script of your choice. Most likely a multi character script

😄