16.10.2018, 13:01
(
Last edited by IllidanS4; 17/10/2018 at 03:32 PM.
)
Purpose
Normally, Pawn function names cannot exceed 31 characters. This is a limitation of both the compiler and the execution engine, which discards AMX programs with longer function names. This plugin removes this limitation of the AMX engine and allows scripts with longer names (of native functions, public functions, and public variables) to execute normally, without modifications to the names themselves. Other scripts will be unaffected by this plugin.
Other plugins may use this plugin to register natives or call public functions with long names. No special API is required to make this work, since the majority of the AMX API can work with any length. However, you should always use amx_NameLength to retrieve the maximum length used by the script.
You will need a compiler supporting longer function names. Check out my fork which increases the length to 63.
Please note that some Pawn libraries may not work properly with longer identifiers. In this case, you either need to configure them in some way to increase the limit, or contact the author.
Example
Normally, Pawn function names cannot exceed 31 characters. This is a limitation of both the compiler and the execution engine, which discards AMX programs with longer function names. This plugin removes this limitation of the AMX engine and allows scripts with longer names (of native functions, public functions, and public variables) to execute normally, without modifications to the names themselves. Other scripts will be unaffected by this plugin.
Other plugins may use this plugin to register natives or call public functions with long names. No special API is required to make this work, since the majority of the AMX API can work with any length. However, you should always use amx_NameLength to retrieve the maximum length used by the script.
You will need a compiler supporting longer function names. Check out my fork which increases the length to 63.
Please note that some Pawn libraries may not work properly with longer identifiers. In this case, you either need to configure them in some way to increase the limit, or contact the author.
Example
pawn Code:
#include <a_samp>
forward VeryLongPublicFunctionNameExceeding31Characters();
public VeryLongPublicFunctionNameExceeding31Characters()
{
print("hello!");
}
public OnFilterScriptInit()
{
CallLocalFunction("VeryLongPublicFunctionNameExceeding31Characters", "");
}