imported new API for exposing plugin info

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40175
This commit is contained in:
David Anderson 2006-11-10 00:16:33 +00:00
parent f43b4468c6
commit c89dd6f101
2 changed files with 29 additions and 19 deletions

View File

@ -7,15 +7,26 @@
#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
*/
struct Plugin
{
const String:name[], /* Plugin Name */
const String:description[], /* Plugin Description */
const String:author[], /* Plugin Author */
const String:version[], /* Plugin Version */
const String:url[], /* Plugin URL */
}
/**
* Declare this as a struct in your plugin to expose its information.
* Example:
*
* public Plugin:myinfo =
* {
* name = "My Plugin",
* //etc
* };
*/
public Plugin:myinfo;
/**
* Called when the plugin is fully initialized and all known external references are resolved,
@ -37,11 +48,11 @@ forward OnPluginInit();
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.
* Called when the plugin is first mapped into memory. Use this to set dynamic natives ONLY.
*
* @noreturn
*/
forward OnPluginCreated();
forward OnPluginRequirements();
/**
* Called when the plugin is about to be unloaded.

View File

@ -1,16 +1,15 @@
#include <sourcemod>
/**
* 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 Plugin:myinfo
{
name = "Test Plugin",
author = "BAILOPAN",
description = "Tests Stuff",
version = "1.0.0.0",
url = "http://www.sourceomd.net/"
}
public OnPluginInit()
{
/* just a test, mommy */
return 5
}