Code Monkey home page Code Monkey logo

qb-k9's Introduction

Police K9 Scripts originally forked from hashisx https://github.com/hashisx/hashx_k9

Use

Purchase a dog from the location specified in the Config, use Z to follow or attack (Must be pointing a weapon to attack).

Press K to show K9 Commands (Both of these are now keymaps so its a on user basis)

Searching

You must be facing your target (vehicle or player) when selecting the Search Action, except for Search Area. Sometimes the Search Person will pick up the dog. Best to have the dog behind you.

K9 Ped

The k9 ped I use personally from this script is from here https://forum.cfx.re/t/how-to-german-shepherd-malinois-k9-dog-1-0-1/1065040

You must add this to QB Inventory Server main.lua.

local function HasItem(list, item)

    for i = 1, #list do

        if item == list[i] then
            return true
        end
    end

    return false
end

AddEventHandler("inventory:server:SearchLocalVehicleInventory", function(plate, list, cb)
local trunk = Trunks[plate]
local glovebox = Gloveboxes[plate]
local result = false

if trunk ~= nil then
    for k, v in pairs(trunk.items) do
        local ITEM = trunk.items[k].name
        if HasItem(list, ITEM) then
            RESULT = true
        end
    end
else
    trunk = GetOwnedVehicleItems(plate)

    for k, v in pairs(TRUNK) do

        local ITEM = TRUNK[k].name
        if HasItem(list, ITEM) then
            RESULT = true
        end
    end

end

if glovebox ~= nil then
    for k, v in pairs(glovebox.items) do

        local ITEM = glovebox.items[k].name
        if HasItem(list, ITEM) then
            RESULT = true
        end
    end
else
    glovebox = GetOwnedVehicleGloveboxItems(plate)

    for k, v in pairs(glovebox) do
        local ITEM = glovebox[k].name
        if HasItem(list, ITEM) then
            RESULT = true
        end
    end
end
cb(RESULT)

end)

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.