Merge branch 'main' into patch-1

This commit is contained in:
Zerio
2023-01-18 17:24:25 +01:00
committed by GitHub
2 changed files with 20 additions and 1 deletions
+8 -1
View File
@@ -160,6 +160,12 @@ end)
RegisterNetEvent('QBCore:Client:VehicleInfo', function(info)
local plate = QBCore.Functions.GetPlate(info.vehicle)
local hasKeys = true
if GetResourceState('qb-vehiclekeys') == 'started' then
hasKeys = exports['qb-vehiclekeys']:HasKeys()
end
local data = {
vehicle = info.vehicle,
seat = info.seat,
@@ -167,8 +173,9 @@ RegisterNetEvent('QBCore:Client:VehicleInfo', function(info)
plate = plate,
driver = GetPedInVehicleSeat(info.vehicle, -1),
inseat = GetPedInVehicleSeat(info.vehicle, info.seat),
haskeys = exports['qb-vehiclekeys']:HasKeys(plate)
haskeys = hasKeys
}
TriggerEvent('QBCore:Client:'..info.event..'Vehicle', data)
end)
+12
View File
@@ -414,3 +414,15 @@ end
function QBCore.Functions.Notify(source, text, type, length)
TriggerClientEvent('QBCore:Notify', source, text, type, length)
end
--- SQL Pattern Matching
function QBCore.Functions.PrepForSQL(source,data,pattern)
local src = source
local player = QBCore.Functions.GetPlayer(src)
local result = string.match(data, pattern)
if not result or string.len(result) ~= string.len(data) then
TriggerEvent('qb-log:server:CreateLog', 'anticheat', 'SQL Injection Attempted', 'red', string.format('%s Attempted a SQL Exploit!', player.PlayerData.license))
return false
end
return true
end