HookNative

Allows you to hook into FiveM's native function system, giving you complete control over whether native functions execute and what values they return.

Syntax

Susano.HookNative(native_hash, hook_function)

Parameters

circle-info

native_hash (number) - The hash of the native function to hook

hook_function (function) - Your callback function that handles the interception

Return(s)

circle-info

None

Hook Function

Your hook function receives the same arguments as the original native and must return specific values to control behavior.

Return Format

return call_original, return_value1, return_value2, ...

call_original (boolean)

  • true - Execute the original native function

  • false - Block the native and use your custom return values

return_value1, return_value2, ... (any)

  • Custom values to return when blocking the native

  • Must match the expected return types of the original native

circle-info

Natives args modification is not possible, yet.

circle-info

The only supported types for custom return values are: Bool, Number, String, Tables

Vector3 are not supported YET

Example(s)

Last updated