DOCUMENTATION

FCSAPI.BlockNativeExecution

This is a security function that blocks and overrides native FiveM functions to prevent their direct execution. It's designed to detect and prevent exploit attempts that try to execute that your script shouldn't try to use. For an example

Syntax:

--@param functionName string The function name to check
--@return isValidExecution boolean Wether the execution is valid or not
local isValidExecution = FCSAPI.IsValidExecution(functionName)

Usage Example:

function ESX.Game.SpawnObject(object, coords, cb, networked)
    if not FCSAPI.IsValidExecution("SpawnObject") then
        return --Block Execution, FCS will automatically ban the player.
    end

    local model = type(object) == "number" and object or joaat(object)

    ESX.Streaming.RequestModel(model)

    local obj = CreateObject(model, coords.x, coords.y, coords.z, networked == nil or networked, false, true)
    return cb and cb(obj) or obj
end

Last updated