ngddocs/ngdredemption.md

6.1 KiB

title description published date tags editor dateCreated
ngd-redemption true 2025-01-29T01:16:54.161Z markdown 2025-01-28T00:30:34.910Z

This guide assumes you already have a Tebex store integrated with FiveM. If you do not, please refer to their documentation.


Installation Steps

  1. Install ngd-Bridge

    Follow the guide to install ngd-Bridge HERE.

  2. Install ngd-redemption

    Place ngd-redemption into your [ngd] folder. This script must be started after ngd-Bridge.

  3. Modify Tebex Listings

Add Commands (Click to Expand)
  • Select Tebex listing you wish to add.
  • At the bottom of the screen, click on Game Server Commands
  • Once that opens, click on the gear to expand more options. -- Make sure the package delivery option is set to deliver even if the player is offline -- Inside of the when package is purchased field, put the following:
NGDRedemption {packageId} {transaction}

See Example:

  1. Configure Packages In Script

Script Configuration (Click to Expand)
  • In a web browser, navigate to your Tebex package. -- The #s seen at the end of the link are the Package ID, and will be used to configure the items in the script.
  • Inside of the config.lua, you will see Config.Packages = { -- You will need to add the Package ID from the step above, into the [] and configure each package

  • There are several variables to the packages you can choose from:

-- Type = (You can use 'item', 'vehicle' or 'other') -- Label = (This is what is show in-game) -- Item = (This is the item given to players if the Type = 'item') -- Qty = (This is the amount of the item given above) -- Model = (This is the vehicle spawn code if Type = 'vehicle')


  • See example from the config below: -- Package 6650632 is an item that is given to players, the menu will show it as a 'A Pack of Lockpicks', and the player will be given 5 of them. -- Package 6650679 is a vehicle, the menu will show it as 'Pagassi - Zentorno' and the spawn code is a 'zentorno' -- The packages are defined in the config, you should make sure the package from Tebex matches.
Config.Packages = {
    [6650632] = {
        Type = 'item',
        Label = 'A Pack Of Lockpicks',
        Item = 'lockpick',
        Qty = 5
    },
    [6650679] = {
        Type = 'vehicle',
        Label = 'Pagassi - Zentorno',
        Model = 'zentorno'
    }
}
  1. Set Garages

Garage Configuration (Click to Expand)

You MUST set your garage in the editableserver.lua file. If you need help, open a ticket in our Discord {.is-warning}

  • Set your garage name/id in the Config.GarageName to ensure the vehicles are put into the correct garage!
  • The script comes pre-configured for JG and CD garages. If you don't use these, make sure you set your garage configuration in the editableserver.lua file.
  1. Test Drives

Test Drive Configuration (Click to Expand)

Test Drives (Optional)

  • The script comes with an optional 'test drive' feature that allows you to make it so players can test drive premium vehicles before purchasing them on your Tebex store.

  • This is enabled by default, and all you have to do is configure what vehicles you want, their label that will show up in the menu and the locations where the player is teleported back when the test drive is complete.

Config.TestDrives = {
    Enabled = true,
    Time = 2, --minutes
    SpawnLocation = vector4(-1319.23, -2181.06, 13.94, 152.21),
    ReturnLocation = vector4(158.26, -739.98, 246.15, 66.94),
    Vehicles = {
        ['zentorno'] = {
            Label = 'Zentorno'
        },
        ['faggio'] = {
            Label = 'Awesome Moped'
        }
    }
}

  • You must also set your vehicle keys and fuel in the following configs. The plate doesn't need to be changed unless you want it to.
--Fuel System:
Config.VehicleFuel = function(vehicle)
    Entity(vehicle).state.fuel = 100
end

--Keys System:
Config.TestDriveVehicleKeys = function(vehicle, plate)
    exports['ngd-smallresources']:GiveLogicalKey(plate)
end

--Plate
Config.TestDriveVehiclePlate = function(vehicle)
    local uniquePlate = 'Prem' .. math.random(1000, 9999)
    SetVehicleNumberPlateText(vehicle, uniquePlate)
end
  1. LOGS

Logs Configuration (Click to Expand) - The script comes pre-configured for either Discord or Fivemerr logs. Choose your log type in the config and follow the instructions below to configure it.

Discord:

  • To use the discord logging feature, set the Config.LogType = 2, and add your webhook into the top of the editableserver.lua file.

Fivemerr:

  • To use the Fivemerr logs, set the `Config.LogType = 1'.
  • Open your server.cfg and add the following:
    set fivemerr_ngdredemption 'YOUR_API_KEY'
    
  • Replace YOUR_API_KEY with your API key from the Fivemerr dashboard.

Custom / No Logs:

  • To use your own logging logic, or to use no logs at all, set the `Config.LogType = 0'
  • If you wish to use your own logic, you can add it into the following function found inside the editableserver.lua
function CustomLogs(data, message)

end

Translations

  • Make sure you review the translate.lua file, as this is where you will be able to set the name of your store, garage information, etc.

Do you still need help? Open a ticket in our Discord {.is-warning}