error 100: function prototypes do not match with natives
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); |
Re: error 100: function prototypes do not match with natives
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. |
Re: error 100: function prototypes do not match with natives
Quote:
|
Re: error 100: function prototypes do not match with natives
Quote:
|
Re: error 100: function prototypes do not match with natives
Quote:
|
Re: error 100: function prototypes do not match with natives
Quote:
use vscode to write code, to compile plugins, use command line in linux or drag .sp file to compile.exe in windows. |
All times are GMT -4. The time now is 12:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.