z.inc
PHP Code:
#if defined _z_included
#endinput
#endif
#define _z_included
native int Test_z();
public SharedPlugin __pl_z =
{
name = "z",
file = "z.smx",
required = 0
};
public void __pl_z_SetNTVOptional()
{
MarkNativeAsOptional("Test_z");
}
z.sp
PHP Code:
#include <z>
public void OnClientPostAdminCheck(int client)
{
bool b = false;
if (b) {
Test_z();
}
}
sm plugins load z.smx
[SM] Plugin z.smx failed to load: Native "Test_z" was not found.
If I rename z.smx to zz.smx (or other) then it works.
if I do:
PHP Code:
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
MarkNativeAsOptional("Test_z");
return APLRes_Success;
}
in z.smx then it works.
Why
public void __pl_z_SetNTVOptional() doesn't work for z.smx
Why am I forced to do AskPluginLoad2->MarkNativeAsOptional in z.smx
-----------------
It will work if in z.smx I do:
PHP Code:
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
CreateNative("Test_z", Test_z_);
return APLRes_Success;
}
public int Test_z_(Handle plugin, int args) {
return 0;
}
But my goal is to create native "Test_z" with a delay.
Apparently __pl_z_SetNTVOptional doesn't work because of the delay and I have to do MarkNativeAsOptional.
Anyway, I expected more from __pl_z_SetNTVOptional.