Junior Member
Join Date: Jul 2016
Location: Not here
|
07-25-2016
, 12:42
RegAdminCmd() => Error 100: function prototypes do not match
|
#1
|
Hello world !
Today, i opened my 1st TF2 server and i'm scripting a little plugin for server.
When compiling, there is an error on that line :
Code:
RegAdminCmd("dbinfo", DataBaseConfiguration, ADMFLAG_SLAY);
I try with :
Code:
RegConsoleCmd("dbinfo", DataBaseConfiguration, "Start the configuration of db");
same result.
There is the .sp :
Code:
#include <sourcemod>
bool pluginsLoaded[] = {
true,
false,
false,
false,
false,
false
};
/*
* pluginsLoaded : KafhetCore.smx | KafhetFF2.smx | KafhetPerm.smx | KafhetMenu.smx | KafhetFF2Select.smx | KafhetStat.smx penser a changer dans DataBaseConfiguration
*/
char pluginsName[] = {
"KafhetCore",
"KafhetPerm",
"KafhetMenu",
"KafhetStat",
"KafhetFF2",
"KafhetFF2Select"
};
public Plugin:myinfo =
{
name = "KafhetCore",
author = "AmeriK",
description = "Base for Kafhet plugins",
version = "1.0",
url = "www.amerik.fr"
}
public void OnPluginStart()
{
LoadTranslations("common.phrases");
RegConsoleCmd("plugins_info", Cmd_plugins_info, "Show Kafhet's plugins");
RegAdminCmd("dbinfo", DataBaseConfiguration, ADMFLAG_SLAY);
}
public DataBaseConfiguration(pluginsLoaded[], pluginsName[])
{
char name[25];
for (int i = 0; i < 6; i++)// pour 6 plugins
{
if (GetPluginFilename(pluginsName[i], name[i], 25) != INVALID_HANDLE) //test si plugins présents, pour excecuter bdd
{
pluginsLoaded[i] = true;
PrintToServer("KAFHETCORE Find this plugin: ");
PrintToServer(name[i]);
}
else
{
pluginsLoaded[i] = false;
PrintToServer("KAFHETCORE Dont find : ");
PrintToServer(name[i]);
}
}
}
//Check ingame command : Menu Plugins
public Action:Cmd_plugins_info(client, args)
{
if (client == 0)
{
ReplyToCommand(client, "%t", "Command is in-game only");
return Plugin_Handled;
}
KafhetMenuPlugins(client);
return Plugin_Handled;
}
KafhetMenuPlugins(client)
{
new Handle:menu = CreateMenu(k_PluginsInfos, MENU_ACTIONS_DEFAULT);
SetMenuTitle(menu, "Kafhet plugins infos");
AddMenuItem(menu, "kafcor", "KafhetCore.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "baseplugin_info", "1.0 by AmeriK : Click for specifics");
AddMenuItem(menu, "kafff2", "KafhetFF2.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "ff2modified_info", "1.0 by AmeriK : Click for specifics");
AddMenuItem(menu, "kafper", "KafhetPerm.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "notrel", "Not released yet :C", ITEMDRAW_DISABLED);
AddMenuItem(menu, "kafmen", "KafhetMenu.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "kafmen_info", "1.0 by AmeriK : Click for specifics");
AddMenuItem(menu, "kafsel", "KafhetFF2Select.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "kafsel_info", "1.0 by Amerik : Click for specifics");
AddMenuItem(menu, "kafsta", "KafhetStats.smx", ITEMDRAW_DISABLED);
AddMenuItem(menu, "kafstat_info", "Not released yet :C", ITEMDRAW_DISABLED);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public k_PluginsInfos(Handle:menu, MenuAction:action, param1, param2)
{
switch (action)
{
case MenuAction_Select:
{
//param1 is client, param2 is item
new String:item[64];
GetMenuItem(menu, param2, item, sizeof(item));
if (StrEqual(item, "baseplugin_info"))
{
PrintToChat(param1, "License : None. \nStatus : Private \nVersion : 1.0 \nAuthor : AmeriK \nKafhetCore.smx is a base plugin for all Kafhet Plugins.");
new pos = GetMenuSelectionPosition();
DisplayMenuAtItem(CloneHandle(menu), param1, pos, MENU_TIME_FOREVER);
}
else if (StrEqual(item, "ff2modified_info"))
{
PrintToChat(param1, "License : None. \nStatus : Private \nVersion : 1.0 \nAuthor : AmeriK, FF2 Authors \nKafhetFF2.smx is a FF2 modified plugin for Kafhet's webpanel");
new pos = GetMenuSelectionPosition();
DisplayMenuAtItem(CloneHandle(menu), param1, pos, MENU_TIME_FOREVER);
}
else if (StrEqual(item, "kafmen_info"))
{
PrintToChat(param1, "License : None. \nStatus : Private \nVersion : 1.0 \nAuthor : AmeriK \nKafhetMenu.smx is a powerful plugins to display customs menu for custom KafhetPerm.smx's ranks !");
new pos = GetMenuSelectionPosition();
DisplayMenuAtItem(CloneHandle(menu), param1, pos, MENU_TIME_FOREVER);
}
else if (StrEqual(item, "kafsel_info"))
{
PrintToChat(param1, "License : None. \nStatus : Private \nVersion : 1.0 \nAuthor : AmeriK \nKafhetFF2Selection.smx is a plugin to toggle boos selection and custom boss packs for FF2 !");
new pos = GetMenuSelectionPosition();
DisplayMenuAtItem(CloneHandle(menu), param1, pos, MENU_TIME_FOREVER);
}
}
case MenuAction_End:
{
//param1 is MenuEnd reason, if canceled param2 is MenuCancel reason
CloseHandle(menu);
}
}
}
There is the compiler :
Code:
//// KafhetCore.sp
//
// D:\PawnStudio\Projects\KafhetCore.sp(40) : error 100: function prototypes do
not match
// D:\PawnStudio\Projects\KafhetCore.sp(43) : warning 219: local variable "plugi
nsLoaded" shadows a variable at a preceding level
// D:\PawnStudio\Projects\KafhetCore.sp(43) : warning 219: local variable "plugi
nsName" shadows a variable at a preceding level
// D:\PawnStudio\Projects\KafhetCore.sp(48) : warning 213: tag mismatch
// D:\PawnStudio\Projects\KafhetCore.sp(48) : warning 213: tag mismatch
// D:\PawnStudio\Projects\KafhetCore.sp(11) : warning 203: symbol is never used:
"pluginsLoaded"
// D:\PawnStudio\Projects\KafhetCore.sp(24) : warning 203: symbol is never used:
"pluginsName"
//
// 1 Error.
//
// Compilation Time: 0,91 sec
// ----------------------------------------
Thanks and don't vomit when you see my 1st plugin ^^
__________________
Still loading...
|
|