├── images ├── taxi.png ├── vagos.png ├── ballas.png ├── lostmc.png ├── police.png ├── ambulance.png ├── cardealer.png ├── families.png ├── mechanic.png ├── menus │ ├── taxi.png │ ├── ballas.png │ ├── fleeca.png │ ├── lostmc.png │ ├── paleto.png │ ├── police.png │ ├── vagos.png │ ├── ambulance.png │ ├── cardealer.png │ ├── families.png │ ├── mechanic.png │ ├── pacific.png │ ├── personal.png │ └── realestate.png ├── realestate.png └── items │ └── vault_key.png ├── vaults.sql ├── fxmanifest.lua ├── README.md ├── server └── main.lua ├── client ├── utils.lua └── stashes.lua ├── shared └── config.lua └── LICENSE /images/taxi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/taxi.png -------------------------------------------------------------------------------- /images/vagos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/vagos.png -------------------------------------------------------------------------------- /images/ballas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/ballas.png -------------------------------------------------------------------------------- /images/lostmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/lostmc.png -------------------------------------------------------------------------------- /images/police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/police.png -------------------------------------------------------------------------------- /images/ambulance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/ambulance.png -------------------------------------------------------------------------------- /images/cardealer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/cardealer.png -------------------------------------------------------------------------------- /images/families.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/families.png -------------------------------------------------------------------------------- /images/mechanic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/mechanic.png -------------------------------------------------------------------------------- /images/menus/taxi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/taxi.png -------------------------------------------------------------------------------- /images/realestate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/realestate.png -------------------------------------------------------------------------------- /images/menus/ballas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/ballas.png -------------------------------------------------------------------------------- /images/menus/fleeca.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/fleeca.png -------------------------------------------------------------------------------- /images/menus/lostmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/lostmc.png -------------------------------------------------------------------------------- /images/menus/paleto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/paleto.png -------------------------------------------------------------------------------- /images/menus/police.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/police.png -------------------------------------------------------------------------------- /images/menus/vagos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/vagos.png -------------------------------------------------------------------------------- /images/items/vault_key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/items/vault_key.png -------------------------------------------------------------------------------- /images/menus/ambulance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/ambulance.png -------------------------------------------------------------------------------- /images/menus/cardealer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/cardealer.png -------------------------------------------------------------------------------- /images/menus/families.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/families.png -------------------------------------------------------------------------------- /images/menus/mechanic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/mechanic.png -------------------------------------------------------------------------------- /images/menus/pacific.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/pacific.png -------------------------------------------------------------------------------- /images/menus/personal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/personal.png -------------------------------------------------------------------------------- /images/menus/realestate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinySpriteScripts/tss-stashbox/HEAD/images/menus/realestate.png -------------------------------------------------------------------------------- /vaults.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `sayer_vaults` ( 2 | `id` int(11) NOT NULL AUTO_INCREMENT, 3 | `citizenid` varchar(50) DEFAULT NULL, 4 | `vaults` text DEFAULT NULL, 5 | PRIMARY KEY (`id`), 6 | KEY `citizenid` (`citizenid`) 7 | ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | 4 | author 'oosayeroo' 5 | description 'sayer-stashbox' 6 | version '2.1.0' 7 | 8 | client_scripts { 9 | 'client/stashes.lua', 10 | 'client/utils.lua', 11 | } 12 | 13 | server_scripts { 14 | '@oxmysql/lib/MySQL.lua', 15 | 'server/main.lua', 16 | } 17 | 18 | shared_scripts{ 19 | 'shared/config.lua', 20 | } 21 | 22 | files { 23 | 'images/**/*.png', 24 | } 25 | 26 | lua54 'yes' 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sayer-stashbox 2 | 3 | Discord - https://discord.gg/3WYz3zaqG5 4 | 5 | an advanced storage script for jobs,gangs,personal stashes 6 | with built in Bank vault system 7 | 8 | ## Dependencies 9 | - [qb-core](https://github.com/qbcore-framework/qb-core) 10 | - [qb-menu](https://github.com/qbcore-framework/qb-menu) 11 | 12 | ## Installation 13 | - run the sql file "vaults.sql" 14 | - configure in shared/config.lua 15 | 16 | ## Rainmad 17 | if using rainmads pacific heist go to rm_pacificheist/server.lua and paste this event into it at the bottom 18 | ``` 19 | QBCore.Functions.CreateCallback('pacificheist:server:isBankHeist', function(_, cb) 20 | cb(start) 21 | end) 22 | ``` -------------------------------------------------------------------------------- /server/main.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | 3 | function DebugCode(msg) 4 | if Config.DebugCode then 5 | print(msg) 6 | end 7 | end 8 | 9 | function SendNotify(src, msg, type, time, title) 10 | if not title then title = "Chop Shop" end 11 | if not time then time = 5000 end 12 | if not type then type = 'success' end 13 | if not msg then DebugCode("SendNotify Server Triggered With No Message") return end 14 | if Config.NotifyScript == 'qb' then 15 | TriggerClientEvent('QBCore:Notify', src, msg, type, time) 16 | elseif Config.NotifyScript == 'okok' then 17 | TriggerClientEvent('okokNotify:Alert', src, title, msg, time, type, false) 18 | elseif Config.NotifyScript == 'qs' then 19 | TriggerClientEvent('qs-notify:Alert', src, msg, time, type) 20 | elseif Config.NotifyScript == 'other' then 21 | --add your notify event here 22 | end 23 | end 24 | 25 | QBCore.Functions.CreateCallback('sayer-stashbox:GetPlayers', function(source, cb) 26 | local PlayerList = nil 27 | local MyPlayer = QBCore.Functions.GetPlayer(source) 28 | local myCID = MyPlayer.PlayerData.citizenid 29 | for k, v in pairs(QBCore.Functions.GetPlayers()) do 30 | local Player = QBCore.Functions.GetPlayer(v) 31 | local cid = Player.PlayerData.citizenid 32 | if cid ~= myCID then 33 | local item = {} 34 | item.id = tonumber(v) 35 | DebugCode("ID = "..item.id) 36 | item.text = "ID:"..v.." >< "..Player.PlayerData.charinfo.firstname..' '..Player.PlayerData.charinfo.lastname 37 | DebugCode("Text = "..item.text) 38 | if PlayerList == nil then PlayerList = {} end 39 | table.insert(PlayerList, item) 40 | end 41 | end 42 | cb(PlayerList) 43 | end) 44 | 45 | RegisterNetEvent('sayer-stashbox:OpenInventory',function(id,args) 46 | local inventoryName = id 47 | local data = args 48 | exports['qb-inventory']:OpenInventory(source, inventoryName, data) 49 | end) 50 | 51 | RegisterNetEvent('sayer-stashbox:PurchaseVault', function(bank,price) 52 | local src = source 53 | local Player = QBCore.Functions.GetPlayer(src) 54 | if not Player then return end 55 | local citizenid = Player.PlayerData.citizenid 56 | 57 | if Player.Functions.RemoveMoney('bank',price) then 58 | MySQL.rawExecute('SELECT * FROM sayer_vaults WHERE citizenid = ?', { citizenid }, function(result) 59 | if result[1] then 60 | local Vaults = json.decode(result[1].vaults) 61 | if not Vaults[bank].Purchased then 62 | Vaults[bank].Purchased = true 63 | Vaults[bank].Upgrade = 1 64 | local Table = json.encode(Vaults) 65 | MySQL.update('UPDATE sayer_vaults SET vaults = ? WHERE citizenid = ?', { Table, citizenid }) 66 | else 67 | SendNotify(src,"You Already Bought This Vault", 'error') 68 | end 69 | else 70 | local Vaults = {} 71 | for k,v in pairs(Config.Banks) do 72 | Vaults[k] = { 73 | Purchased = false, 74 | KeyHolders = {}, 75 | Upgrade = 0, 76 | } 77 | end 78 | Vaults[bank].Purchased = true 79 | Vaults[bank].Upgrade = 1 80 | local Table = json.encode(Vaults) 81 | MySQL.insert('INSERT INTO sayer_vaults (citizenid, vaults) VALUES (?, ?)', { 82 | citizenid, 83 | Table, 84 | }) 85 | end 86 | end) 87 | else 88 | SendNotify(src,"Not Enough Money", 'error') 89 | end 90 | end) 91 | 92 | RegisterNetEvent('sayer-stashbox:UpgradeVault', function(data) 93 | local bank = data.bank 94 | local upgrade = data.upgrade 95 | local src = source 96 | local Player = QBCore.Functions.GetPlayer(src) 97 | if not Player then return end 98 | local citizenid = Player.PlayerData.citizenid 99 | local upgradeprice = Config.VaultUpgrades[bank][upgrade].UpgradePrice 100 | local maxupgrades = #Config.VaultUpgrades[bank] 101 | if maxupgrades == upgrade then 102 | SendNotify(src,"Cannot Upgrade Membership Further", 'error') 103 | return 104 | end 105 | 106 | MySQL.rawExecute('SELECT * FROM sayer_vaults WHERE citizenid = ?', { citizenid }, function(result) 107 | if result[1] then 108 | local Vaults = json.decode(result[1].vaults) 109 | if Vaults[bank].Purchased then 110 | if Player.Functions.RemoveMoney('bank',upgradeprice) then 111 | Vaults[bank].Upgrade = Vaults[bank].Upgrade + 1 112 | local Table = json.encode(Vaults) 113 | MySQL.update('UPDATE sayer_vaults SET vaults = ? WHERE citizenid = ?', { Table, citizenid }) 114 | else 115 | SendNotify(src,"Not Enough Money", 'error') 116 | end 117 | else 118 | SendNotify(src,"You Dont Have a Vault Here", 'error') 119 | end 120 | else 121 | SendNotify(src, "Vault Not Found", 'error') 122 | end 123 | end) 124 | end) 125 | 126 | RegisterNetEvent('sayer-stashbox:GrantVaultAccess', function(bank,player) 127 | local src = source 128 | local Owner = QBCore.Functions.GetPlayer(src) 129 | local Player = QBCore.Functions.GetPlayer(tonumber(player)) 130 | if not Owner then return end 131 | local ownercitizenid = Owner.PlayerData.citizenid 132 | local playercitizenid = Player.PlayerData.citizenid 133 | local shareprice = Config.Banks[bank].GiveKeyPrice 134 | 135 | MySQL.rawExecute('SELECT * FROM sayer_vaults WHERE citizenid = ?', { ownercitizenid }, function(result) 136 | if result[1] then 137 | local Vaults = json.decode(result[1].vaults) 138 | if Vaults[bank].Purchased then 139 | if #Vaults[bank].KeyHolders == Config.MaxKeyholders then 140 | SendNotify(src,"Max Number Of KeyHolders Reached", 'error') 141 | return 142 | end 143 | if Vaults[bank].KeyHolders[playercitizenid] == nil then 144 | if Owner.Functions.RemoveMoney('bank',shareprice) then 145 | Vaults[bank].KeyHolders[playercitizenid] = true 146 | else 147 | SendNotify(src,"Not Enough Money In Bank", 'error') 148 | end 149 | else 150 | SendNotify(src, "This Person Is Already a Keyholder", 'error') 151 | return 152 | end 153 | local Table = json.encode(Vaults) 154 | MySQL.update('UPDATE sayer_vaults SET vaults = ? WHERE citizenid = ?', { Table, ownercitizenid }) 155 | else 156 | SendNotify(src,"You Dont Have a Vault Here", 'error') 157 | end 158 | else 159 | SendNotify(src, "Vault Not Found", 'error') 160 | end 161 | end) 162 | end) 163 | 164 | 165 | QBCore.Functions.CreateCallback('sayer-stashbox:GetSharedVaults', function(source, cb, bank) 166 | local src = source 167 | local Player = QBCore.Functions.GetPlayer(src) 168 | if not Player then return end 169 | local citizenid = Player.PlayerData.citizenid 170 | local ValidVaults = {} 171 | local Vaults = {} 172 | 173 | MySQL.rawExecute('SELECT * FROM sayer_vaults ', { }, function(result) 174 | if result then 175 | for k,v in pairs(result) do 176 | Vaults = json.decode(v.vaults) 177 | if Vaults[bank] ~= nil then 178 | if Vaults[bank].KeyHolders ~= nil then 179 | if Vaults[bank].KeyHolders[citizenid] ~= nil then 180 | local owner = QBCore.Functions.GetPlayerByCitizenId(v.citizenid) 181 | ValidVaults[v.citizenid] = { 182 | text = "Open "..owner.PlayerData.charinfo.firstname..' '..owner.PlayerData.charinfo.lastname.." Vault", 183 | upgrade = Vaults[bank].Upgrade, 184 | } 185 | else 186 | DebugCode("v.vaults[bank].KeyHolders[citizenid] returned nil") 187 | end 188 | else 189 | DebugCode("v.vaults[bank].KeyHolders returned nil") 190 | end 191 | else 192 | DebugCode("v.vaults[bank] returned nil") 193 | end 194 | end 195 | for k,v in pairs(ValidVaults) do 196 | DebugCode("ValidVaults:k: "..tostring(k)) 197 | DebugCode("ValidVaults:v.text: "..tostring(v.text)) 198 | DebugCode("ValidVaults:v.upgrade: "..tostring(v.upgrade)) 199 | end 200 | cb(ValidVaults) 201 | else 202 | SendNotify(src, "Vault Not Found", 'error') 203 | end 204 | end) 205 | end) 206 | 207 | QBCore.Functions.CreateCallback('sayer-stashbox:GetBankDetails', function(source, cb, bank) 208 | local Player = QBCore.Functions.GetPlayer(source) 209 | local citizenid = Player.PlayerData.citizenid 210 | if not Config.Banks[bank] then return end 211 | 212 | MySQL.rawExecute('SELECT * FROM sayer_vaults WHERE citizenid = ?', { citizenid }, function(result) 213 | if result[1] then 214 | DebugCode("citizenid: "..tostring(result[1].citizenid)) 215 | DebugCode("id: "..tostring(result[1].id)) 216 | local Vaults = json.decode(result[1].vaults) 217 | for d,j in pairs(Vaults) do 218 | DebugCode("Vaults:d: "..tostring(d)) 219 | DebugCode("Vaults:j.Purchased: "..tostring(j.Purchased)) 220 | DebugCode("Vaults:j.Upgrade: "..tostring(j.Upgrade)) 221 | end 222 | if Vaults[bank] == nil then 223 | Vaults[bank] = { 224 | Purchased = false, 225 | KeyHolders = {}, 226 | Upgrade = 0, 227 | } 228 | local Table = json.encode(Vaults) 229 | MySQL.update('UPDATE sayer_vaults SET vaults = ? WHERE citizenid = ?', { Table, citizenid }) 230 | end 231 | if Vaults[bank].Purchased then 232 | cb(Vaults[bank]) 233 | else 234 | cb(nil) 235 | end 236 | else 237 | cb(nil) 238 | end 239 | end) 240 | end) 241 | 242 | QBCore.Functions.CreateCallback('sayer-stashbox:PD:GetVault', function(source, cb, bank, cid) 243 | local Player = QBCore.Functions.GetPlayer(source) 244 | local citizenid = Player.PlayerData.citizenid 245 | if not Config.Banks[bank] then return end 246 | 247 | MySQL.rawExecute('SELECT * FROM sayer_vaults WHERE citizenid = ?', { cid }, function(result) 248 | if result[1] then 249 | local Vaults = json.decode(result[1].vaults) 250 | for d,j in pairs(Vaults) do 251 | DebugCode("Vaults:d: "..tostring(d)) 252 | DebugCode("Vaults:j.Purchased: "..tostring(j.Purchased)) 253 | DebugCode("Vaults:j.Upgrade: "..tostring(j.Upgrade)) 254 | end 255 | if Vaults[bank] ~= nil then 256 | if Vaults[bank].Purchased then 257 | cb(Vaults[bank]) 258 | else 259 | cb(nil) 260 | end 261 | else 262 | cb(nil) 263 | end 264 | else 265 | cb(nil) 266 | end 267 | end) 268 | end) 269 | 270 | -------------------------------------------------------------------------------- /client/utils.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local StashProp = {} 3 | local Stash = {} 4 | local inRangeStash = false 5 | local shownStash = false 6 | 7 | local function CloseMenuFull() 8 | exports['qb-core']:HideText() 9 | shownStash = false 10 | end 11 | 12 | function IsPlayerValid(Type, Need) 13 | local playerData = QBCore.Functions.GetPlayerData() 14 | local isdead = playerData.metadata["isdead"] 15 | local laststand = playerData.metadata["inlaststand"] 16 | 17 | if not isdead or not laststand then 18 | if Type == 'job' then 19 | return playerData.job.name == Need 20 | elseif Type == 'gang' then 21 | return playerData.gang.name == Need 22 | elseif Type == 'citizenid' then 23 | return playerData.citizenid == Need 24 | end 25 | end 26 | 27 | return false 28 | end 29 | 30 | function GetPlayerMoney(account) 31 | local has = QBCore.Functions.GetPlayerData().money[account] 32 | return has 33 | end 34 | 35 | function DebugCode(msg) 36 | if Config.DebugCode then 37 | print(msg) 38 | end 39 | end 40 | 41 | function RunTargetThread() 42 | DebugCode("Target Thread Active") 43 | 44 | local function createTargetForStash(k, v) 45 | local Label = "Open "..((v.Type == 'job' and QBCore.Shared.Jobs[k].label) or (v.Type == 'gang' and QBCore.Shared.Gangs[k].label) or (v.Type == 'citizenid' and "My")).." Stash" 46 | Stash["StashBox_"..k] = 47 | exports['qb-target']:AddBoxZone("StashBox_"..k, v.Coords, v.BoxZone.length, v.BoxZone.width, { 48 | name = "StashBox_"..k, 49 | heading = v.BoxZone.heading, 50 | debugPoly = Config.DebugStashZones, 51 | minZ = v.Coords.z-2, 52 | maxZ = v.Coords.z+2, 53 | }, { 54 | options = { 55 | { 56 | action = function() 57 | OpenStashMenu(k,v.Type,v.Stashes) 58 | end, 59 | canInteract = function() 60 | return IsPlayerValid(v.Type, k) 61 | end, 62 | icon = "fas fa-box", 63 | label = Label, 64 | }, 65 | }, 66 | distance = v.Distance 67 | }) 68 | DebugCode("Target Created For: "..tostring(k).." At Coords: "..tostring(v.Coords)) 69 | end 70 | 71 | for k, v in pairs(Config.Stashes) do 72 | if v.Enable and v.Coords and v.BoxZone and v.Stashes then 73 | createTargetForStash(k, v) 74 | end 75 | end 76 | 77 | local function createTargetForVault(k, d, j) 78 | Stash["Vault"..k..d] = 79 | exports['qb-target']:AddBoxZone("Vault"..k..d, j.Coords, j.BoxZone.length, j.BoxZone.width, { 80 | name = "Vault"..k..d, 81 | heading = j.BoxZone.heading, 82 | debugPoly = Config.DebugStashZones, 83 | minZ = j.Coords.z-2, 84 | maxZ = j.Coords.z+2, 85 | }, { 86 | options = { 87 | { 88 | action = function() 89 | OpenVaultMenu(k) 90 | end, 91 | icon = "fas fa-sack-dollar", 92 | label = "Bank Vault", 93 | }, 94 | }, 95 | distance = j.Distance 96 | }) 97 | DebugCode("Target Created For: "..tostring(k).." Vault At Coords: "..tostring(j.Coords)) 98 | end 99 | 100 | if Config.EnableBankVaults then 101 | for k, v in pairs(Config.Banks) do 102 | if v.Enable then 103 | for d, j in pairs(v.Locations) do 104 | if j.Coords and j.BoxZone then 105 | createTargetForVault(k, d, j) 106 | end 107 | end 108 | end 109 | end 110 | end 111 | end 112 | 113 | function RunDrawtextThread() 114 | DebugCode("Drawtext Thread Active") 115 | CreateThread(function() 116 | while true do 117 | Wait(0) 118 | local playerCoords = GetEntityCoords(PlayerPedId()) 119 | local inRange = false 120 | 121 | -- Function to handle stash logic 122 | local function handleStash(v, k, label) 123 | if IsPlayerValid(v.Type, k) and #(playerCoords - v.Coords) < v.Distance then 124 | if not shownStash then 125 | DebugCode("In Range Of " .. tostring(k)) 126 | exports['qb-core']:DrawText(label, 'left') 127 | shownStash = true 128 | end 129 | if IsControlJustReleased(0, 38) then 130 | exports['qb-core']:HideText() 131 | OpenStashMenu(k, v.Type, v.Stashes) 132 | DebugCode("DrawtextThread:Pressed E") 133 | end 134 | return true 135 | end 136 | return false 137 | end 138 | 139 | local function handleVault(v, k, label) 140 | if #(playerCoords - v.Coords) < v.Distance then 141 | if not shownStash then 142 | DebugCode("In Range Of " .. tostring(k)) 143 | exports['qb-core']:DrawText(label, 'left') 144 | shownStash = true 145 | end 146 | if IsControlJustReleased(0, 38) then 147 | exports['qb-core']:HideText() 148 | OpenVaultMenu(k) 149 | DebugCode("DrawtextThread:Pressed E") 150 | end 151 | return true 152 | end 153 | return false 154 | end 155 | 156 | -- Iterate through stashes 157 | for k, v in pairs(Config.Stashes) do 158 | if v.Enable and v.Coords and v.Stashes then 159 | local Label = "Open "..((v.Type == 'job' and QBCore.Shared.Jobs[k].label) or (v.Type == 'gang' and QBCore.Shared.Gangs[k].label) or (v.Type == 'citizenid' and "My")).." Stash" 160 | inRange = handleStash(v, k, Label) or inRange 161 | end 162 | end 163 | 164 | -- Iterate through bank vaults 165 | if Config.EnableBankVaults then 166 | for k, v in pairs(Config.Banks) do 167 | if v.Enable and v.Locations then 168 | for d, j in pairs(v.Locations) do 169 | if handleVault(j, k, "[E] Bank Vault") then 170 | inRange = true 171 | end 172 | end 173 | end 174 | end 175 | end 176 | 177 | -- Hide text if not in range 178 | if not inRange and shownStash then 179 | CloseMenuFull() 180 | exports['qb-core']:HideText() 181 | shownStash = false 182 | end 183 | end 184 | end) 185 | end 186 | 187 | function InitializeStashProps() 188 | for k, v in pairs(Config.Stashes) do 189 | if v.Enable and v.Prop.Enable and v.Prop.Model ~= nil then 190 | if not DoesEntityExist("Prop_"..k) then 191 | DebugCode("MakingProp: "..tostring(k)) 192 | local model = '' 193 | model = v.Prop.Model 194 | RequestModel(model) 195 | while not HasModelLoaded(model) do 196 | Wait(0) 197 | end 198 | 199 | StashProp["Prop_"..k] = CreateObject(GetHashKey(model), vector3(v.Coords.x, v.Coords.y, v.Coords.z - 1), false, false, true) 200 | PlaceObjectOnGroundProperly(StashProp["Prop_"..k]) 201 | SetEntityHeading(StashProp["Prop_"..k], v.Prop.Heading) 202 | FreezeEntityPosition(StashProp["Prop_"..k], true) 203 | SetEntityAsMissionEntity(StashProp["Prop_"..k]) 204 | DebugCode("PropMadeFor: "..tostring(k)) 205 | end 206 | end 207 | end 208 | for k, v in pairs(Config.Banks) do 209 | if v.Enable and v.Locations then 210 | for d,j in pairs(v.Locations) do 211 | if j.Prop and j.Prop.Enable and j.Prop.Model ~= nil then 212 | if not DoesEntityExist("Vault_"..k..d) then 213 | DebugCode("MakingProp: "..tostring(k)) 214 | local model = '' 215 | model = j.Prop.Model 216 | RequestModel(model) 217 | while not HasModelLoaded(model) do 218 | Wait(0) 219 | end 220 | 221 | StashProp["Vault_"..k..d] = CreateObject(GetHashKey(model), vector3(j.Coords.x, j.Coords.y, j.Coords.z - 1), false, false, true) 222 | PlaceObjectOnGroundProperly(StashProp["Vault_"..k..d]) 223 | SetEntityHeading(StashProp["Vault_"..k..d], j.Prop.Heading) 224 | FreezeEntityPosition(StashProp["Vault_"..k..d], true) 225 | SetEntityAsMissionEntity(StashProp["Vault_"..k..d]) 226 | DebugCode("PropMadeFor Vault: "..tostring(k)) 227 | end 228 | elseif j.Ped and j.Ped.Enable and j.Ped.Model ~= nil then 229 | if not DoesEntityExist("Vault_"..k..d) then 230 | DebugCode("MakingProp: "..tostring(k)) 231 | local model = '' 232 | model = j.Ped.Model 233 | RequestModel(model) 234 | while not HasModelLoaded(model) do 235 | Wait(0) 236 | end 237 | 238 | StashProp["Vault_"..k..d] = CreatePed(0, model, j.Coords.x,j.Coords.y,j.Coords.z-1,j.Coords.w, false, false) 239 | SetEntityHeading(StashProp["Vault_"..k..d], j.Ped.Heading) 240 | SetEntityInvincible(StashProp["Vault_"..k..d],true) 241 | FreezeEntityPosition(StashProp["Vault_"..k..d],true) 242 | SetBlockingOfNonTemporaryEvents(StashProp["Vault_"..k..d],true) 243 | DebugCode("PedMadeFor Vault: "..tostring(k)) 244 | end 245 | end 246 | end 247 | end 248 | end 249 | end 250 | 251 | function DeleteAllStashProps() 252 | for k in pairs(Stash) do exports['qb-target']:RemoveZone(k) end 253 | for _,v in pairs(StashProp) do 254 | if DoesEntityExist(v) then 255 | DeleteEntity(v) 256 | DebugCode("Entity = "..v.." = Deleted") 257 | else 258 | DebugCode("Cannot Find Entity "..v) 259 | end 260 | end 261 | end 262 | 263 | -- BANK ROB CHECK README FOR ANY INSTRUCTIONS 264 | function BankRobberyCheck() --this function is run through every time someone tries to access a vault to ensure no powergaming(placing items in a vault after robbing them) 265 | if Config.PacificHeistScript == 'qb-bankrobbery' then 266 | QBCore.Functions.TriggerCallback('qb-bankrobbery:server:isRobberyActive', function(robbery) 267 | return robbery 268 | end) 269 | elseif Config.PacificHeistScript == 'rainmad' then 270 | QBCore.Functions.TriggerCallback('pacificheist:server:isBankHeist', function(robbery) 271 | return robbery 272 | end) 273 | elseif Config.PacificHeistScript == 'lionh34rt' then 274 | QBCore.Functions.TriggerCallback('qb-bankrobbery:server:RobberyBusy', function(robbery) 275 | return robbery 276 | end) 277 | end 278 | return false 279 | end 280 | 281 | function SendNotify(msg,type,time,title) 282 | if Config.NotifyScript == nil then DebugCode("Sayer Chopshop: Config.NotifyScript Not Set!") return end 283 | if not title then title = "Bus Job" end 284 | if not time then time = 5000 end 285 | if not type then type = 'success' end 286 | if not msg then DebugCode("SendNotify Client Triggered With No Message") return end 287 | if Config.NotifyScript == 'qb' then 288 | QBCore.Functions.Notify(msg,type,time) 289 | elseif Config.NotifyScript == 'okok' then 290 | exports['okokNotify']:Alert(title, msg, time, type, false) 291 | elseif Config.NotifyScript == 'qs' then 292 | exports['qs-notify']:Alert(msg, time, type) 293 | elseif Config.NotifyScript == 'other' then 294 | -- add your notify here 295 | exports['yournotifyscript']:Notify(msg,time,type) 296 | end 297 | end -------------------------------------------------------------------------------- /shared/config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | Config.UseTarget = true 4 | Config.DebugCode = false 5 | Config.DebugStashZones = false --true for testing, making zones, false for live server 6 | Config.NotifyScript = 'qb' 7 | Config.ImageLink = { 8 | Menu = 'sayer-stashbox/images/menus/', --do not change unless you know what youre doing (IMAGE MUST BE NAMED SAME AS THE JOBCODE/GANGCODE FOR EXAMPLE 'police.png') 9 | } 10 | Config.ShowImages = true --enables logos in the menu 11 | 12 | Config.EnableBankVaults = true --activate or deactivate the bank vaults (deactivating will not alter the stashes/upgrades etc, will only block access) 13 | Config.PacificHeistScript = 'qb-bankrobbery' -- 'qb-bankrobbery'/ 'rainmad' / 'lionh34rt' supported right now (README) 14 | Config.AllowPoliceSearchVaults = true 15 | Config.PoliceRequireItem = false --can make it so police need an item to search vaults such as "Config.PoliceRequireItem = 'warrant' " 16 | Config.PoliceJobs = {'police', 'sheriff'} --used for searching someones vault 17 | Config.AllowVaultSharing = true --lets players give keys to friends so they can access vaults 18 | Config.MaxKeyholders = 3 --amount of players that can have access to another players vault (for shared vaults) 19 | 20 | 21 | 22 | -- ████████████████████████████████████████████████████████████████████████████ 23 | -- █░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█ 24 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█ 25 | -- █░░▄▀░░░░░░░░░░█░░░░░░▄▀░░░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█ 26 | -- █░░▄▀░░█████████████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█ 27 | -- █░░▄▀░░░░░░░░░░█████░░▄▀░░█████░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░▄▀░░█ 28 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█ 29 | -- █░░░░░░░░░░▄▀░░█████░░▄▀░░█████░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█ 30 | -- █████████░░▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██░░▄▀░░█ 31 | -- █░░░░░░░░░░▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█ 32 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█ 33 | -- █░░░░░░░░░░░░░░█████░░░░░░█████░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█ 34 | -- ████████████████████████████████████████████████████████████████████████████ 35 | --these are random placements i took from qb-management. please set to your own coords 36 | 37 | Config.Stashes = { 38 | ['police'] = { --the job or gang code that will be used 39 | Enable = true, --enable/disable the full location 40 | Type = 'job', --whether it is a job or gang 41 | Coords = vector3(443.79, -976.27, 30.69), --location to access stash 42 | Distance = 5.0, --the distance you can interact with stash 43 | ItemLocked = false, --either false or the itemcode you want to use to access it. for example (ItemLocked = 'police_key') 44 | BoxZone = {length = 1.0, width = 1.0, heading = 351.0}, --if using target it will use these boxzone settings to create the target 45 | Prop = { 46 | Enable = true, --false = no prop/ true = prop 47 | Model = 'prop_cabinet_02b', --the model of the prop 48 | Heading = 0.0, --which direction the prop is facing 49 | }, 50 | Stashes = { --have as many stashes as you want in here. the menu will auto insert in the order they are placed here 51 | [1] = { 52 | ID = 'evidence_stash', --id of the stash. DO NOT CHANGE ONCE USED OR WILL LOSE ITEMS. id will be for example 'police_evidence_stash' (MUST BE UNIQUE IN JOB) 53 | GradeRequired = 1, --job grade. anybody with this grade or higher can see this stash 54 | Label = "Evidence", --shown in menu 55 | Weight = 100000, -- the weight the stash will hold 56 | Slots = 100 --the slots the stash will have 57 | }, 58 | [2] = {ID = 'evidence2_stash', GradeRequired = 1, Label = "Evidence 2",Weight = 100000, Slots = 100}, 59 | [3] = {ID = 'armory_stash', GradeRequired = 4, Label = "Armory",Weight = 100000, Slots = 100}, 60 | [4] = {ID = 'dna_stash', GradeRequired = 1, Label = "Dna",Weight = 100000, Slots = 100}, 61 | }, 62 | }, 63 | ['ambulance'] = { 64 | Enable = true, 65 | Type = 'job', 66 | Coords = vector3(309.88, -603.0, 43.29), 67 | Distance = 5.0, 68 | ItemLocked = false, 69 | BoxZone = {length = 1.2, width = 0.6, heading = 341.0}, 70 | Prop = { 71 | Enable = true, 72 | Model = 'prop_cabinet_02b', 73 | Heading = 0.0, 74 | }, 75 | Stashes = { 76 | [1] = {ID = 'hospital_stash', GradeRequired = 1, Label = "Hospital Stash1",Weight = 100000, Slots = 100}, 77 | [2] = {ID = 'hospital2_stash', GradeRequired = 1, Label = "Hospital Stash2",Weight = 100000, Slots = 100}, 78 | [3] = {ID = 'hospital3_stash', GradeRequired = 1, Label = "Hospital Stash3",Weight = 100000, Slots = 100}, 79 | [4] = {ID = 'hospital4_stash', GradeRequired = 1, Label = "Hospital Stash4",Weight = 100000, Slots = 100}, 80 | [5] = {ID = 'hospital_manager_stash',GradeRequired = 1, Label = "Manager Stash",Weight = 100000, Slots = 100}, 81 | }, 82 | }, 83 | ['realestate'] = { 84 | Enable = true, 85 | Type = 'job', 86 | Coords = vector3(-716.11, 261.21, 84.14), 87 | Distance = 5.0, 88 | ItemLocked = false, 89 | BoxZone = {length = 0.6, width = 1.0, heading = 25.0}, 90 | Prop = { 91 | Enable = true, 92 | Model = 'prop_cabinet_02b', 93 | Heading = 0.0, 94 | }, 95 | Stashes = { 96 | [1] = {ID = 'house_deeds', GradeRequired = 1, Label = "House Deeds",Weight = 100000, Slots = 100}, 97 | [2] = {ID = 'employee_files', GradeRequired = 1, Label = "Employee Files",Weight = 100000, Slots = 100}, 98 | [3] = {ID = 'manager_files', GradeRequired = 1, Label = "Manager Files",Weight = 100000, Slots = 100}, 99 | }, 100 | }, 101 | ['taxi'] = { 102 | Enable = true, 103 | Type = 'job', 104 | Coords = vector3(907.24, -150.19, 74.17), 105 | Distance = 5.0, 106 | ItemLocked = false, 107 | BoxZone = {length = 1.0, width = 3.4, heading = 327.0}, 108 | Prop = { 109 | Enable = true, 110 | Model = 'prop_cabinet_02b', 111 | Heading = 0.0, 112 | }, 113 | Stashes = { 114 | [1] = {ID = 'files', GradeRequired = 1, Label = "Files",Weight = 100000, Slots = 100}, 115 | [2] = {ID = 'employee_files', GradeRequired = 1, Label = "Employee Files",Weight = 100000, Slots = 100}, 116 | [3] = {ID = 'manager_files', GradeRequired = 1, Label = "Manager Files",Weight = 100000, Slots = 100}, 117 | }, 118 | }, 119 | ['cardealer'] = { 120 | Enable = true, 121 | Type = 'job', 122 | Coords = vector3(-27.47, -1107.13, 27.27), 123 | Distance = 5.0, 124 | ItemLocked = false, 125 | BoxZone = {length = 2.4, width = 1.05, heading = 340.0}, 126 | Prop = { 127 | Enable = true, 128 | Model = 'prop_cabinet_02b', 129 | Heading = 0.0, 130 | }, 131 | Stashes = { 132 | [1] = {ID = 'vehicle_deeds', GradeRequired = 1, Label = "Vehicle Deeds",Weight = 100000, Slots = 100}, 133 | [2] = {ID = 'spare_keys', GradeRequired = 1, Label = "Spare Keys",Weight = 100000, Slots = 100}, 134 | [3] = {ID = 'manager_files', GradeRequired = 1, Label = "Manager Files",Weight = 100000, Slots = 100}, 135 | }, 136 | }, 137 | ['mechanic'] = { 138 | Enable = true, 139 | Type = 'job', 140 | Coords = vector3(-339.53, -156.44, 44.59), 141 | Distance = 5.0, 142 | ItemLocked = false, 143 | BoxZone = {length = 1.15, width = 2.6, heading = 353.0}, 144 | Prop = { 145 | Enable = false, 146 | Model = 'prop_cabinet_02b', 147 | Heading = 0.0, 148 | }, 149 | Stashes = { 150 | [1] = {ID = 'spare_parts', GradeRequired = 1, Label = "Spare Parts",Weight = 100000, Slots = 100}, 151 | [2] = {ID = 'engine_parts', GradeRequired = 1, Label = "Engine Parts",Weight = 100000, Slots = 100}, 152 | [3] = {ID = 'manager_files', GradeRequired = 1, Label = "Manager Files",Weight = 100000, Slots = 100}, 153 | }, 154 | }, 155 | -- GANGS ARE BELOW HERE. not setup 156 | ['lostmc'] = { 157 | Enable = false, 158 | Type = 'gang', 159 | Coords = vector3(0, 0, 0), 160 | Distance = 5.0, 161 | ItemLocked = false, 162 | BoxZone = {length = 0.0, width = 0.0, heading = 0.0}, 163 | Prop = { 164 | Enable = false, 165 | Model = 'prop_cabinet_02b', 166 | Heading = 0.0, 167 | }, 168 | Stashes = { 169 | [1] = {ID = 'gang1',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 170 | [2] = {ID = 'gang2',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 171 | [3] = {ID = 'gang3',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 172 | }, 173 | }, 174 | ['ballas'] = { 175 | Enable = false, 176 | Type = 'gang', 177 | Coords = vector3(0, 0, 0), 178 | Distance = 5.0, 179 | ItemLocked = false, 180 | BoxZone = {length = 0.0, width = 0.0, heading = 0.0}, 181 | Prop = { 182 | Enable = false, 183 | Model = 'prop_cabinet_02b', 184 | Heading = 0.0, 185 | }, 186 | Stashes = { 187 | [1] = {ID = 'gang1',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 188 | [2] = {ID = 'gang2',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 189 | [3] = {ID = 'gang3',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 190 | }, 191 | }, 192 | ['vagos'] = { 193 | Enable = false, 194 | Type = 'gang', 195 | Coords = vector3(0, 0, 0), 196 | Distance = 5.0, 197 | ItemLocked = false, 198 | BoxZone = {length = 0.0, width = 0.0, heading = 0.0}, 199 | Prop = { 200 | Enable = false, 201 | Model = 'prop_cabinet_02b', 202 | Heading = 0.0, 203 | }, 204 | Stashes = { 205 | [1] = {ID = 'gang1',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 206 | [2] = {ID = 'gang2',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 207 | [3] = {ID = 'gang3',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 208 | }, 209 | }, 210 | ['families'] = { 211 | Enable = false, 212 | Type = 'gang', 213 | Coords = vector3(0, 0, 0), 214 | Distance = 5.0, 215 | ItemLocked = false, 216 | BoxZone = {length = 0.0, width = 0.0, heading = 0.0}, 217 | Prop = { 218 | Enable = false, 219 | Model = 'prop_cabinet_02b', 220 | Heading = 0.0, 221 | }, 222 | Stashes = { 223 | [1] = {ID = 'gang1',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 224 | [2] = {ID = 'gang2',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 225 | [3] = {ID = 'gang3',GradeRequired = 1,Label = "Gang Stash",Weight = 100000, Slots = 100}, 226 | }, 227 | }, 228 | --CITIZENID STUFF BELOW HERE 229 | ['MMP64540'] = { --CHANGE THIS TO A PLAYERS CITIZENID 230 | Enable = true, 231 | Type = 'citizenid', --new type to handle personal stashes 232 | Coords = vector3(425.89, -975.64, 30.71), 233 | Distance = 5.0, 234 | ItemLocked = false, 235 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 236 | Prop = { 237 | Enable = true, 238 | Model = 'prop_ld_int_safe_01', 239 | Heading = 0.0, 240 | }, 241 | Stashes = { 242 | [1] = {ID = 'personal_1',Label = "Weapon Stash",Weight = 100000, Slots = 100}, 243 | [2] = {ID = 'personal_2',Label = "Clothes Stash",Weight = 100000, Slots = 100}, 244 | [3] = {ID = 'personal_3',Label = "Item Stash",Weight = 100000, Slots = 100}, 245 | }, 246 | }, 247 | } 248 | 249 | 250 | -- ███████████████████████████████████████████████████████████████████████████████████████████ 251 | -- █░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█ 252 | -- █░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█ 253 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░░░░░▄▀░░░░░░█░░▄▀░░░░░░░░░░█ 254 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████░░▄▀░░█████████ 255 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████░░▄▀░░░░░░░░░░█ 256 | -- █░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█ 257 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████░░░░░░░░░░▄▀░░█ 258 | -- █░░▄▀▄▀░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████████████░░▄▀░░█ 259 | -- █░░░░▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█████░░▄▀░░█████░░░░░░░░░░▄▀░░█ 260 | -- ███░░░░▄▀░░░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█ 261 | -- █████░░░░░░█████░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█████░░░░░░█████░░░░░░░░░░░░░░█ 262 | -- ███████████████████████████████████████████████████████████████████████████████████████████ 263 | 264 | Config.Banks = { 265 | ['pacific'] = { 266 | Enable = true, 267 | Label = "Pacific Bank", 268 | PurchaseVaultPrice = 5000, 269 | GiveKeyPrice = 2000, 270 | Locations = { 271 | { 272 | Coords = vector3(252.26, 223.31, 106.29), 273 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 274 | Distance = 5.0, 275 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, --use only prop or ped. do not use both in one location 276 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 160.0, }, 277 | }, 278 | }, 279 | }, 280 | ['paleto'] = { 281 | Enable = true, 282 | Label = "Paleto Bank", 283 | PurchaseVaultPrice = 5000, 284 | GiveKeyPrice = 2000, 285 | Locations = { 286 | { 287 | Coords = vector3(-112.09, 6471.09, 31.63), 288 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 289 | Distance = 5.0, 290 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 291 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 134.0, }, 292 | }, 293 | }, 294 | }, 295 | ['fleeca'] = { 296 | Enable = true, 297 | Label = "Fleeca Bank", 298 | PurchaseVaultPrice = 5000, 299 | GiveKeyPrice = 2000, 300 | Locations = { --this is a working example of how you can have multiple locations for the same bank vaults. (access same vaults from different locations) 301 | { 302 | Coords = vector3(148.11, -1041.69, 29.37), 303 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 304 | Distance = 5.0, 305 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 306 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 341.0, }, 307 | }, 308 | { 309 | Coords = vector3(312.34, -279.92, 54.16), 310 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 311 | Distance = 5.0, 312 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 313 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 338.0, }, 314 | }, 315 | { 316 | Coords = vector3(-352.84, -50.8, 49.04), 317 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 318 | Distance = 5.0, 319 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 320 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 329.0, }, 321 | }, 322 | { 323 | Coords = vector3(-1213.32, -332.73, 37.78), 324 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 325 | Distance = 5.0, 326 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 327 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 28.0, }, 328 | }, 329 | { 330 | Coords = vector3(-2961.14, 481.4, 15.7), 331 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 332 | Distance = 5.0, 333 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 334 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 88.0, }, 335 | }, 336 | { 337 | Coords = vector3(1176.44, 2708.32, 38.09), 338 | BoxZone = {length = 2.0, width = 2.0, heading = 0.0}, 339 | Distance = 5.0, 340 | Prop = {Enable = false, Model = 'prop_ld_int_safe_01', Heading = 0.0, }, 341 | Ped = {Enable = true, Model = 'u_m_m_bankman', Heading = 184.0, }, 342 | }, 343 | }, 344 | }, 345 | } 346 | 347 | Config.VaultUpgrades = { --to find the vault stash in your stashitems look for 'stash-bankname_citizenid_stashid' (for example "stash-pacific_MMP64540_1") 348 | ['pacific'] = { --this is the bank code used in Config.Banks (so you can have different values for different locations) 349 | [1] = { --this is the starting vault upgrade when theyve purchased access (number must be 1 for starting value) 350 | UpgradePrice = 10000, --this is the price to upgrade to the next level (not this level) 351 | Label = "Bronze Membership", 352 | Stashes = { 353 | [1] = { 354 | Label = "Custom Vault Name", --if Label = false then will just display "Vault x" with x being replaced by the number value of this stash (in this case 1) 355 | Weight = 10000, --weight in the vault stash 356 | Slots = 10 --slots in this stash 357 | }, 358 | }, 359 | }, 360 | [2] = { 361 | UpgradePrice = 15000, 362 | Label = "Silver Membership", 363 | Stashes = { 364 | [1] = {Label = false,Weight = 10000, Slots = 10}, --this will be the same stash as the one from last upgrade. (you can increase weight n slots but lowering may result in lost items or broken stashes) 365 | [2] = {Label = false,Weight = 20000, Slots = 20}, --this will be a new available stash 366 | }, 367 | }, 368 | [3] = { 369 | UpgradePrice = 15000, 370 | Label = "Gold Membership", 371 | Stashes = { 372 | [1] = {Label = false,Weight = 10000, Slots = 10}, 373 | [2] = {Label = false,Weight = 20000, Slots = 20}, 374 | [3] = {Label = false,Weight = 50000, Slots = 50}, 375 | }, 376 | }, 377 | }, 378 | ['paleto'] = { 379 | [1] = { 380 | UpgradePrice = 10000, 381 | Label = "Bronze Membership", 382 | Stashes = { 383 | [1] = {Label = false, Weight = 10000, Slots = 10}, 384 | }, 385 | }, 386 | [2] = { 387 | UpgradePrice = 15000, 388 | Label = "Silver Membership", 389 | Stashes = { 390 | [1] = {Label = false,Weight = 10000, Slots = 10}, 391 | [2] = {Label = false,Weight = 10000, Slots = 10}, 392 | }, 393 | }, 394 | [3] = { 395 | UpgradePrice = 15000, 396 | Label = "Gold Membership", 397 | Stashes = { 398 | [1] = {Label = false,Weight = 10000, Slots = 10}, 399 | [2] = {Label = false,Weight = 20000, Slots = 20}, 400 | [3] = {Label = false,Weight = 50000, Slots = 50}, 401 | }, 402 | }, 403 | }, 404 | ['fleeca'] = { 405 | [1] = { 406 | UpgradePrice = 2000, 407 | Label = "Bronze Membership", 408 | Stashes = { 409 | [1] = {Label = false, Weight = 5000, Slots = 5}, 410 | }, 411 | }, 412 | [2] = { 413 | UpgradePrice = 5000, 414 | Label = "Silver Membership", 415 | Stashes = { 416 | [1] = {Label = false,Weight = 5000, Slots = 5}, 417 | [2] = {Label = false,Weight = 10000, Slots = 10}, 418 | }, 419 | }, 420 | [3] = { 421 | UpgradePrice = 15000, 422 | Label = "Gold Membership", 423 | Stashes = { 424 | [1] = {Label = false,Weight = 10000, Slots = 10}, 425 | [2] = {Label = false,Weight = 20000, Slots = 20}, 426 | [3] = {Label = false,Weight = 50000, Slots = 50}, 427 | }, 428 | }, 429 | } 430 | } 431 | -------------------------------------------------------------------------------- /client/stashes.lua: -------------------------------------------------------------------------------- 1 | local QBCore = exports['qb-core']:GetCoreObject() 2 | local PlayerJob = QBCore.Functions.GetPlayerData().job 3 | local PlayerGang = QBCore.Functions.GetPlayerData().gang 4 | local PlayerCitizenid = QBCore.Functions.GetPlayerData().citizenid 5 | 6 | AddEventHandler('onResourceStart', function(resource) 7 | if resource == GetCurrentResourceName() then 8 | PlayerJob = QBCore.Functions.GetPlayerData().job 9 | PlayerGang = QBCore.Functions.GetPlayerData().gang 10 | PlayerCitizenid = QBCore.Functions.GetPlayerData().citizenid 11 | InitializeStashProps() 12 | if Config.UseTarget then 13 | RunTargetThread() 14 | else 15 | RunDrawtextThread() 16 | end 17 | end 18 | end) 19 | 20 | AddEventHandler('onResourceStop', function(t) if t ~= GetCurrentResourceName() then return end 21 | DeleteAllStashProps() 22 | end) 23 | 24 | RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() 25 | PlayerJob = QBCore.Functions.GetPlayerData().job 26 | PlayerGang = QBCore.Functions.GetPlayerData().gang 27 | PlayerCitizenid = QBCore.Functions.GetPlayerData().citizenid 28 | InitializeStashProps() 29 | if Config.UseTarget then 30 | RunTargetThread() 31 | else 32 | RunDrawtextThread() 33 | end 34 | end) 35 | 36 | RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() 37 | DeleteAllStashProps() 38 | end) 39 | 40 | RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo) 41 | PlayerJob = JobInfo 42 | end) 43 | RegisterNetEvent('QBCore:Client:OnGangUpdate', function(InfoGang) 44 | PlayerGang = InfoGang 45 | end) 46 | 47 | 48 | -- ████████████████████████████████████████████████████████████████████████████ 49 | -- █░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█ 50 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█ 51 | -- █░░▄▀░░░░░░░░░░█░░░░░░▄▀░░░░░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░██░░▄▀░░█ 52 | -- █░░▄▀░░█████████████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀░░██░░▄▀░░█ 53 | -- █░░▄▀░░░░░░░░░░█████░░▄▀░░█████░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█░░▄▀░░░░░░▄▀░░█ 54 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█ 55 | -- █░░░░░░░░░░▄▀░░█████░░▄▀░░█████░░▄▀░░░░░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░░░░░▄▀░░█ 56 | -- █████████░░▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█████████░░▄▀░░█░░▄▀░░██░░▄▀░░█ 57 | -- █░░░░░░░░░░▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░░░░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█ 58 | -- █░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█ 59 | -- █░░░░░░░░░░░░░░█████░░░░░░█████░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█ 60 | -- ████████████████████████████████████████████████████████████████████████████ 61 | 62 | function OpenStashMenu(job,Type,stashes) 63 | if Config.Stashes[job].ItemLocked and not QBCore.Functions.HasItem(Config.Stashes[job].ItemLocked) then return end 64 | inRangeStash = false 65 | local Needed = PlayerJob 66 | local Label = "" 67 | if Type == 'job' then 68 | Needed = PlayerJob 69 | Label = QBCore.Shared.Jobs[job].label.." Stash" 70 | elseif Type == 'gang' then 71 | Needed = PlayerGang 72 | Label = QBCore.Shared.Gangs[job].label.." Stash" 73 | elseif Type == 'citizenid' then 74 | Needed = PlayerCitizenid 75 | Label = "My Stash" 76 | end 77 | local columns = { 78 | { 79 | header = Label, 80 | isMenuHeader = true, 81 | }, 82 | } 83 | if Config.ShowImages then 84 | if Type ~= 'citizenid' then 85 | image = "" 86 | else 87 | image = "" 88 | end 89 | columns = { 90 | { 91 | header = image, 92 | text = Label, 93 | isMenuHeader = true, 94 | }, 95 | } 96 | end 97 | 98 | for k,v in ipairs(stashes) do 99 | if Type ~= 'citizenid' then 100 | if v.GradeRequired and Needed.grade.level >= v.GradeRequired then 101 | local item = {} 102 | item.header = v.Label 103 | item.params = { 104 | event = 'sayer-stashbox:OpenStash', 105 | args = { 106 | id = v.ID, 107 | job = job, 108 | weight = v.Weight, 109 | slots = v.Slots, 110 | } 111 | } 112 | table.insert(columns, item) 113 | end 114 | else 115 | local item = {} 116 | item.header = v.Label 117 | item.params = { 118 | event = 'sayer-stashbox:OpenStash', 119 | args = { 120 | id = v.ID, 121 | job = job, 122 | weight = v.Weight, 123 | slots = v.Slots, 124 | } 125 | } 126 | table.insert(columns, item) 127 | end 128 | end 129 | exports['qb-menu']:openMenu(columns, false, true) 130 | end 131 | 132 | 133 | 134 | RegisterNetEvent('sayer-stashbox:OpenStash', function(data) 135 | local id = data.id 136 | local job = data.job 137 | local weight = data.weight 138 | local slots = data.slots 139 | local invID = job.."_"..id 140 | local arguments = { 141 | label = job.."_"..id, 142 | maxweight = weight, 143 | slots = slots, 144 | } 145 | TriggerServerEvent('sayer-stashbox:OpenInventory', invID, arguments) 146 | end) 147 | 148 | 149 | -- ████████████████████████████████████████████████████████████████████████████ 150 | -- █░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░██░░░░░░█░░░░░░█████████░░░░░░░░░░░░░░█ 151 | -- █░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░▄▀▄▀▄▀▄▀▄▀░░█ 152 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████░░░░░░▄▀░░░░░░█ 153 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████ 154 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████ 155 | -- █░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████ 156 | -- █░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████ 157 | -- █░░▄▀▄▀░░▄▀▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░██░░▄▀░░█░░▄▀░░█████████████░░▄▀░░█████ 158 | -- █░░░░▄▀▄▀▄▀░░░░█░░▄▀░░██░░▄▀░░█░░▄▀░░░░░░▄▀░░█░░▄▀░░░░░░░░░░█████░░▄▀░░█████ 159 | -- ███░░░░▄▀░░░░███░░▄▀░░██░░▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█░░▄▀▄▀▄▀▄▀▄▀░░█████░░▄▀░░█████ 160 | -- █████░░░░░░█████░░░░░░██░░░░░░█░░░░░░░░░░░░░░█░░░░░░░░░░░░░░█████░░░░░░█████ 161 | -- ████████████████████████████████████████████████████████████████████████████ 162 | 163 | function OpenVaultMenu(bank) 164 | if not Config.Banks[bank] then return end 165 | local banklabel = Config.Banks[bank].Label 166 | if not BankRobberyCheck() then 167 | QBCore.Functions.TriggerCallback('sayer-stashbox:GetBankDetails', function(result) 168 | if result then 169 | local upgradeprice = Config.VaultUpgrades[bank][result.Upgrade].UpgradePrice 170 | local Header = banklabel 171 | local HeaderText = "Bank" 172 | if Config.ShowImages then 173 | Header = "" 174 | HeaderText = banklabel 175 | end 176 | local columns = { 177 | { 178 | header = Header, 179 | text = HeaderText, 180 | isMenuHeader = true, 181 | }, 182 | { 183 | header = "Access Vault", 184 | params = { 185 | event = 'sayer-stashbox:VaultMenu', 186 | args = { 187 | bank = bank, 188 | upgrade = result.Upgrade, 189 | }, 190 | }, 191 | }, 192 | } 193 | if Config.VaultUpgrades[bank][result.Upgrade+1] ~= nil then 194 | local item = { 195 | header = "Upgrade Membership", 196 | params = { 197 | event = 'sayer-stashbox:UpgradeVault', 198 | args = { 199 | bank = bank, 200 | upgrade = result.Upgrade, 201 | }, 202 | }, 203 | } 204 | table.insert(columns,item) 205 | end 206 | if Config.AllowVaultSharing then 207 | local item = { 208 | header = "Shared Vaults", 209 | params = { 210 | event = 'sayer-stashbox:SharedVaultMenu', 211 | args = { 212 | bank = bank, 213 | owner = false, 214 | }, 215 | }, 216 | } 217 | table.insert(columns,item) 218 | end 219 | if Config.AllowPoliceSearchVaults then 220 | for k,v in pairs(Config.PoliceJobs) do 221 | DebugCode("PoliceSearch:k: "..tostring(k)) 222 | DebugCode("PoliceSearch:v: "..tostring(v)) 223 | if PlayerJob.name == v then 224 | local item = { 225 | header = "(PD) - Search Citizens Vault", 226 | params = { 227 | event = 'sayer-stashbox:PD:SearchVaultMenu', 228 | args = { 229 | bank = bank, 230 | }, 231 | }, 232 | } 233 | table.insert(columns,item) 234 | end 235 | end 236 | end 237 | exports['qb-menu']:openMenu(columns, false, true) 238 | else 239 | SendNotify("You Do Not Have a Vault With Us!") 240 | OpenPurchaseVaultMenu(bank) 241 | end 242 | end, bank ) 243 | else 244 | SendNotify("Bank Robbery In Progress, Vaults Sealed", 'error') 245 | end 246 | end 247 | 248 | function OpenPurchaseVaultMenu(bank) 249 | local price = Config.Banks[bank].PurchaseVaultPrice 250 | local banklabel = Config.Banks[bank].Label 251 | local buytext = "Price: $"..tostring(price) 252 | local Header = banklabel 253 | local HeaderText = "Bank" 254 | if Config.ShowImages then 255 | Header = "" 256 | HeaderText = banklabel 257 | end 258 | local columns = { 259 | { 260 | header = Header, 261 | text = HeaderText, 262 | isMenuHeader = true, 263 | }, 264 | { 265 | header = "Purchase "..banklabel.." Vault", 266 | text = buytext, 267 | params = { 268 | event = 'sayer-stashbox:BuyVault', 269 | args = { 270 | bank = bank, 271 | }, 272 | }, 273 | }, 274 | } 275 | if Config.AllowVaultSharing then 276 | local item = { 277 | header = "Shared Vaults", 278 | params = { 279 | event = 'sayer-stashbox:SharedVaultMenu', 280 | args = { 281 | bank = bank, 282 | owner = false, 283 | }, 284 | }, 285 | } 286 | table.insert(columns,item) 287 | end 288 | if Config.AllowPoliceSearchVaults then 289 | for k,v in pairs(Config.PoliceJobs) do 290 | DebugCode("PoliceSearch:k: "..tostring(k)) 291 | DebugCode("PoliceSearch:v: "..tostring(v)) 292 | if PlayerJob.name == v then 293 | local item = { 294 | header = "(PD) - Search Citizens Vault", 295 | params = { 296 | event = 'sayer-stashbox:PD:SearchVaultMenu', 297 | args = { 298 | bank = bank, 299 | }, 300 | }, 301 | } 302 | table.insert(columns,item) 303 | end 304 | end 305 | end 306 | exports['qb-menu']:openMenu(columns, false, true) 307 | end 308 | 309 | RegisterNetEvent('sayer-stashbox:BuyVault',function(data) 310 | local bank = data.bank 311 | local price = Config.Banks[bank].PurchaseVaultPrice 312 | local playermoney = GetPlayerMoney('bank') 313 | if tonumber(playermoney) >= tonumber(price) then 314 | DebugCode("Can Buy Vault") 315 | TriggerServerEvent('sayer-stashbox:PurchaseVault',bank,price) 316 | else 317 | SendNotify("Not Enough Money In Bank", 'error') 318 | end 319 | end) 320 | 321 | -- USING VAULT 322 | 323 | RegisterNetEvent('sayer-stashbox:VaultMenu', function(data) 324 | local bank = data.bank 325 | local upgrade = data.upgrade 326 | local banklabel = Config.Banks[bank].Label 327 | local memberlabel = Config.VaultUpgrades[bank][upgrade].Label 328 | local Header = banklabel 329 | local HeaderText = "Bank" 330 | if Config.ShowImages then 331 | Header = "" 332 | HeaderText = banklabel 333 | end 334 | local columns = { 335 | { 336 | header = Header, 337 | text = HeaderText.."
"..memberlabel, 338 | isMenuHeader = true, 339 | }, 340 | } 341 | for k,v in ipairs(Config.VaultUpgrades[bank][upgrade].Stashes) do 342 | local item = {} 343 | local header = "Vault "..tostring(k) 344 | if v.Label then 345 | header = v.Label 346 | end 347 | item.header = header 348 | item.params = { 349 | event = 'sayer-stashbox:OpenVault', 350 | args = { 351 | bank = bank, 352 | vault = k, 353 | weight = v.Weight, 354 | slots = v.Slots, 355 | } 356 | } 357 | table.insert(columns, item) 358 | end 359 | exports['qb-menu']:openMenu(columns, false, true) 360 | end) 361 | 362 | RegisterNetEvent('sayer-stashbox:OpenVault', function(data) 363 | local bank = data.bank 364 | local vault = data.vault 365 | local weight = data.weight 366 | local slots = data.slots 367 | local citizenid = QBCore.Functions.GetPlayerData().citizenid 368 | local invID = bank.."_"..citizenid.."_"..vault 369 | local arguments = { 370 | label = bank.."_"..citizenid.."_"..vault, 371 | maxweight = weight, 372 | slots = slots, 373 | } 374 | TriggerServerEvent('sayer-stashbox:OpenInventory', invID, arguments) 375 | end) 376 | 377 | --SHARED VAULT 378 | 379 | RegisterNetEvent('sayer-stashbox:SharedVaultMenu', function(data) 380 | local bank = data.bank 381 | local owner = data.owner 382 | local banklabel = Config.Banks[bank].Label 383 | local Header = banklabel 384 | local HeaderText = "Bank" 385 | local SharedPrice = Config.Banks[bank].GiveKeyPrice 386 | if Config.ShowImages then 387 | Header = "" 388 | HeaderText = banklabel 389 | end 390 | local columns = { 391 | { 392 | header = Header, 393 | text = HeaderText, 394 | isMenuHeader = true, 395 | }, 396 | { 397 | header = "Give Vault Access", 398 | text = "Price For Key Access: $"..tostring(SharedPrice), 399 | params = { 400 | event = 'sayer-stashbox:GiveVaultAccess', 401 | args = { 402 | bank = bank, 403 | }, 404 | }, 405 | }, 406 | { 407 | header = "See Shared Vaults", 408 | params = { 409 | event = 'sayer-stashbox:GetSharedVaults', 410 | args = { 411 | bank = bank, 412 | }, 413 | }, 414 | }, 415 | } 416 | exports['qb-menu']:openMenu(columns, false, true) 417 | end) 418 | 419 | RegisterNetEvent('sayer-stashbox:GiveVaultAccess', function(data) 420 | local bank = data.bank 421 | local banklabel = Config.Banks[bank].Label 422 | local delmenu = nil 423 | local columns = {} 424 | QBCore.Functions.TriggerCallback('sayer-stashbox:GetPlayers', function(players) 425 | if players then 426 | for _,v in pairs(players) do 427 | local option = {} 428 | option.value = v.id 429 | option.text = v.text 430 | table.insert(columns, option) 431 | end 432 | delmenu = exports['qb-input']:ShowInput({ 433 | header = "> Grant "..banklabel.." Vault Access <", 434 | submitText = "Grant Access!", 435 | inputs = { 436 | { 437 | text = "Players", 438 | name = "player", 439 | type = "select", 440 | isRequired = true, 441 | options = columns, 442 | }, 443 | } 444 | }) 445 | if delmenu ~= nil then 446 | if delmenu.player == nil then return end 447 | TriggerServerEvent('sayer-stashbox:GrantVaultAccess',bank, delmenu.player) 448 | end 449 | else 450 | DebugCode("No Players Found For GiveVaultAccess") 451 | end 452 | end) 453 | end) 454 | 455 | RegisterNetEvent('sayer-stashbox:GetSharedVaults', function(data) 456 | local bank = data.bank 457 | local banklabel = Config.Banks[bank].Label 458 | local Header = banklabel 459 | local HeaderText = "Bank" 460 | if Config.ShowImages then 461 | Header = "" 462 | HeaderText = banklabel 463 | end 464 | local columns = { 465 | { 466 | header = Header, 467 | text = HeaderText, 468 | isMenuHeader = true, 469 | }, 470 | } 471 | QBCore.Functions.TriggerCallback('sayer-stashbox:GetSharedVaults', function(result) 472 | if result ~= nil then 473 | for k,v in pairs(result) do 474 | local item = {} 475 | local header = v.text 476 | item.header = header 477 | item.params = { 478 | event = 'sayer-stashbox:OpenSharedVault', 479 | args = { 480 | bank = bank, 481 | owner = k, 482 | upgrade = v.upgrade, 483 | text = v.text, 484 | } 485 | } 486 | table.insert(columns, item) 487 | end 488 | exports['qb-menu']:openMenu(columns, false, true) 489 | else 490 | SendNotify("You Dont Hold Any Keys", 'error') 491 | end 492 | end, bank ) 493 | end) 494 | 495 | RegisterNetEvent('sayer-stashbox:OpenSharedVault', function(data) 496 | local bank = data.bank 497 | local upgrade = data.upgrade 498 | local banklabel = Config.Banks[bank].Label 499 | local owner = data.owner 500 | local playertext = data.text 501 | local Header = banklabel 502 | local HeaderText = "Bank" 503 | if Config.ShowImages then 504 | Header = "" 505 | HeaderText = banklabel 506 | end 507 | local columns = { 508 | { 509 | header = Header, 510 | text = HeaderText, 511 | isMenuHeader = true, 512 | }, 513 | } 514 | for k,v in ipairs(Config.VaultUpgrades[bank][upgrade].Stashes) do 515 | local item = {} 516 | local header = "Vault "..tostring(k) 517 | if v.Label then 518 | header = v.Label 519 | end 520 | item.header = header 521 | item.params = { 522 | event = 'sayer-stashbox:OpenSharedVaultDrawer', 523 | args = { 524 | owner = owner, 525 | bank = bank, 526 | vault = k, 527 | weight = v.Weight, 528 | slots = v.Slots, 529 | } 530 | } 531 | table.insert(columns, item) 532 | end 533 | exports['qb-menu']:openMenu(columns, false, true) 534 | end) 535 | 536 | RegisterNetEvent('sayer-stashbox:OpenSharedVaultDrawer', function(data) 537 | local owner = data.owner 538 | local bank = data.bank 539 | local vault = data.vault 540 | local weight = data.weight 541 | local slots = data.slots 542 | local invID = bank.."_"..owner.."_"..vault 543 | local arguments = { 544 | label = bank.."_"..owner.."_"..vault, 545 | maxweight = weight, 546 | slots = slots, 547 | } 548 | TriggerServerEvent('sayer-stashbox:OpenInventory', invID, arguments) 549 | end) 550 | 551 | RegisterNetEvent('sayer-stashbox:PD:SearchVaultMenu', function(data) 552 | if Config.PoliceRequireItem and not QBCore.Functions.HasItem(Config.PoliceRequireItem) then SendNotify("You Need a "..QBCore.Shared.Items[Config.PoliceRequireItem].label.." To Search Vaults") return end 553 | local bank = data.bank 554 | local banklabel = Config.Banks[bank].Label 555 | local delmenu = nil 556 | local columns = {} 557 | delmenu = exports['qb-input']:ShowInput({ 558 | header = "> (PD) Search "..banklabel.." Vaults <", 559 | submitText = "Search!", 560 | inputs = { 561 | { 562 | text = "Citizen ID", 563 | name = "cid", 564 | type = "text", 565 | isRequired = true, 566 | }, 567 | } 568 | }) 569 | if delmenu ~= nil then 570 | if delmenu.cid == nil then return end 571 | QBCore.Functions.TriggerCallback('sayer-stashbox:PD:GetVault', function(result) 572 | if result then 573 | TriggerEvent('sayer-stashbox:PD:VaultMenu',bank, delmenu.cid, tonumber(result.Upgrade)) 574 | end 575 | end, bank, delmenu.cid ) 576 | end 577 | end) 578 | 579 | RegisterNetEvent('sayer-stashbox:PD:VaultMenu', function(bank, cid, upgrade) 580 | local banklabel = Config.Banks[bank].Label 581 | local Header = banklabel 582 | local HeaderText = "Bank" 583 | if Config.ShowImages then 584 | Header = "" 585 | HeaderText = banklabel 586 | end 587 | local columns = { 588 | { 589 | header = Header, 590 | text = HeaderText, 591 | isMenuHeader = true, 592 | }, 593 | } 594 | for k,v in ipairs(Config.VaultUpgrades[bank][upgrade].Stashes) do 595 | local item = {} 596 | local header = "Vault "..tostring(k) 597 | if v.Label then 598 | header = v.Label 599 | end 600 | item.header = header 601 | item.params = { 602 | event = 'sayer-stashbox:OpenSharedVaultDrawer', 603 | args = { 604 | owner = cid, 605 | bank = bank, 606 | vault = k, 607 | weight = v.Weight, 608 | slots = v.Slots, 609 | } 610 | } 611 | table.insert(columns, item) 612 | end 613 | exports['qb-menu']:openMenu(columns, false, true) 614 | end) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------