Waypoint Scripts
  • Waypoint Scripts
  • Store
  • Support Discord
  • Scripts
    • 🚑Waypoint AI EMS
      • 📝Setup
      • 🖥️Code Snippets
      • ❔FAQ
      • 📃Exports / Events
      • 🔢Telemetry
    • 🚕Waypoint AI Taxi
      • 📝Setup
      • 🖥️Code Snippets
      • 📃Exports / Events
      • 🔢Telemetry
    • 🎆Waypoint Fireworks
      • 📝Setup
    • 💡Waypoint Neons
      • 📝Setup
    • 🐕Waypoint Animals
      • 📝Setup
      • ❔FAQ
  • Free Scripts
    • 🚚Waypoint Tow / Hauling
    • 🛠️Waypoint Placeables
    • 🚦Waypoint Traffic Lights
    • 🧘‍♂️Waypoint Yogamats
    • 🖨️Waypoint Printer
    • 🚲Waypoint Pocket Bikes
    • 👻Waypoint Smoke Monster
    • 🪑Waypoint Seats
Powered by GitBook
On this page
  • Prevent player from exiting while their seatbelt is on
  • Prevent car theft alerts when player enters the taxi
  1. Scripts
  2. Waypoint AI Taxi

Code Snippets

PreviousSetupNextExports / Events

Last updated 1 month ago

Prevent player from exiting while their seatbelt is on

Update HasSeatbeltOnfunction in the framework file to integrate with your seatbelt script.

We provided an implementation fo qbox and qbcore by default.

Note for qbcore, qb-smallresources/seatbelt.lua you will need to add an export to the file.

If the following PR gets merged then you will not need to add it:

function HasSeatbeltOn()
    return seatbeltOn
end
exports("HasSeatbeltOn", HasSeatbeltOn)

Prevent car theft alerts when player enters the taxi

Add this into your alerts script where carjacking alerts are triggered.

-- If the player has a taxi dispatched, dont trigger this alert 
-- as they are likely entering the taxi that was dispatched
if exports["wp-ai-taxi"]:isTaxiDispatched() then return end

If you are using ps-dispatch, look for AddEventHandler('CEventPedJackingMyVehicle', function(witnesses, jacker) in the cl_eventhandlers.lua and add the snippet in here.

---@param witnesses table | Array of Ped IDs that witnessed the event
---@param jacker number | The Ped ID of the jacker
AddEventHandler('CEventPedJackingMyVehicle', function(witnesses, jacker)
    -- If AutoAlerts are disabled, don't trigger
    if not Config.Enable['Autotheft'] then return end

    -- If the player has a taxi dispatched, dont trigger this alert as they are likely entering the taxi that was dispatched
    if exports["wp-ai-taxi"]:isTaxiDispatched() then return end
   ...
end)

🚕
🖥️
https://github.com/qbcore-framework/qb-smallresources/pull/496