Code Monkey home page Code Monkey logo

qb-prison's Introduction

Support us on Ko-fi

- xThrasherrr

ko-fi

- xViperAG

ko-fi

Join the Discord

DESCRIPTION:

  • Updated Prison Script Orignially Modified by IN1GHTM4R3
  • Forked & Modified to v1.3: xThrasherrr#6666 and xViperAG#3029

FEATURES:

  • Reduce your time doing jobs!
    • Janitor - Go sweep the courtyard!
    • Cook - Prepare some slop!
    • Eletrician - Fix electrical boxes!
    • Randomly find items used for crafting!
  • Change into a prisoner outfit!
    • Set male/female outifts from the config
  • Prison Crafting
    • Set a location in the config
    • Set the items and required materials
  • Prison Food & Drinks w/ Minigames!
    • Canteen
    • Soda Machine (Minigame)
    • Coffee Machine (Minigame)
    • Slushy Machine (Minigame)
    • Configure what minigame to use for each drink machine!
      • Uses PS-UI, QB-Lock, and QB-Skillbar
      • All configurable from the config
  • Prison break!
    • qb-target at gate panels
    • PS-Var or PS-Thermite Minigames
  • Lockers for prisoners!
    • Adds lockers to every cell
    • Lockers open a citizenid stash
    • Police can seize the stashes by entering a citizenid
  • Be a lifer in prison!
    • Stay in prison forever! Time never reduces

DEVELOPMENT FEATURES:

  • Debug Configs
    • Prints for debugging
    • Polyzoine Debug
  • Create/Destroy all qb-target zones
    • Resource Start/Stop
    • Player Loaded/Unloaded
  • Choose to remove player jobs when entering prison
  • Supports citizenid table for lifers
  • Support for qb-prisonjobs
    • Paid script by xThrasherrr#6666
    • Adds more prison jobs
    • Adds more variety/randomness to crafting
    • Uses b1-skillz for lifting weights/chinups w/ cooldown
    • Prison Trader
    • More Items to be found

Installation:

  • Add slushy.png to your inventory/html/images folder
  • Add 'slushy' to qb-core/shared/items.lua
['slushy']                      = {['name'] = 'slushy',                     ['label'] = 'Slushy',                   ['weight'] = 750,       ['type'] = 'item',      ['image'] = 'slushy.png',       ['unique'] = true,      ['useable'] = true,     ['shouldClose'] = true,     ['combinable'] = nil,   ['description'] = 'A nice cold drink in the coldest place in San Andreas'},
  • Add to qb-smallreources/config.lua ["slushy"] = math.random(35, 54),
  • Add to qb-smallresources/server/consumables.lua
QBCore.Functions.CreateUseableItem("slushy", function(source, item)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
	if Player.Functions.RemoveItem(item.name, 1, item.slot) then
        TriggerClientEvent("consumables:client:Drink", src, item.name)
    end
end)
  • Add this to qb-smallresources/config.lua under ConsumeablesDrink = { ["slushy"] = math.random(35, 54),

Optional: If you have ps-buffs, add this to qb-smallresources/client/consumables.lua after the SetMetaData Server Event (OLD qb-smallresources)

        if itemName == "slushy" then
            exports['ps-buffs']:AddBuff("super-thirst", 25000)
        end

OLD qb-smallresources

RegisterNetEvent('consumables:client:Drink', function(itemName)
    TriggerEvent('animations:client:EmoteCommandStart', {"water"})
    QBCore.Functions.Progressbar("drink_something", "Drinking..", 5000, false, true, {
        disableMovement = false,
        disableCarMovement = false,
        disableMouse = false,
        disableCombat = true,
    }, {}, {}, {}, function() -- Done        
        TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[itemName], "remove")
        TriggerEvent('animations:client:EmoteCommandStart', {"c"})
        TriggerServerEvent("QBCore:Server:SetMetaData", "thirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + ConsumeablesDrink[itemName])
        if itemName == "slushy" then
            exports['ps-buffs']:AddBuff("super-thirst", 25000)
        end
    end, function()
        TriggerEvent('animations:client:EmoteCommandStart', {"c"})
    end, itemName)
end)

NEW qb-smallresources

RegisterNetEvent('consumables:client:Drink', function(itemName)
    TriggerEvent('animations:client:EmoteCommandStart', {"drink"})
    QBCore.Functions.Progressbar("drink_something", "Drinking..", 5000, false, true, {
        disableMovement = false,
        disableCarMovement = false,
        disableMouse = false,
        disableCombat = true,
    }, {}, {}, {}, function() -- Done
        TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[itemName], "remove")
        TriggerEvent('animations:client:EmoteCommandStart', {"c"})
        TriggerServerEvent("consumables:server:addThirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + ConsumablesDrink[itemName])
        if itemName == "slushy" then
            exports['ps-buffs']:AddBuff("super-thirst", 25000)
        end
    end)
end)

Dependencies:


Credits:


License

QBCore Framework
Copyright (C) 2021 Joshua Eger

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>

qb-prison's People

Contributors

xviperag avatar xthrasherrr 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.