Thug Studios
TEBEXYOUTUBEDISCORD
  • ๐Ÿ“„Welcome
  • INFORMATION
    • ๐Ÿ“งFind Transaction ID
    • ๐Ÿ“ฆTebex Script Integration
    • ๐Ÿ”‘CFX Auth System
    • ๐Ÿ”“Escrow/Open Source
    • ๐Ÿ”—Get Steam Api Key
    • ๐ŸงพGet Player License
  • SCRIPTS
    • ๐Ÿ’›RP Series
      • ๐Ÿ“ฆThug Crafting
        • Installation
        • Shared/settings.lua
        • Shared/crafting_items.lua
        • Shared/levels.lua
        • Shared/locale.lua
        • Shared/notify.lua
        • Shared/debug.lua
      • ๐Ÿ“ฆThug Dispatch
        • Installation
        • Shared/settings.lua
        • Shared/alerts.lua
        • Shared/zones.lua
        • Shared/weapons.lua
        • Shared/locale.lua
        • Shared/notify.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug RPS
        • Installation
        • Configuration
        • Translate
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Keyword
        • Installation
        • Configuration
        • Translate
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Hour Prizes
        • Installation
        • Configuration
        • No_Escrow
        • Ready Notify.lua
      • ๐Ÿ“ฆThug Anti Mods
        • Installation
        • Configuration
        • Translate
        • Ready Notify.lua
    • ๐Ÿ’šPVP Series
      • ๐Ÿ“ฆThug PVP Hud V3
        • Installation
        • Configuration
        • Translate
        • Shared/weapons.lua
        • Shared/zones.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Deathcam
        • Installation
        • Configuration
        • Translate
        • Ready Notify.lua
        • Shared/weapons.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Killfeed V2
        • Installation
        • Configuration
        • Translate
        • Shared/weapons.lua
        • Client/no_escrow.lua
        • Server/no_escrow.lua
      • ๐Ÿ“ฆThug Kill Shows
        • Installation
        • Configuration
        • Translate
        • Client/no_escrow.lua
Powered by GitBook
On this page
  1. SCRIPTS
  2. RP Series
  3. Thug Hour Prizes

No_Escrow

-- # Get Framework ------------------------------------------------------------------------------------

Sv_Framework = nil

if Config.Settings['Framework'] == "esx" then
    ESX = exports["es_extended"]:getSharedObject()
    Sv_Framework = "esx"
elseif Config.Settings['Framework'] == "oldesx" then
    ESX = nil
    TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
    Sv_Framework = "esx"
elseif Config.Settings['Framework'] == "qb" then
    QBCore = exports['qb-core']:GetCoreObject()
    Sv_Framework = "qb"
elseif Config.Settings['Framework'] == "oldqb" then
    QBCore = nil
    Sv_Framework = "qb"
    Citizen.CreateThread(function()
        while QBCore == nil do
            TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
            Citizen.Wait(200)
        end
    end)
elseif Config.Settings['Framework'] == "qbx" then
    if GetResourceState("qbx_core") == "started" then
        QBCore = exports['qbx-core']:GetCoreObject()
        Sv_Framework = "qbx"
    elseif GetResourceState("qbx-core") == "started" then
        QBCore = exports['qbx_core']:GetCoreObject()
        Sv_Framework = "qbx"
    end
end

-- # Functions ------------------------------------------------------------------------------------

Framework_Functions = {
    ["esx"] = {
        ["giveMoney"] = function(src, amount)
            local xPlayer = ESX.GetPlayerFromId(src)
            if xPlayer then
                xPlayer.addMoney(amount)
            end
        end,
        ["giveItem"] = function(src, item, amount)
            local xPlayer = ESX.GetPlayerFromId(src)
            if xPlayer then
                xPlayer.addInventoryItem(item, amount)
            end
        end,
        ["giveVehicle"] = function(src, vehicle)
            local xPlayer = ESX.GetPlayerFromId(src)
            if xPlayer then
                local plate = "ESX"..math.random(1000, 9999)
                if (Config.Settings['Database_Driver'] == "mysql-async") then
                    MySQL.Async.execute('INSERT INTO owned_vehicles (owner, vehicle, plate) VALUES (@owner, @vehicle, @plate)', {
                        ['@owner'] = xPlayer.identifier,
                        ['@vehicle'] = json.encode({model = vehicle, plate = plate}),
                        ['@plate'] = plate
                    }, function(rowsChanged) end)
                elseif (Config.Settings['Database_Driver'] == "ghmattimysql") then
                    exports.ghmattimysql:execute('INSERT INTO owned_vehicles (owner, vehicle, plate) VALUES (@owner, @vehicle, @plate)', {
                        ['@owner'] = xPlayer.identifier,
                        ['@vehicle'] = json.encode({model = vehicle, plate = plate}),
                        ['@plate'] = plate
                    }, function(result) end)
                elseif (Config.Settings['Database_Driver'] == "oxmysql") then
                    exports.oxmysql:execute('INSERT INTO owned_vehicles (owner, vehicle, plate) VALUES (?, ?, ?)', {
                        xPlayer.identifier,
                        json.encode({model = vehicle, plate = plate}),
                        plate
                    }, function(result) end)
                end
            end
        end
    },
    ["qb"] = {
        ["giveMoney"] = function(src, amount)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                Player.Functions.AddMoney('cash', amount)
            end
        end,
        ["giveItem"] = function(src, item, amount)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                Player.Functions.AddItem(item, amount)
                TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add')
            end
        end,
        ["giveVehicle"] = function(src, vehicle)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                local plate = "QB"..math.random(1000, 9999)
                if (Config.Settings['Database_Driver'] == "ghmattimysql") then
                    exports.ghmattimysql:execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (@license, @citizenid, @vehicle, @hash, @mods, @plate)', {
                        ['@license'] = Player.PlayerData.license,
                        ['@citizenid'] = Player.PlayerData.citizenid,
                        ['@vehicle'] = vehicle,
                        ['@hash'] = GetHashKey(vehicle),
                        ['@mods'] = '{}',
                        ['@plate'] = plate
                    }, function(result) end)
                elseif (Config.Settings['Database_Driver'] == "mysql-async") then
                    MySQL.Async.execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (@license, @citizenid, @vehicle, @hash, @mods, @plate)', {
                        ['@license'] = Player.PlayerData.license,
                        ['@citizenid'] = Player.PlayerData.citizenid,
                        ['@vehicle'] = vehicle,
                        ['@hash'] = GetHashKey(vehicle),
                        ['@mods'] = '{}',
                        ['@plate'] = plate
                    }, function(rowsChanged) end)
                elseif (Config.Settings['Database_Driver'] == "oxmysql") then
                    exports.oxmysql:execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (?, ?, ?, ?, ?, ?)', {
                        Player.PlayerData.license,
                        Player.PlayerData.citizenid,
                        vehicle,
                        GetHashKey(vehicle),
                        '{}',
                        plate
                    }, function(affectedRows) end)
                end
            end
        end
    },
    ["qbx"] = {
        ["giveMoney"] = function(src, amount)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                Player.Functions.AddMoney('cash', amount)
            end
        end,
        ["giveItem"] = function(src, item, amount)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                Player.Functions.AddItem(item, amount)
                TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], 'add')
            end
        end,
        ["giveVehicle"] = function(src, vehicle)
            local Player = QBCore.Functions.GetPlayer(src)
            if Player then
                local plate = "QB"..math.random(1000, 9999)
                if (Config.Settings['Database_Driver'] == "ghmattimysql") then
                    exports.ghmattimysql:execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (@license, @citizenid, @vehicle, @hash, @mods, @plate)', {
                        ['@license'] = Player.PlayerData.license,
                        ['@citizenid'] = Player.PlayerData.citizenid,
                        ['@vehicle'] = vehicle,
                        ['@hash'] = GetHashKey(vehicle),
                        ['@mods'] = '{}',
                        ['@plate'] = plate
                    }, function(result) end)
                elseif (Config.Settings['Database_Driver'] == "mysql-async") then
                    MySQL.Async.execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (@license, @citizenid, @vehicle, @hash, @mods, @plate)', {
                        ['@license'] = Player.PlayerData.license,
                        ['@citizenid'] = Player.PlayerData.citizenid,
                        ['@vehicle'] = vehicle,
                        ['@hash'] = GetHashKey(vehicle),
                        ['@mods'] = '{}',
                        ['@plate'] = plate
                    }, function(rowsChanged) end)
                elseif (Config.Settings['Database_Driver'] == "oxmysql") then
                    exports.oxmysql:execute('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate) VALUES (?, ?, ?, ?, ?, ?)', {
                        Player.PlayerData.license,
                        Player.PlayerData.citizenid,
                        vehicle,
                        GetHashKey(vehicle),
                        '{}',
                        plate
                    }, function(affectedRows) end)
                end
            end
        end
    }
}
PreviousConfigurationNextReady Notify.lua

Last updated 10 months ago

๐Ÿ’›
๐Ÿ“ฆ