[Plugin] Native Fallback – Ignore missing natives

Started by Kalcor, SA:MP, Aug 08, 2023, 07:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kalcor, SA:MP

[Plugin] Native Fallback – Ignore missing natives

Introduction

When a script that references missing natives is executed, an error is raised even though the natives may not actually be called in the script and aren't required for its normal functioning. This plugin provides a so-called fallback implementation for any missing native and allows the script to be executed in all cases.



Details

This plugin by default creates 256 (can be adjusted before recompilation) stub fallback functions and registers them in place of missing natives before any code is actually executed (a message is printed to the log for every native). When the fallback implementation is called, run-time error 19 (not found) is raised, stopping the execution of the script (and a message is again printed with the name of the function).



When more than 256 native functions are missing, a generic fallback function is provided instead, but it cannot display the name of the function due to limitations of AMX.



If you want to customize the fallback function, you can hook it via PawnPlus.

Source: [Plugin] Native Fallback – Ignore missing natives