plugins/include/sourcemod.inc
author David Anderson <dvander@alliedmods.net>
Fri Nov 10 07:49:38 2006 +0000 (2006-11-10)
changeset 172 d8a8186eccbf
parent 170 1280f15dce3a
child 212 d473435366b3
permissions -rw-r--r--
initial import of plugin loading code
little fixes to API
temporarily commented dependency iface until final
     1 /**
     2  * :TODO: license info
     3  */
     4 
     5 #if defined _sourcemod_included
     6  #endinput
     7 #endif
     8 #define _sourcemod_included
     9 
    10 struct Plugin
    11 {
    12    const String:name[],			/* Plugin Name */
    13    const String:description[],		/* Plugin Description */
    14    const String:author[],		/* Plugin Author */
    15    const String:version[],		/* Plugin Version */
    16    const String:url[],			/* Plugin URL */
    17 }
    18 
    19 /**
    20  * Declare this as a struct in your plugin to expose its information.
    21  * Example:
    22  *
    23  * public Plugin:myinfo =
    24  * {
    25  *    name = "My Plugin",
    26  *    //etc
    27  * };
    28  */
    29 public Plugin:myinfo;
    30  
    31 /**
    32  * Called when the plugin is fully initialized and all known external references are resolved,
    33  * such as dynamic natives.
    34  *
    35  * @noreturn
    36  */
    37 forward OnPluginInit();
    38  
    39 /**
    40  * Called before OnPluginInit, in case the plugin wants to check for load failure.
    41  *
    42  * @param myself	Handle to the plugin.
    43  * @param late		Whether or not the plugin was loaded "late" (after map load).
    44  * @param error		Error message buffer in case load failed.
    45  * @param err_max	Maximum number of characters for error message buffer.
    46  * @return		True if load success, false otherwise.
    47  */
    48 forward bool:OnPluginLoad(Handle:myself, bool:late, String:error[], err_max);
    49 
    50 /**
    51  * Called when the plugin is first mapped into memory.  Use this to set dynamic natives ONLY.
    52  *
    53  * @noreturn
    54  */
    55 forward OnCreatePlugin();
    56 
    57 /**
    58  * Called when the plugin is about to be unloaded.
    59  *
    60  * @noreturn
    61  */
    62 forward OnPluginUnload();
    63 
    64 /**
    65  * Called when the plugin's pause status is changing.
    66  *
    67  * @noreturn
    68  */
    69 forward OnPluginPauseChange(bool:pause);