View Single Post
Author Message
bridgebucket
New Member
Join Date: Mar 2024
Old 03-28-2024 , 21:46   error 100: function prototypes do not match with natives
Reply With Quote #1

trying to use natives, confused on this error. just need some help figuring out what the correct code to use would be. the lines producing this error are these two:

CreateNative("wardenExists", Native_wardenExists);
CreateNative("isWarden", Native_isWarden);

the full code is as follows:

// warden.sp
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
CreateNative("wardenExists", Native_wardenExists);
CreateNative("isWarden", Native_isWarden);
return APLRes_Success;
}

public bool Native_wardenExists(Handle plugin, int numParams)
{
if(Warden != -1) { return true; }
else { return false; }
}

public bool Native_isWarden(Handle plugin, int numParams)
{
int client = GetNativeCell(1);

for(int i = 2; i <= numParams; i++)
{
client += GetNativeCellRef(i);
}

if(client == Warden) { return true; }
else { return false; }
}

//warden.inc
#if defined _warden_included_
#endinput
#endif
#define _warden_included_

/**
*
* @return true on match, false if not
*/
native bool wardenExists();

/**
*
* @param client client to run the check on
* @return true on match, false if not
*/
native bool isWarden(client);
bridgebucket is offline