From 61c709c0f067155b6357f5f92ee7a2a4cb243672 Mon Sep 17 00:00:00 2001 From: Idris Dev Date: Sat, 19 Feb 2022 17:26:05 +1100 Subject: [PATCH 1/4] feat (readme): Updated readme (#538) * Update README.md * Update README.md Co-authored-by: Kakarot <57848836+GhzGarage@users.noreply.github.com> --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 1d9dfa0..b0e11be 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,18 @@ ### [Official QBCore Documentation](https://qbcore-framework.github.io/qb-docs/) +## QBCore is officially partnered with Sonoran Software! +Sonoran Software offers: +* [The most advanced, integrated CAD software](https://sonorancad.com/kakarot) +* [Complete community management software](https://sonorancms.com/kakarot) +* [In-depth radio communications simulator](https://sonoranradio.com/kakarot) +* [Premium server hosting](https://sonoranservers.com/kakarot) + +Use code `KAKAROT` for 20% off your first month at checkout! + +# Sonoran Software +![Sonoran Software Partnership](https://sonoransoftware.com/assets/images/promotional/partners/qb_banner_coupon.png) + # License QBCore Framework From 391b293e06b2e53e6a0a7d5bfed9b5b2e66afba5 Mon Sep 17 00:00:00 2001 From: Idris Dev Date: Sat, 19 Feb 2022 17:27:01 +1100 Subject: [PATCH 2/4] style (drawtext): camelCase drawtext local functions. Co-Authored by @BerkieBb --- client/drawtext.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/drawtext.lua b/client/drawtext.lua index 4ae4a37..ef669b2 100644 --- a/client/drawtext.lua +++ b/client/drawtext.lua @@ -1,11 +1,11 @@ -local function HideText() +local function hideText() SendNUIMessage({ action = 'HIDE_TEXT', }) end -local function DrawText(text, position) - if (not type(position) == "string") then position = "left" end +local function drawText(text, position) + if not type(position) == "string" then position = "left" end SendNUIMessage({ action = 'DRAW_TEXT', @@ -16,8 +16,8 @@ local function DrawText(text, position) }) end -local function ChangeText(text, position) - if (not type(position) == "string") then position = "left" end +local function changeText(text, position) + if not type(position) == "string" then position = "left" end SendNUIMessage({ action = 'CHANGE_TEXT', @@ -28,33 +28,33 @@ local function ChangeText(text, position) }) end -local function KeyPressed() - Citizen.CreateThread(function() -- Not sure if a thread is needed but why not eh? +local function keyPressed() + CreateThread(function() -- Not sure if a thread is needed but why not eh? SendNUIMessage({ action = 'KEY_PRESSED', }) Wait(500) - HideText() + hideText() end) end RegisterNetEvent('qb-core:client:DrawText', function(text, position) - DrawText(text, position) + drawText(text, position) end) RegisterNetEvent('qb-core:client:ChangeText', function(text, position) - ChangeText(text, position) + changeText(text, position) end) RegisterNetEvent('qb-core:client:HideText', function() - HideText() + hideText() end) RegisterNetEvent('qb-core:client:KeyPressed', function() - KeyPressed() + keyPressed() end) -exports('DrawText', DrawText) -exports('ChangeText', ChangeText) -exports('HideText', HideText) -exports('KeyPressed', KeyPressed) \ No newline at end of file +exports('DrawText', drawText) +exports('ChangeText', changeText) +exports('HideText', hideText) +exports('KeyPressed', keyPressed) From 3b36f7e4e5903e0ddd2ef90df219caf34f51d27c Mon Sep 17 00:00:00 2001 From: Liam Dormon <66041893+Mojito-Fivem@users.noreply.github.com> Date: Sat, 19 Feb 2022 06:39:50 +0000 Subject: [PATCH 3/4] fix(client/functions): type checking for vectors (#430) allows for cross scrt compatibility with newer functions --- client/functions.lua | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/client/functions.lua b/client/functions.lua index 87a5887..fd6a967 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -62,17 +62,19 @@ function QBCore.Functions.CreateBlip(coords, sprite, display, scale, colour, sho if not coords or not sprite or not display or not scale or not colour or shortRange == nil or not title then print("Blip failed to create, most likely missed a setting, debug log: ") print("Coords: " .. coords .. " Sprite: " .. sprite .. " Display: " .. display .. " scale: " .. scale .. " shortRange: " .. shortRange .. " Title: " .. title .. " if you're attempting to use a blip without a title, use an empty string.") - else - blip = AddBlipForCoord(coords) - SetBlipSprite(blip, sprite) - SetBlipDisplay(blip, display) - SetBlipScale(blip, scale) - SetBlipColour(blip, colour) - SetBlipAsShortRange(blip, shortRange) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(title) - EndTextCommandSetBlipName(blip) + return end + + coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords + blip = AddBlipForCoord(coords) + SetBlipSprite(blip, sprite) + SetBlipDisplay(blip, display) + SetBlipScale(blip, scale) + SetBlipColour(blip, colour) + SetBlipAsShortRange(blip, shortRange) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(title) + EndTextCommandSetBlipName(blip) end function QBCore.Functions.RequestAnimDict(animDict) @@ -403,6 +405,11 @@ function QBCore.Functions.GetPlate(vehicle) end function QBCore.Functions.SpawnClear(coords, radius) + if coords then + coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords + else + coords = GetEntityCoords(ped) + end local vehicles = GetGamePool('CVehicle') local closeVeh = {} for i=1, #vehicles, 1 do From 707a43d4b8363206745c647361969e7072431a8b Mon Sep 17 00:00:00 2001 From: MeMo <73984552+memojustone@users.noreply.github.com> Date: Sat, 19 Feb 2022 08:56:02 +0200 Subject: [PATCH 4/4] fix (server/functions): BanTime fix. --- server/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/functions.lua b/server/functions.lua index df63ca7..29b48eb 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -391,9 +391,9 @@ function QBCore.Functions.IsPlayerBanned(source) if os.time() < result.expire then retval = true local timeTable = os.date('*t', tonumber(result.expire)) - message = 'You have been banned from the server:\n' .. result[1].reason .. '\nYour ban expires ' .. timeTable.day .. '/' .. timeTable.month .. '/' .. timeTable.year .. ' ' .. timeTable.hour .. ':' .. timeTable.min .. '\n' + message = 'You have been banned from the server:\n' .. result.reason .. '\nYour ban expires ' .. timeTable.day .. '/' .. timeTable.month .. '/' .. timeTable.year .. ' ' .. timeTable.hour .. ':' .. timeTable.min .. '\n' else - MySQL.Async.execute('DELETE FROM bans WHERE id = ?', { result[1].id }) + MySQL.Async.execute('DELETE FROM bans WHERE id = ?', { result.id }) end end return retval, message