Alright. So I've been tripped up trying to solve this problem. For whatever reason, my plugin "donationstest.smx" can not find the required "donations" plugin, but I can not for the life of me figure out why. The name of the donations plugin is donations.smx and the name of the plugin in the myinfo is "donations" aswell.
Currently running latest SM snapshot.
Error:
Code:
L 04/01/2017 - 01:47:58: SourceMod error session started
L 04/01/2017 - 01:47:58: Info (map "am_water") (file "errors_20170401.log")
L 04/01/2017 - 01:47:58: [SM] Unable to load plugin "donationstest.smx": Could not find required plugin "donations"
donationstest.sp
PHP Code:
#include <sourcemod>
#include <dynamic>
#include <donations>
#include "donor.sp"
public void Donor_OnDonorLoaded(Dynamic other)
{
Donor donor = view_as<Donor>(other);
char string[128];
donor.GetSteamID(string, sizeof(string));
Log("test.log", "Donor %s loaded!", string);
}
void Log(char[] sPath, const char[] sMsg, any ...)
{
char sLogFilePath[PLATFORM_MAX_PATH];
char sFormattedMsg[256];
BuildPath(Path_SM, sLogFilePath, sizeof(sLogFilePath), "logs/%s", sPath);
VFormat(sFormattedMsg, sizeof(sFormattedMsg), sMsg, 3);
LogToFileEx(sLogFilePath, "%s", sFormattedMsg);
}
donations.inc
PHP Code:
/* Double-include prevention */
#if defined _hl_donationmanager_included
#endinput
#endif
#define _hl_donationmanager_included
native ArrayList Donor_GetDonorArray()
forward void Donor_OnDonorLoaded(Dynamic other)
public SharedPlugin __pl_donations =
{
name = "donations",
file = "donations.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public void __pl_donations_SetNTVOptional()
{
MarkNativeAsOptional("Donor_GetDonorArray");
}
#endif
Header of donations.sp
PHP Code:
#include <sourcemod>
#include <dynamic>
#include <donations>
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_VERSION "1.0"
Database myDatabase = null;
Handle g_hOnDonorStringLoaded = null;
/* Chars */
char ga_sSteamID[MAXPLAYERS + 1][128];
/* Booleans */
bool ga_bLoaded[MAXPLAYERS + 1] = {false, ...};
/* ArrayList */
ArrayList donorArray = null;
#include "donor.sp"
public Plugin myinfo =
{
name = "donations",
author = "Headline",
description = "A custom donation system",
version = PLUGIN_VERSION,
url="http://www.michaelwflaherty.com"
};
(and yes, the donations plugin is successfully loaded and functioning properly)