Code Monkey home page Code Monkey logo

qb-pmi's Introduction

Police Management Interface: qb-pmi [WIP]

This PMI was built for the purpose of getting rid of all the other google sheets and discord channels we were using to keep track of police things. Not all features might make sense for your server.

Support my Projects

Discord

WIP

Development of this resources is still ongoing. Theres a lot to do so its going to take some time. Here how ever are some screenshots of things that are being built at the moment.

Duty Screen Person Screen

Dependencies

Installation

Please read this carefully otherwise the PMI will not work.

SQL

Run the qb-pmi.sql file in your database to ensure you have the tables needed for the PMI

Config file changes

enableOxmysql - Set to true if you are using oxmysql instead of ghmattimysql

Required Functions

These functions need to be added to other resources in order for PMI functionality to work fully

qb-policejob/client/main.lua

RegisterNetEvent('police:client:setDuty')
AddEventHandler('police:client:setDuty', function(duty)
    if(PlayerJob.name == nil) then
        PlayerJob = QBCore.Functions.GetPlayerData().job
    end
    onDuty = duty
end)

Optional Functions

These functions or triggers improve the feel and experience of using the PMI. You do not need to do these but it is recommended.

Automatic updating of on duty vehicles

Where you take out the police vehicle add the following code to send the vehicle to the PMI (change the vehicle variable to the correct variable with the vehicle the player is in)

TriggerServerEvent("qb-pmi:server:vehicleTakeout", GetVehicleNumberPlateText(vehicle), GetEntityModel(vehicle))

Then for storing the vehicle add the following for while the player is still in the vehicle

TriggerServerEvent("qb-pmi:server:vehicleStore", GetVehicleNumberPlateText(GetVehiclePedIsIn(PlayerPedId())))

Auto setting a units radio channel

You need to add a call to update the officers radio channel on the PMI

HINT: If you are using pma-voice you need to go to pma-voice/client/module/radio.lua and add it in the setRadioChannel(channel) function.

TriggerServerEvent('qb-pmi:server:setOfficerRadio', channel)

The channel variable should be the numerical channel value.

Development Setup [Not needed for normal usage]

The source files for the UI are included in client/pmi-source, these can be used to change the PMI or add new things.

Disclaimer: Just because you changed something or added a new feature to the PMI does not give you rights to release the whole PMI as your own work. If its an amazing feature that everyone and there dog needs then make a pull request on github and I can see if it can become a permanent part of the project.

Setup

  1. Open the client/pmi-source directory and run npm install to install node modules
  2. To view the UI in your browser do npm run serve
  3. Make any changes you want an then run npm run build to build the files.
  4. The build files automatically go to the html directory, now just restart the resource on your server and you should see the changes.

qb-pmi's People

Contributors

nagsterfvz avatar

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.