gpScripts Docs
StoreDiscordYoutube
  • 📔gpScripts
  • Clothingshop
    • Installation
    • Developers
      • Client
  • 💰InsuranceSystem
    • Installation
    • Developers
      • Client
      • Server
  • 📲Businesscards
    • Installation
    • Developers
      • Events
  • 🛡️visumsystem
    • Installation
    • Developers
      • Commands
      • Exports
      • Events
    • Code Snippets
      • QB-Garages
  • ☎️Emergencyphone
    • Installation
    • Common mistakes
      • Common mistakes
    • Developer
      • Events
  • 💵Tax-System
    • Installation
      • Step 1 - SQL-File
      • Step 2 - [QB-Core] Changes
      • Step 3 - [ESX] Changes
      • Step 4 - Restart your server
      • Step 5 - Set first deduction date
    • Exclude inactive vehicles
    • Common mistakes
      • Common mistakes
    • Developer
      • Events
Powered by GitBook
On this page
  • 1. Download
  • 2. Database
  • 3. Restart your server
  • 4. Society Accounts and other integrations
  • 5. Your Billing System
  • 6. Adding a new insurance/membership for a job

Was this helpful?

  1. InsuranceSystem

Installation

PreviousClientNextDevelopers

Last updated 1 year ago

Was this helpful?

Please go through each step carefully and allow enough time. Support tickets opened due to simple errors will be forwarded to the documentation.

1. Download

Download the latest version of the script from your .


2. Database

Add the gp_InsuranceSystem.sql file to your database.


3. Restart your server

In order for your new asset to be recognized and the database changes to be applied, you must restart your server!


4. Society Accounts and other integrations

In the server/sv_customizeMe.lua file you will find countless functions that can be edited as desired.

In this file you will also find the function to add or remove money from a society account. If you do not use qb-banking or esx_addonaccount, you must integrate your corresponding system in the respective functions, AddSocietyMoney and RemoveSocietyMoney.


5. Your Billing System

When an invoice is issued, it should be checked directly whether the player has insurance and the invoice should be reduced by the corresponding amount. For this we need to add an export to your billing system.

You don't have to do anything for JakSam's Billing UI

Navigate in "sv_utils.lua" to line 151 to

RegisterServerEvent(Config.EventPrefix..":createInvoiceSociety")

and add

price = exports['gp_InsuranceSystem']:checkInsuranceCoverage(receiverPlayer.identifier, authorPlayer.getJob().name, price)
if (price == 0) then
    return
end

below local note = data.note

Navigate to "editable/server_editable.lua" to function createBilling at line 1342. Insert above jobname = society in line 1379:

amount = exports['gp_InsuranceSystem']:checkInsuranceCoverage(targetIdentifier, society, amount)
jobname = society

So the if-statement should look like this:

if Config.AllowBillingJobs[society] == nil then
    if Config.SendInvoiceAsStaffAccount then
        jobname = 'identifier'
    else
        Config.Notification(Config.NotificationText['notallowpersonelaccount'].text,
                            Config.NotificationText['notallowpersonelaccount'].type, 
                            true, 
                            src)
       return
    end
else
    amount = exports['gp_InsuranceSystem']:checkInsuranceCoverage(targetIdentifier, society, amount)
    jobname = society
end


6. Adding a new insurance/membership for a job

Go into the Config to the item Config.InsuranceTypes and add your new insurance/membership:

Config.InsuranceTypes = {
    --[[ Basic health insurance system ]]
    ["ambulance"] = {
        npc = {
            pedModel = "s_m_m_paramedic_01",
            coords = {
                vector4(420.7623, -1029.6794, 29.1032, 17.1359),
            },
            deactivateOnMemberCount = 1,   
            peds = {}, -- dont touch!
        },
        menuLocations = {
            vector3(427.6365, -1029.2020, 28.9919)
        }
    },
    --[[ Basic vehicle membership system ]]
    ["mechanic"] = {
        npc = {
            pedModel = "s_m_m_paramedic_01",
            coords = {
                vector4(424.8792, -1029.4376, 29.0332, 359.9969),
            },
            deactivateOnMemberCount = 1,   
            peds = {}, -- dont touch!
        },
        menuLocations = {
            vector3(429.4537, -1029.9272, 28.9554)
        }
    },
    -- your new insurance/membership you like to add
    ["unicorn"] = {
        npc = {
            pedModel = "csb_stripper_01",
            coords = {
                vector4(130.1392, -1285.2379, 29.2755, 130.4824),
            },
            deactivateOnMemberCount = 1,   
            peds = {}, -- dont touch!
        },
        menuLocations = {
            vector3(94.8770, -1294.7925, 29.2688)
        }
    },
}

Open the config.js file which is located at ./web/config.js.

So that you can determine for each job whether it is an insurance, membership, subscription or other, you can set the most important labels and texts for the UI for each job separately.

As in the Config, you can simply copy and paste an existing translation and adjust the values. Make sure to replace the old jobname as well.

pedModels can be found .

💰
keymaster account
here