SA-MP Mobile

SA-MP Scripting and Plugins => Plugin Development => Topic started by: Kalcor, SA:MP on Aug 08, 2023, 07:46 AM

Title: [Plugin] Native Fallback – Ignore missing natives
Post by: Kalcor, SA:MP on Aug 08, 2023, 07:46 AM
[Plugin] Native Fallback – Ignore missing natives

NativeFallback v1.1

Download
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 (https://sampforum.blast.hk/showthread.php?tid=663694)