Giter Club home page Giter Club logo

trespassing-alarms's Introduction

QB-Core Trespassing Alarms

A system to create polyzones, with a given chance to alert police on trespassing
Created by Nikki#9699

screenshot-alert

Preview video

https://streamable.com/g9z7ux

INTRODUCTION

  • A resource where polyzones are setup to protect an area
  • Specific Jobs can be ignored (Changeable in config.lua) (If left empty it will always trigger)
  • Chance for alert can be changed per polyzone (Changeable in config.lua)
  • Set cooldown to prevent continous trigger (Changeable in config.lua)

DEPENDENCIES

[qb-core] (https://github.com/qbcore-framework/qb-core) - QBCore
[PolyZone] (https://github.com/mkafrin/PolyZone) - To create the zones
[interact-sound] (https://github.com/plunkettscott/interact-sound) - To play audio files
[ps-dispatch] (https://github.com/Project-Sloth/ps-dispatch) - For the police dispatch calls

Installation Instruction

  1. Move "trespassing-alarms" into your resource folder and ensure it
  2. Move the "Tresspass_Alarm.ogg" into interact-sound/client/html/sounds
  3. Update the "config.lua" to your liking

Config.lua file

Config = {}

-- Enable Debugging (Always Alert)
Config.debug = false

Config.zones = {
    [1] = {
        label = "Lucky Plucker", -- Label for your convenience
        zones = { -- Polyzone Coords
            vector2(-68.64, 6268.05),
            vector2(-67.48, 6266.01),
            vector2(-73.08, 6262.27),
            vector2(-74.09, 6264.62),
        },
        minZ = 29.7,
        maxZ = 33.1,
        ignoredJobs = { -- Set jobs that will be ignored
            "police",
            "ambulance"
        },
        -- Alert Configuration
        alertChance = 20,
        alertCooldown = 10, -- Time in seconds
        alarmSound = 'Tresspass_Alarm' -- sound file in interact-sound
    },
    [2] = {
        label = "LS Water & Power", -- Label for your convenience
        zones = { -- Polyzone Coords
            vector2(733.28, 130.44),
            vector2(731.22, 131.09),
            vector2(733.88, 135.59),
            vector2(735.7, 134.5),
        },
        minZ = 79.7,
        maxZ = 83.1,
        ignoredJobs = { -- Set jobs that will be ignored
            "police",
            "ambulance"
        },
        -- Alert Configuration
        alertChance = 20,
        alertCooldown = 10, -- Time in seconds
        alarmSound = 'Tresspass_Alarm' -- sound file in interact-sound
    },
}

Zone setup

[1] = {
        label = "Lucky Plucker", -- Label for your convenience
        zones = { -- Polyzone Coords
            vector2(-68.64, 6268.05),
            vector2(-67.48, 6266.01),
            vector2(-73.08, 6262.27),
            vector2(-74.09, 6264.62),
        },
        minZ = 29.7,
        maxZ = 33.1,
        ignoredJobs = { -- Set jobs that will be ignored
            "police",
            "ambulance"
        },
        -- Alert Configuration
        alertChance = 20,
        alertCooldown = 10, -- Time in seconds
        alarmSound = 'Tresspass_Alarm' -- sound file in interact-sound
    },

trespassing-alarms's People

Contributors

tzuyudev 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.