BK Development
BKStoreDiscord
  • 💿FiveM Escrow System
  • SCRIPTS
    • 🏛️bk_politicalsystem
      • Dependencies
      • Installation
      • Configuration
      • Exports
      • RP
Powered by GitBook
On this page
  • Arguments
  • Example
  • Adding income tax into paycheck system

Was this helpful?

  1. SCRIPTS
  2. bk_politicalsystem

Exports

Installation guide for Tax System

There are two available server side exports for usage:

exports['bk_politicalsystem']:AddMoneyIncome(target, account, money)

which gives player money and deducts a part based on Income Tax Rate and

exports['bk_politicalsystem']:RemoveMoneyVAT(target, account, money)

which removes player money and deducts money based on VAT Tax Rate

Arguments

There are 3 arguments

  • target - player server ID

  • account - account to remove money ('bank', 'money', 'cash', etc.)

  • money - amount of money to process

Example

Example on a shop script:

Before:

local xPlayer = ESX.GetPlayerFromId(source)
local bread_price = 10

xPlayer.removeAccountMoney('money', bread_price)
xPlayer.addInventoryItem('bread', 1)
local Player = QBCore.Functions.GetPlayer(source)
local bread_price = 10

Player.Functions.RemoveMoney('cash', bread_price)
exports['qb-inventory']:AddItem(source, 'bread', 1)

After installation:

local xPlayer = ESX.GetPlayerFromId(source)
local bread_price = 10

exports['bk_politicalsystem']:RemoveMoneyVAT(source, 'money', bread_price)
xPlayer.addInventoryItem('bread', 1)
local bread_price = 10

exports['bk_politicalsystem']:RemoveMoneyVAT(source, 'cash', bread_price)
exports['qb-inventory']:AddItem(source, 'bread', 1)

Adding income tax into paycheck system

  1. Go to es_extended/server/paycheck.lua

  2. Find 1 of this:

xPlayer.addAccountMoney("bank", salary, "Welfare Check")

and 3 of these

xPlayer.addAccountMoney("bank", salary, "Paycheck")
  1. Replace those with

exports['bk_politicalsystem']:AddMoneyIncome(xPlayer.source, 'bank', salary)
  1. Ready for usage !

  1. Go to qb-core/server/functions.lua

  2. Go to function on line 398

  3. Find 3 of these in that function

Player.Functions.AddMoney('bank', payment, 'paycheck')
  1. Replace them with these:

exports['bk_politicalsystem']:AddMoneyIncome(Player.PlayerData.source, 'bank', payment)
  1. Ready for usage !

PreviousConfigurationNextRP

Last updated 8 months ago

Was this helpful?

🏛️