๐Ÿ“–Integrations-QBCore

Resource Integrations guide with other resources.

Client Side:

Unlocked File Path:

PATH : fs_fraud/client/unlocked.lua

This file contain all functions you can edit like


function notification(title, msg, type, icon)
  --  exports['okokNotify']:Alert(title, msg, 5000, 'success')
      lib.notify({
         title = title,
         description = msg,
         type = type,
         duration = 5000,
         position = 'center-right',
         icon = icon
      })
    
end
 
function Draw3DText(x, y, z, text)
    SetTextScale(0.35, 0.35)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(true)
    AddTextComponentString(text)
    SetDrawOrigin(x, y, z, 0)
    DrawText(0.0, 0.0)
    local factor = (string.len(text)) / 370
    DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75) --comment this out to remove background on 3dtext
    ClearDrawOrigin()
end

function LoadAnimDict(dict)
    if not HasAnimDictLoaded(dict) then
        RequestAnimDict(dict)

        while not HasAnimDictLoaded(dict) do
            Citizen.Wait(1)
        end
    end
end
 
function DrawHudText2(text,colour,coordsx,coordsy,scalex,scaley)
	SetTextFont(7)
	SetTextProportional(7)
	SetTextScale(scalex, scaley)
	local colourr,colourg,colourb,coloura = table.unpack(colour)
	SetTextColour(colourr,colourg,colourb, coloura)
	SetTextDropshadow(0, 0, 0, 0, coloura)
	SetTextEdge(1, 0, 0, 0, coloura)
	SetTextDropShadow()
	SetTextJustification(0)
	SetTextOutline()
	SetTextEntry("STRING")
	AddTextComponentString(text)
	EndTextCommandDisplayText(coordsx,coordsy)
end

Server Side:

Unlocked File Path:

PATH : fs_fraud/server/unlocked.lua

This file contain all functions you can edit like

--you can add custom alert here according to ur need but we don't provide support for it because we alrady provide defult function for it
RegisterNetEvent('fs_fraudalerts:alert', function(alerttype, coords)
    local xPlayers = QBCore.Functions.GetPlayers()
    for count, _source in pairs(xPlayers) do
        local xPlayer = QBCore.Functions.GetPlayer(_source)
        if xPlayer.PlayerData.job.name == 'police' then
            TriggerClientEvent('fs_fraud:setblip', _source, coords, alerttype)
        end
    end
end)

RegisterNetEvent('fs_fraud:insideatmonuse', function(pos)
    local xPlayer = QBCore.Functions.GetPlayer(source)
    local item = xPlayer.Functions.GetItemByName(Config.Items.clonnedcard)
    local randomChance = math.random(1, 5) -- 1 in 5 chance to alert police
    if item ~= nil then
        if item.amount >= 1 then
            if randomChance == 5 then
                xPlayer.Functions.RemoveItem(Config.Items.clonnedcard, 1)
                TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[Config.Items.clonnedcard], "remove")

                notifys(source, lang['atm_ate_card'].description, lang['atm_ate_card'].type, lang['atm_ate_card'].icon)
                TriggerEvent('fs_fraudalerts:alert', 2, pos)
            else
                xPlayer.Functions.RemoveItem(Config.Items.clonnedcard, 1)
                TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[Config.Items.clonnedcard], "remove")

                if Config.Atm.account == 'marked_bills' then
                    local bags = 2
                    local info = {
                        worth = tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max))
                    }
                    xPlayer.Functions.AddItem('markedbills', bags, false, info)
                    TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['markedbills'], "add")
                elseif Config.Atm.account == 'black_money' then
                    xPlayer.Functions.AddItem('black_money',  tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max)))
                    TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['black_money'], "add")
                else
                    xPlayer.Functions.AddMoney('cash', tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max)))
                end
            end    
        end
    else
        if Config.Atm.extras.cheque then
            local forgedcheque = xPlayer.Functions.GetItemByName(Config.Items.forgedcheque)
            if forgedcheque ~= nil then
                if forgedcheque.amount >= 1 then
                    if randomChance == 5 then
                        xPlayer.Functions.RemoveItem(Config.Items.forgedcheque, 1)

                        notifys(source, lang['atm_ate_card'].title, "cheque contain fake information.", lang['atm_ate_card'].type, lang['atm_ate_card'].icon)
                        TriggerEvent('fs_fraudalerts:alert', 2, pos)
                    else
                        xPlayer.Functions.RemoveItem(Config.Items.forgedcheque, 1)
                        TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[Config.Items.forgedcheque], "remove")
                        
                        if Config.Atm.account == 'marked_bills' then
                            local bags = 2
                            local info = {
                                worth = tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max))
                            }
                            xPlayer.Functions.AddItem('markedbills', bags, false, info)
                            TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['markedbills'], "add")
                        elseif Config.Atm.account == 'black_money' then
                            xPlayer.Functions.AddItem('black_money',  tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max)))
                            TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['black_money'], "add")
                        else
                            xPlayer.Functions.AddMoney('cash', tonumber(math.random(Config.Atm.amount.min, Config.Atm.amount.max)))
                        end
                    end
                end
            else
                print('forgedcheque item not installed correctly in server')
            end
        end
    end
end)

RegisterNetEvent('fs_fraud:sellChecktobanker', function(pos)
    local xPlayer = QBCore.Functions.GetPlayer(source)

    local forgedCheck = xPlayer.Functions.GetItemByName(Config.Shops[4].items[1].name)

    local randomChance = math.random(1, 10) -- 1 in 10 chance to alert police)
    if forgedCheck ~= nil then
        if forgedCheck.amount >= 1 then
            if randomChance == 5 then
                TriggerEvent('k_fraudalerts:alert', 1, pos)
                notifys(source, "Fraud Notification", "Your cheque contain fake information police alrted!!", "error", lang['atm_ate_card'].icon)
                xPlayer.Functions.RemoveItem(Config.Shops[4].items[1].name, 1)
                TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items [Config.Shops[4].items[1].name], "remove")
            else
                xPlayer.Functions.RemoveItem(Config.Shops[4].items[1].name, 1)
                TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items [Config.Shops[4].items[1].name], "remove")

                if Config.Shops[4].account == 'marked_bills' then
                    local bags = 2
                    local info = {
                        worth = tonumber(math.random(Config.Shops[4].items[1].price.min,Config.Shops[4].items[1].price.max))
                    }
                    xPlayer.Functions.AddItem('markedbills', bags, false, info)
                    TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['markedbills'], "add")
                elseif Config.Shops[4].account == 'black_money' then
                    xPlayer.Functions.AddItem('black_money',  tonumber(math.random(Config.Shops[4].items[1].price.min,Config.Shops[4].items[1].price.max)))
                    TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items['black_money'], "add")
                else
                    xPlayer.Functions.AddMoney('cash', tonumber(math.random(Config.Shops[4].items[1].price.min,Config.Shops[4].items[1].price.max)))
                end
            end
        else
            notifys(source, lang['nothing_to_sell'].title, lang['nothing_to_sell'].description, lang['nothing_to_sell'].type, lang['nothing_to_sell'].icon)
        end
    else
        notifys(source, lang['nothing_to_sell'].title, lang['nothing_to_sell'].description, lang['nothing_to_sell'].type, lang['nothing_to_sell'].icon)
    end
end)

function DropHacker(player)
    DropPlayer(player, "Trying to Trigger functions that are not triggered by script")
end

Last updated