-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable for exploit distance check #516
Closed
+13
−12
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ local FingerDrops = {} | |
local Objects = {} | ||
local QBCore = exports['qb-core']:GetCoreObject() | ||
local updatingCops = false | ||
local exploit_distance_check = 2.5 -- If you are getting exploit bans, increase this number | ||
|
||
-- Functions | ||
local function UpdateBlips() | ||
|
@@ -711,7 +712,7 @@ RegisterNetEvent('police:server:TakeOutImpound', function(plate, garage) | |
local playerPed = GetPlayerPed(src) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = Config.Locations['impound'][garage] | ||
if #(playerCoords - targetCoords) > 10.0 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check * 4 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Magic Number here - I understand why it's *4 but in this case, it would probably be better to just make a separate "impound_exploit_distance_check". Because 10 may be enough but the 2.5 for other things may not. |
||
MySQL.update('UPDATE player_vehicles SET state = ? WHERE plate = ?', { 0, plate }) | ||
TriggerClientEvent('QBCore:Notify', src, Lang:t('success.impound_vehicle_removed'), 'success') | ||
end) | ||
|
@@ -722,7 +723,7 @@ RegisterNetEvent('police:server:CuffPlayer', function(playerId, isSoftcuff) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(src) | ||
local CuffedPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -737,7 +738,7 @@ RegisterNetEvent('police:server:EscortPlayer', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(source) | ||
local EscortPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -756,7 +757,7 @@ RegisterNetEvent('police:server:KidnapPlayer', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(source) | ||
local EscortPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -776,7 +777,7 @@ RegisterNetEvent('police:server:SetPlayerOutVehicle', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local EscortPlayer = QBCore.Functions.GetPlayer(playerId) | ||
if not QBCore.Functions.GetPlayer(src) or not EscortPlayer then return end | ||
|
@@ -794,7 +795,7 @@ RegisterNetEvent('police:server:PutPlayerInVehicle', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local EscortPlayer = QBCore.Functions.GetPlayer(playerId) | ||
if not QBCore.Functions.GetPlayer(src) or not EscortPlayer then return end | ||
|
@@ -812,7 +813,7 @@ RegisterNetEvent('police:server:BillPlayer', function(playerId, price) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(src) | ||
local OtherPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -829,7 +830,7 @@ RegisterNetEvent('police:server:JailPlayer', function(playerId, time) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(src) | ||
local OtherPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -892,7 +893,7 @@ RegisterNetEvent('police:server:SeizeCash', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
local Player = QBCore.Functions.GetPlayer(src) | ||
local SearchedPlayer = QBCore.Functions.GetPlayer(playerId) | ||
if not Player or not SearchedPlayer then return end | ||
|
@@ -911,7 +912,7 @@ RegisterNetEvent('police:server:SeizeDriverLicense', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local SearchedPlayer = QBCore.Functions.GetPlayer(playerId) | ||
if not QBCore.Functions.GetPlayer(src) or not SearchedPlayer then return end | ||
|
@@ -932,7 +933,7 @@ RegisterNetEvent('police:server:RobPlayer', function(playerId) | |
local targetPed = GetPlayerPed(playerId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Player = QBCore.Functions.GetPlayer(src) | ||
local SearchedPlayer = QBCore.Functions.GetPlayer(playerId) | ||
|
@@ -1108,7 +1109,7 @@ RegisterNetEvent('police:server:SetTracker', function(targetId) | |
local targetPed = GetPlayerPed(targetId) | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local targetCoords = GetEntityCoords(targetPed) | ||
if #(playerCoords - targetCoords) > 2.5 then return DropPlayer(src, 'Attempted exploit abuse') end | ||
if #(playerCoords - targetCoords) > exploit_distance_check then return DropPlayer(src, 'Attempted exploit abuse') end | ||
|
||
local Target = QBCore.Functions.GetPlayer(targetId) | ||
if not QBCore.Functions.GetPlayer(src) or not Target then return end | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be as a config variable. If you want it user-editable, please place it there.