FreeScriptsDocsSupport

Browse

  • Documentation
    • FAQ
  • 📱 Phone
    • 🧠 Installation
    • 🦄 Unique phones
    • 💿 Configure
      • 💄 Additional Features
      • 📸 Camera
      • 📹 Video Calls
      • 🍏 Apps
      • 🪵 Logs
      • 🔋 Battery System
      • 🖼️ Media Customization
      • 🗣️ Multi-Language Support
      • 🗃️ SIM Cards
      • 🚗 Valet System
      • 🖼️ Wallpapers App
      • ⛅ Weather Widget
    • ⏭️ Exports
      • Client side
        • 👁️‍🗨️ General
        • 📞 Calls
        • ☀️ Groups
        • 🏢 Companies
        • 🔧 Misc
        • 🗼 Signal Towers
      • Server side
        • 🆔 Identify Player
        • ☎️ Sim Cards
        • 📞 Calls
        • 💬 Messages
        • ☀️ Groups
        • 🌐 Cell Broadcast
        • 💸 YPay
        • 📧 Mail
        • 📪 Notifications
        • 📵 Screen Damage
        • 🗯️ Dark Chat
        • 🔧 Misc
    • 🪛 Commands
    • 📡 Events
      • Server side
        • 📨 Messages
        • 📱 Social Media
        • ☎️ Calls
    • 🍎 Custom apps
    • 🏦 Banking App
    • 📈 Markets App
    • 👜 State bags
  • ☎️ Boomer Phone
    • 🧠 Installation
    • 🦄 Unique phones
    • ⏯️ Exports
      • Client side
  • 🏠 Properties
    • 🧠 Installation
    • 💿 Configure
    • 🔗 Compatibility
      • Phones
        • YSeries
        • LB Phone
    • 📖 Guides
      • 🛏️ Starter Apartments
      • 🐚 Add More Shells
      • 🔑 Physical Keys
      • 🪑 Furniture As Items
      • 🛠️ Fix Interactable Points
      • 📋 Discord Logs Setup
    • ⏭️ Exports
      • Client side
        • GetCurrentPropertyId
        • GetCurrentProperty
        • IsPointInsideProperty
        • OpenPropertyMenu
        • AddKey
        • RemoveKey
        • SetWaypointToProperty
        • GetAllProperties
        • GetKeyHolders
        • PoliceRaidDoor
        • WrapIntoProperty
        • GetClosestDoor
        • GetEntryCoordinates
        • UseLockpick
        • PoliceRaidDoor
      • Server side
        • GetAllProperties
        • GetPropertyData
        • AddKey
        • RemoveKey
        • ToggleDoorlock
        • GetPlayersInProperty
        • GetKeyHolders
        • DeleteProperty
        • AddStarterApartment
        • SellProperty
        • TransferProperty
    • 🪝 Hooks System
      • buyProperty
      • rentProperty
      • sellProperty
      • deleteProperty
      • createDoor
      • saveSettings
      • setInteractablePoint
      • canEnter
      • canExit
    • 👜 State bags
  • 🏦 Banking
    • 🧠 Installation
    • 🪛 Commands
    • ⏯️ Exports
      • Client side
      • Server side
    • 🪵 Logs
    • 🪝 Hooks
    • 🏦 Banking App
  • 💸 Billing
    • 🧠 Installation
    • ⏭️ Exports
      • Client side
      • Server side
  • 📊 Hud
    • 🧠 Installation
    • ⏭️ Exports
      • Client side
  • 📦 Storage Units
    • 🧠 Installation
  • 🎰 Slots
    • 🧠 Installation
    • 📱 Phone app
  • 🎃 Minigames
    • 🎯 Exports and Usage
    • 🔧 Commands

🪵 Logs

Overview

The TGG Banking system automatically logs all important banking activities to your database. These logs can be used for auditing, debugging, and tracking player actions. The logging system is built-in and requires no additional configuration - logs are automatically created when banking operations occur.

Features

  • Automatic Logging: All banking operations are automatically logged
  • Database Storage: Logs are stored in the tgg_banking_logs database table
  • Event Integration: Logs trigger server events for external integrations
  • Discord Webhook Support: Built-in Discord webhook integration via custom file
  • Comprehensive Coverage: Tracks accounts, cards, transactions, and loans
  • Player Tracking: All logs include player identifiers and IBANs
  • Batch Processing: Logs are queued and sent in batches for efficiency

Configuration

Discord Webhook Setup

The banking system includes a built-in Discord webhook integration. To enable it:

  1. Create a Discord Webhook:

    • Go to your Discord server settings
    • Navigate to Integrations → Webhooks
    • Create a new webhook and copy the webhook URL
  2. Add the Convar to server.cfg:

    Code
    set bankingLogs "YOUR_DISCORD_WEBHOOK_URL_HERE"
  3. Restart the Resource:

    bash
    restart tgg-banking

Custom Logs Configuration

The logging system uses server/custom/logs.lua for Discord webhook integration. You can customize this file:

Excluding Log Types

To prevent certain log types from being sent to Discord, edit server/custom/logs.lua:

lua
local excludedLogTypes = {
    'account_member_modified',  -- Exclude member permission changes
    'account_name_updated',     -- Exclude account name updates
    'card_limits_updated',      -- Exclude card limit updates
    'card_name_updated',        -- Exclude card name updates
}

Adjusting Batch Timeout

By default, logs are sent every 10 seconds if the queue hasn't reached 10 logs. To change this:

lua
local logsTimeout = 10  -- Time in seconds before queued logs are sent

Batch Size

Logs are automatically sent when 10 logs are queued for the same IBAN. This is hardcoded in the file but can be modified:

lua
if #logQueue[iban] >= 10 then  -- Change 10 to your desired batch size
    -- Send logs...
end

Log Types

The banking system uses predefined log types. Here are all available log types:

Account Operations

Log TypeDescription
account_createdAccount was created
account_name_updatedAccount name was changed
account_freezeAccount was frozen
account_freeze_failedAccount freeze attempt failed
account_unfreezeAccount was unfrozen
account_unfreeze_failedAccount unfreeze attempt failed
account_terminateAccount was terminated
account_terminate_failedAccount termination attempt failed
account_transfer_ownershipAccount ownership was transferred
account_transfer_ownership_failedAccount ownership transfer failed

Account Members

Log TypeDescription
account_member_addedMember was added to an account
account_member_removedMember was removed from an account
account_member_modifiedMember permissions were modified

Transactions

Log TypeDescription
depositMoney was deposited to an account
withdrawMoney was withdrawn from an account
transferMoney was transferred between accounts

Card Operations

Log TypeDescription
card_createdA new card was created
card_item_givenCard item was given to player
card_frozenCard was frozen
card_unfrozenCard was unfrozen
card_terminatedCard was terminated
card_name_updatedCard name was updated
card_limits_updatedCard limits were updated
pin_changed_successfullyPIN was successfully changed
pin_change_failedPIN change attempt failed
card_frozen_due_to_too_many_attemptsCard was frozen due to too many failed PIN attempts

Loan Operations

Log TypeDescription
loanLoan was created
loan_applicationLoan application was submitted
loan_approvedLoan was approved
loan_rejectedLoan was rejected
loan_createdLoan was created and approved
loan_paymentLoan payment was made
loan_payoffLoan was paid off
loan_overdueLoan payment became overdue

Savings Accounts

Log TypeDescription
interest_earnedInterest was earned on a savings account
early_withdrawal_penaltyEarly withdrawal penalty was applied to a savings account

Custom Logs

Log TypeDescription
customCustom log type for special cases

Server Event Integration

When a log is created, the system automatically triggers a server event that can be used for external integrations (Discord webhooks, logging systems, etc.):

lua
TriggerEvent('banking:server:logs:create', iban, playerId, logType, logMessage)

Event Parameters

  • iban (string): The IBAN of the account related to the log
  • playerId (string): The identifier of the player who performed the action
  • logType (string): The type of log (from LogType enum)
  • logMessage (string): A descriptive message about what happened

Custom Event Handler

If you want to create your own logging system instead of using the built-in server/custom/logs.lua, you can listen to the event:

lua
AddEventHandler('banking:server:logs:create', function(iban, playerId, logType, logMessage)
    -- Your custom logging logic here
    -- Example: Send to custom webhook or logging service
    local webhook = GetConvar('your_custom_webhook', '')
    if webhook ~= '' then
        PerformHttpRequest(webhook, function(err, text, headers) end, 'POST', json.encode({
            embeds = {{
                title = 'Banking Log',
                description = logMessage,
                fields = {
                    {name = 'IBAN', value = iban, inline = true},
                    {name = 'Player', value = playerId, inline = true},
                    {name = 'Type', value = logType, inline = true}
                },
                color = 3447003,
                timestamp = os.date('!%Y-%m-%dT%H:%M:%SZ')
            }}
        }), {['Content-Type'] = 'application/json'})
    end
end)

Note: The built-in server/custom/logs.lua file already handles Discord webhook integration. You only need to create a custom handler if you want different behavior or integration with other services.

On this page

  • Overview
  • Features
  • Configuration
  • Discord Webhook Setup
  • Custom Logs Configuration
  • Log Types
  • Account Operations
  • Account Members
  • Transactions
  • Card Operations
  • Loan Operations
  • Savings Accounts
  • Custom Logs
  • Server Event Integration
  • Event Parameters
  • Custom Event Handler

All Rights Reserved

TeamsGG © 2026

Pages

FreeScriptsDocsSupport

Legal

Terms of ServiceRefunds

Tebex

Tebex ImpressumTebex TermsTebex Privacy

Socials

DiscordYouTube