mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 09:13:29 +00:00
Merge branch 'main' into patch-1
This commit is contained in:
+8
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user