TXOS - FiveM Scripts Documentation
STOREDISCORD
  • TXOS Documentation
  • DEPENDENCY
    • TXOS Lib
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Framework customization
  • Resources
    • TXOS Armory
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Badge
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Jewel
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Trucking
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
    • TXOS Esc
      • Dependencies
      • Installation
      • Configuration
      • Open methods
      • Exports / Events
Powered by GitBook
On this page
  1. Resources
  2. TXOS Trucking

Open methods

We have some open methods on the client and server of trucking. These allow you to give keys for the trucks, define anti abuse measures and more.

OpenMethods = {}

function OpenMethods.canOpenTruckerMenu() -- Define if the player can open the trucker menu
    --[[if exports['ox_inventory']:IsOpen() or exports["lb-phone"]:IsOpen() or exports['qs-inventory']:inInventory() then
        return false
    end]]

    return true
end

function OpenMethods.TruckSpawned(truck)
    -- If you use a key system for cars, you need to give the player the key here
    --TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', GetVehicleNumberPlateText(truck)) -- Example for QB Vehicle Keys
end

function OpenMethods.TruckDespawned(truck)
    -- If you use a key system for cars, you need to remove the key here
end

function OpenMethods.drawMarker() -- Draw the marker for the trucker menu (Only if UseTarget is false)
    local r, g, b, a = table.unpack(Config.Options.JobLocation.DrawMarkerColor)
    DrawMarker(27, vector3(Config.Options.JobLocation.JobPlace.x, Config.Options.JobLocation.JobPlace.y, Config.Options.JobLocation.JobPlace.z - 1.0), vector3(0.0, 0.0, 0.0), vector3(0.0, 0.0, 0.0), vector3(1.0, 1.0, 1.0), r, g, b, a, false, false, 2, false, false, false)
end
OpenMethods = {}

function OpenMethods.antiAbuse(source)
    DropPlayer(source, "[TXOS] Anti-Abuse")
end

PreviousConfigurationNextExports / Events

Last updated 5 months ago