Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new

Script 💥💥💥[ESX/QB] REDUTZU-EMS NEWEST 💥💥💥

Michealsik

Gold Elite
Joined
Feb 14, 2024
Messages
89
Reaction score
951
Points
306
Location
ohio
1770937919241.png
 

Attachments

  • redutzu-ems.zip
    2.9 MB · Views: 296

HUSO

Gold Elite
Joined
Nov 5, 2023
Messages
59
Reaction score
3,789
Points
306
Location
DEINE MUDDA
not open source ;)
easy

-- Simple array / table utility helpers (common in FiveM resources)

local array = {}

--- Map over an array-like table, applying `fn(value, index)` and collecting results.
---@param tbl table
---@param fn fun(value: any, index: number): any
--- Return table
function array.map(tbl, fn)
local result = {}
for i, value in ipairs(tbl) do
result = fn(value, i)
end
return result
end

--- Filter an array-like table, keeping elements for which `predicate(value)` is truthy.
---@param tbl table
---@param predicate fun(value: any): boolean
--- Return table
function array.filter(tbl, predicate)
local result = {}
local insertIdx = 1
for _, value in ipairs(tbl) do
if predicate(value) then
result[insertIdx] = value
insertIdx = insertIdx + 1
end
end
return result
end

--- Return the first element for which `predicate(value, index)` is truthy, or nil.
---@param tbl table
---@param predicate fun(value: any, index: number): boolean
--- Return any|nil
function array.find(tbl, predicate)
for i, value in ipairs(tbl) do
if predicate(value, i) then
return value
end
end
return nil
end

--- Append a value to the end of an array-like table (mutates and returns the table).
---@param tbl table
---@param value any
--- Return table
function array.push(tbl, value)
table.insert(tbl, value)
return tbl
end

--- Collect all keys of a table into a new array (order is undefined).
---@param tbl table
--- Return table
function array.keys(tbl)
local keys = {}
for k in pairs(tbl) do
table.insert(keys, k)
end
return keys
end

--- Return true if the table has no keys. Errors if the argument is not a table.
---@param tbl any
--- Return boolean
function table.isEmpty(tbl)
if type(tbl) ~= "table" then
error("Expected a table, got " .. type(tbl))
end
for _ in pairs(tbl) do
return false
end
return true
end

--- Return true if `value` appears in the array-like table (uses ipairs).
---@param tbl table
---@param value any
--- Return boolean
function table.includes(tbl, value)
for _, v in ipairs(tbl) do
if v == value then
return true
end
end
return false
end

--- Case-insensitive string match: returns true when `str:lower()` matches the pattern `pattern:lower()`.
---@param pattern string
---@param str string
--- Return boolean
function match(pattern, str)
return str:lower():match(pattern:lower()) ~= nil
end

--- Convert a number to boolean (true when > 0).
---@param n number
--- Return boolean
function numberToBoolean(n)
return n > 0
end

--- Create a shallow copy of a table, turning every `false` value into `nil`.
--- Non-table values are returned unchanged.
---@param value any
--- Return any
function replaceFalseWithNil(value)
if type(value) ~= "table" then
return value
end
local result = {}
for k, v in pairs(value) do
if v == false then
result[k] = nil
else
result[k] = v
end
end
return result
end
 
Top