Raised This Month: $51 Target: $400
 12% 

error 100: function prototypes do not match with natives


Post New Thread Reply   
 
Thread Tools Display Modes
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
little_froy
Senior Member
Join Date: May 2021
Old 03-29-2024 , 08:05   Re: error 100: function prototypes do not match with natives
Reply With Quote #2

public bool Native_wardenExists -> any Native_wardenExists
public bool Native_isWarden -> any Native_isWarden

"public" prefix is only for implementing forwards. other callbacks don't need it.

Last edited by little_froy; 03-29-2024 at 08:07.
little_froy is offline
bridgebucket
New Member
Join Date: Mar 2024
Old 03-29-2024 , 18:44   Re: error 100: function prototypes do not match with natives
Reply With Quote #3

Quote:
Originally Posted by little_froy View Post
public bool Native_wardenExists -> any Native_wardenExists
public bool Native_isWarden -> any Native_isWarden
this solution adds 3 new errors on top of the previous two; symbol is never used: "numParams"/"plugin"
bridgebucket is offline
little_froy
Senior Member
Join Date: May 2021
Old 03-29-2024 , 21:45   Re: error 100: function prototypes do not match with natives
Reply With Quote #4

Quote:
Originally Posted by bridgebucket View Post
this solution adds 3 new errors on top of the previous two; symbol is never used: "numParams"/"plugin"
update sourcemod, if you are using an old version.
little_froy is offline
bridgebucket
New Member
Join Date: Mar 2024
Old 03-30-2024 , 01:56   Re: error 100: function prototypes do not match with natives
Reply With Quote #5

Quote:
Originally Posted by little_froy View Post
update sourcemod
i'm using spedit, latest version. under the configuration tab, it says i'm using Standard SM 1.8.0.5914. is spedit outdated, how should i be making plugins?
bridgebucket is offline
little_froy
Senior Member
Join Date: May 2021
Old 03-30-2024 , 02:22   Re: error 100: function prototypes do not match with natives
Reply With Quote #6

Quote:
Originally Posted by bridgebucket View Post
i'm using spedit, latest version. under the configuration tab, it says i'm using Standard SM 1.8.0.5914. is spedit outdated, how should i be making plugins?
should update sourcemod. latest stable version is 1.11 - build 6956.
use vscode to write code, to compile plugins, use command line in linux or drag .sp file to compile.exe in windows.

Last edited by little_froy; 03-31-2024 at 00:02.
little_froy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode