Code Monkey home page Code Monkey logo

fivem-integrations's Introduction

@snailycad/fivem-integrations

This repository includes several FiveM integrations for SnailyCADv4.

Please see documenation here

Installation

For regular installation please see the documentation.

Integrations

sna-alpr

This must be used together with the Wraith ARS 2X resource. When a player runs a plate, it will automatically search the plate in your SnailyCAD instance.

sna-call911

This will allow a player to contact 911 Services from the chat. /sn-call911 <message>

sna-calltow

This will allow a player to contact Tow Services from the chat. /sn-calltow <message>

sna-calltaxi

This will allow a player to contact Taxi Services from the chat. /sn-calltaxi <message>

sna-postals

When this is enabled, it will automatically send the current postal code when a player contacts 911, Tow or Taxi services. For further details see the documentation.

sna-sync

This will allow a player to interact with your SnailyCAD instance from the game. For further details see the documentation.

Developer Docs

Source code installation

Warning This is only for developers who want to contribute to the project.

  1. Clone the repository: git clone https://github.com/SnailyCAD/fivem-integrations.git.
  2. Install dependencies: pnpm install.
  3. Copy .env.example to .env and enter your FXServer path.
  4. Run the dev command pnpm run dev. This will listen for changes and automatically update the files in your FXServer.
  5. Manually run restart <resource> in your FXServer console to restart the resource.

Publishing

  1. Run the bump releases script: node scripts/bump-version.mjs <version-here>.
  2. Commit the changes: git commit -am "chore(release): <version-here>.
  3. Push the changes: git push.

fivem-integrations's People

Contributors

casperiv0 avatar dependabot[bot] avatar jxckuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fivem-integrations's Issues

Correct error handling

Currently, when creating a call or using the ALPR plugin, if the user runs into an error from the CAD it will not display the error correctly and act as if nothing happened.

We should display this in a simple notification so the user knows something went wrong.

Panic button

Originally requested by MrDuck on Discord.

I would be nice that we could press a button in game and it sets our panic off

Note to self: This would rather be a command. Keybinds could be managed in the future using a Scaleform menu?

DMV

Commands to register player cars/weapons in game.

For example:
/register <weapon/car> -- register car their currently in or weapon their currently holding

Also exports to register weapons and cars via other scripts

Add an update checker to the FiveM integations

Currently, we don't have a version checker, therefore, users have to rely on Discord announcements. We have to add a version checker for users who aren't in the SnailyCAD Discord server.

In-Game notifications for assigned 911 calls, etc. Let's also use a custom notification system/UI.

  • Custom notifications UI (similar to SnailyCAD')
  • Incoming events: (Allow toggling of these like in SnailyCAD sound settings)
    • Signal 100
    • Panic button
    • AOP Changed
<div class="dark:bg-quinary pointer-events-auto flex w-full max-w-md rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5">
  <div class="w-0 flex-1 p-4">
    <div class="flex items-start">
      <div class="flex-shrink-0 pt-0.5"></div>
      <div class="-mt-1 ml-3 flex-1">
        <p class="mb-1 text-[1.05em] font-semibold capitalize text-gray-900 dark:text-gray-100">Super Cool</p>
        <div class="text-neutral-500 dark:text-gray-300">Hello World</div>
      </div>
    </div>
  </div>
  <div class="flex h-full items-start justify-start">
    <button type="button" aria-label="Close message" onClick="{() => toast.dismiss(t.id)}" class="flex w-full items-center justify-center rounded-none rounded-r-lg border border-transparent p-4 text-sm font-medium">X</button>
  </div>
</div>

Traffic Stop Command

  1. Unit stops a vehicle
  2. Unit runs command: /sn-traffic-stop or /sn-ts
  3. A call is created with type of traffic stop, description comes from command args, unit is automatically assigned to the call
  4. Message in chat is sent to confirm.

Add verification for API

A simple notification when the an integration has been detected it that notifies the FXServer developer/maintainer if the API URL is correct and that it's able to be used.

call911/tow/taxi exports

Add exports to the sna-call911 script.

exports:
exports["sna-call911"]:StartCall(caller_id, call_reason) or whatever you see fit
exports["sna-calltwo"]:StartCall(caller_id, call_reason) or whatever you see fit
exports["sna-calltaxi"]:StartCall(caller_id, call_reason) or whatever you see fit

Duty Status

Command that sets duty status in the cad

Example:
/status <10-8/10-80/etc.>

Also exports to set and get current status.

(I don't know my 10 codes)

Live map actions/triggers

Allow dispatchers to click anywhere on the live map, once clicked, Dispatch can have an action be performed (triggers?)

Implement FxDK

Problem: The integrations are now built and developed outside the server context (no goodies like hot-reload), which seriously impact DX.

Solutions:

  • Implement FxDK for hot-reload (yes, it has hot-reload for TS!) and very beginner-friendly DX
    or
  • Implement a workflow/script to set the output to FxServer (no hot-reload)

feat: toggable features

It should be possible to toggle chat messages, alerts, etc via the CAD-Settings inside SnailyCAD itself rather then a config file. This will make UX better for certain user groups.

Another Syntax Error ALPR

[     script:sna-alpr] Error: SyntaxError: Unexpected token < in JSON at position 0
[     script:sna-alpr]     at JSON.parse (<anonymous>)
[     script:sna-alpr]     at consumeEnd (@sna-alpr/server/server.js:5208:24)
[     script:sna-alpr]     at BodyReadable.<anonymous> (@sna-alpr/server/server.js:5195:11)
[     script:sna-alpr]     at BodyReadable.emit (node:events:394:28)
[     script:sna-alpr]     at BodyReadable.emit (@sna-alpr/server/server.js:5084:22)
[     script:sna-alpr]     at endReadableNT (node:internal/streams/readable:1343:12)
[     script:sna-alpr]     at processTicksAndRejections (node:internal/process/task_queues:83:21)
[     script:sna-alpr] Error: SyntaxError: Unexpected token < in JSON at position 0
[     script:sna-alpr]     at JSON.parse (<anonymous>)
[     script:sna-alpr]     at consumeEnd (@sna-alpr/server/server.js:5208:24)
[     script:sna-alpr]     at BodyReadable.<anonymous> (@sna-alpr/server/server.js:5195:11)
[     script:sna-alpr]     at BodyReadable.emit (node:events:394:28)
[     script:sna-alpr]     at BodyReadable.emit (@sna-alpr/server/server.js:5084:22)
[     script:sna-alpr]     at endReadableNT (node:internal/streams/readable:1343:12)
[     script:sna-alpr]     at processTicksAndRejections (node:internal/process/task_queues:83:21)

ALPR bug

[ script:sna-alpr] SCRIPT ERROR in timer: Error: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null.
[ script:sna-alpr] > (@sna-alpr/server/server.js:8164)
[ script:sna-alpr]

Syntax Error ALPR

[ script:sna-alpr] Error: SyntaxError: Unexpected token < in JSON at position 0
[ script:sna-alpr] at JSON.parse ()
[ script:sna-alpr] at consumeEnd (@sna-alpr/server/server.js:5208:24)
[ script:sna-alpr] at BodyReadable. (@sna-alpr/server/server.js:5195:11)
[ script:sna-alpr] at BodyReadable.emit (node:events:394:28)
[ script:sna-alpr] at BodyReadable.emit (@sna-alpr/server/server.js:5084:22)
[ script:sna-alpr] at endReadableNT (node:internal/streams/readable:1343:12)
[ script:sna-alpr] at processTicksAndRejections (node:internal/process/task_queues:83:21)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.