From 55266ffb80b75e2107b24c88eed55ab0a5b9eced Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 8 Nov 2006 09:28:32 +0000 Subject: [PATCH] sample plugin import --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40170 --- plugins/include/sourcemod.inc | 58 +++++++++++++++++++++++++++++++++++ plugins/test.sma | 16 ++++++++++ 2 files changed, 74 insertions(+) create mode 100644 plugins/include/sourcemod.inc create mode 100644 plugins/test.sma diff --git a/plugins/include/sourcemod.inc b/plugins/include/sourcemod.inc new file mode 100644 index 00000000..dcef839d --- /dev/null +++ b/plugins/include/sourcemod.inc @@ -0,0 +1,58 @@ +/** + * :TODO: license info + */ + +#if defined _sourcemod_included + #endinput +#endif +#define _sourcemod_included + +/** + * Note: A plugin can define the following public strings for external information: + * public String:PLUGIN_AUTHOR[] - Author + * public String:PLUGIN_NAME[] - Name/Title + * public String:PLUGIN_DESCRIPTION[] - Short Description + * public String:PLUGIN_VERSION[] - Version information + * public String:PLUGIN_URL[] - Website URL + */ + + +/** + * Called when the plugin is fully initialized and all known external references are resolved, + * such as dynamic natives. + * + * @noreturn + */ +forward OnPluginInit(); + +/** + * Called before OnPluginInit, in case the plugin wants to check for load failure. + * + * @param myself Handle to the plugin. + * @param late Whether or not the plugin was loaded "late" (after map load). + * @param error Error message buffer in case load failed. + * @param err_max Maximum number of characters for error message buffer. + * @return True if load success, false otherwise. + */ +forward bool:OnPluginLoad(Handle:myself, bool:late, String:error[], err_max); + +/** + * Called when the plugin is first mapped into memory. Use this to set dynamic natives. + * + * @noreturn + */ +forward OnPluginCreated(); + +/** + * Called when the plugin is about to be unloaded. + * + * @noreturn + */ +forward OnPluginUnload(); + +/** + * Called when the plugin's pause status is changing. + * + * @noreturn + */ +forward OnPluginPauseChange(bool:pause); diff --git a/plugins/test.sma b/plugins/test.sma new file mode 100644 index 00000000..e0837709 --- /dev/null +++ b/plugins/test.sma @@ -0,0 +1,16 @@ +#include + +/** + * I don't know if I like this yet.... + */ +public String:PLUGIN_NAME[] = "Testcrab" +public String:PLUGIN_AUTHOR[] = "BAILOPAN" +public String:PLUGIN_VERSION[] = "0.0.0.0" +public String:PLUGIN_URL[] = "http://www.sourcemod.net/" +public String:PUBLIC_DESCRIPTION[] = "A test, fool" + +public OnPluginInit() +{ + /* just a test, mommy */ + return 5 +}