Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweak(client): more accurate plate checking?
  • Loading branch information
renzuzu committed Aug 13, 2021
1 parent f50d1b5 commit f672d21
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion renzu_garage/client/client.lua
Expand Up @@ -2450,7 +2450,15 @@ function CheckWanderingVehicle(plate)
for i = 1, #gameVehicles do
local vehicle = gameVehicles[i]
if DoesEntityExist(vehicle) then
if tostring(GetVehicleNumberPlateText(vehicle)):upper() == tostring(plate):upper() then
local otherplate = string.gsub(tostring(GetVehicleNumberPlateText(vehicle)), '^%s*(.-)%s*$', '%1'):upper()
local plate = string.gsub(tostring(plate), '^%s*(.-)%s*$', '%1'):upper()
if otherplate:len() > 8 then
otherplate = otherplate:sub(1, -2)
end
if plate:len() > 8 then
plate = plate:sub(1, -2)
end
if plate == otherplate then
ReqAndDelete(vehicle)
end
end
Expand Down

0 comments on commit f672d21

Please sign in to comment.