Installation

1. Download

Download the latest version of the script from your keymaster account.


2. Database

Add the gp_InsuranceSystem.sql file to your database.


3. 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


6. Adding a new insurance/membership for a job

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

  • pedModels can be found here.

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.

Last updated

Was this helpful?