Commands & Exports

This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.


Commands

triangle-exclamation

Server Exports

This section provides all available server exports for the script. These functions allow developers to interact with the system from the server side, manage data, trigger actions, and integrate with other resources. Each export includes a clear description and a practical example to simplify its implementation.

Export
Example

requestPayment

exports['ks_banking']:requestPayment(
        playerId,           -- TargetId
        amount,             -- Amount
        societyName,        -- ES Society name (ex: "police", "ambulance")
        "Service",          -- Payment Label (optionnal)
        "service_script",   -- Sender Script Name (optionnel, debug)
        function(success, data)
            if success then
                -- success = true/false
                -- data = invoiceId, amount, receiver, receiverName
                -- Success result do what you want here
            else
                -- Do nothing, or handle error
            end
        end
    )

sendInvoice

exports['ks_banking']:sendInvoice(
        playerId,          -- TargetId
        fuelAmount,        -- Amount
        "Plein d'essence", -- Payment Label (REQUIRED)
        "fuel_script",     -- Sender Script Name (optionnel, debug)
        function(success, data)
            -- success = true/false
            -- data = invoiceId, amount, receiver, receiverName
            
            if success then
                -- TriggerClientEvent('fuel:giveFuel', data.receiver, ...)
            else
                -- Do nothing, or handle error
            end
        end
    )

getFirstAccount

...

local identifier = xPlayer.identifier

exports['ks_banking']:getFirstAccount(identifier, function(account)
    if account then
       print(("^2[Example] Account found for %s^0"):format(xPlayer.getName()))
       print(("  - Account ID: %s"):format(account.id))
       print(("  - Account Name: %s"):format(account.name))
       print(("  - IBAN: %s"):format(account.iban))
       print(("  - Balance: $%s"):format(account.balance))
       print(("  - Cards: %s"):format(#account.cards))
       print(("  - Transactions: %s"):format(#account.transactions))
    else
       print(("^1[Example] No account found for %s^0"):format(xPlayer.getName()))
    end
end)

Mis à jour