plugins/include/core.inc
author Scott Ehlert <ds@alliedmods.net>
Sun May 13 07:48:36 2007 +0000 (2007-05-13)
changeset 784 0ff19a8bd981
parent 696 d5cc8d0fa899
child 815 8946ca39d52b
permissions -rw-r--r--
amb283 - Renamed IsPlayerInGame() to IsClientInGame()
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  *  This file is part of the SourceMod/SourcePawn SDK.  This file may only be used 
     8  * or modified under the Terms and Conditions of its License Agreement, which is found 
     9  * in LICENSE.txt.  The Terms and Conditions for making SourceMod extensions/plugins 
    10  * may change at any time.  To view the latest information, see:
    11  *   http://www.sourcemod.net/license.php
    12  *
    13  * Version: $Id$
    14  */
    15 
    16 #if defined _core_included
    17  #endinput
    18 #endif
    19 #define _core_included
    20 
    21 #include <version>
    22 
    23 #define SOURCEMOD_PLUGINAPI_VERSION		2
    24 struct PlVers
    25 {
    26 	version,
    27 	String:filevers[],
    28 };
    29 
    30 /**
    31  * Function helper values.
    32  */
    33 enum Function
    34 {
    35      INVALID_FUNCTION = -1,
    36 };
    37 
    38 /**
    39  * Specifies what to do after a hook completes.
    40  */
    41 enum Action
    42 {
    43 	Plugin_Continue = 0,	/**< Continue with the original action */
    44 	Plugin_Handled = 3,		/**< Handle the action at the end (don't call it) */
    45 	Plugin_Stop = 4,		/**< Immediately stop the hook chain and handle the original */
    46 }
    47 
    48 public PlVers:__version = 
    49 {
    50 	version = SOURCEMOD_PLUGINAPI_VERSION,
    51 	filevers = SOURCEMOD_VERSION
    52 };
    53 
    54 /**
    55  * Plugin status values.
    56  */
    57 enum PluginStatus
    58 {
    59 	Plugin_Running=0,		/**< Plugin is running */
    60 	/* All states below are "temporarily" unexecutable */
    61 	Plugin_Paused,			/**< Plugin is loaded but paused */
    62 	Plugin_Error,			/**< Plugin is loaded but errored/locked */
    63 	/* All states below do not have all natives */
    64 	Plugin_Loaded,			/**< Plugin has passed loading and can be finalized */
    65 	Plugin_Failed,			/**< Plugin has a fatal failure */
    66 	Plugin_Created,			/**< Plugin is created but not initialized */
    67 	Plugin_Uncompiled,		/**< Plugin is not yet compiled by the JIT */
    68 	Plugin_BadLoad,			/**< Plugin failed to load */
    69 };
    70 
    71 /**
    72  * Plugin information properties.
    73  */
    74 enum PluginInfo
    75 {
    76 	PlInfo_Name,			/**< Plugin name */
    77 	PlInfo_Author,			/**< Plugin author */
    78 	PlInfo_Description,		/**< Plugin description */
    79 	PlInfo_Version,			/**< Plugin verison */
    80 	PlInfo_URL,				/**< Plugin URL */
    81 };
    82 
    83 /**
    84  * Defines how an extension must expose itself for autoloading.
    85  */
    86 struct Extension
    87 {
    88 	const String:name[],	/* Short name */
    89 	const String:file[],	/* Default file name */
    90 	bool:autoload,			/* Whether or not to auto-load */
    91 	bool:required,			/* Whether or not to require */
    92 };
    93 
    94 #define AUTOLOAD_EXTENSIONS
    95 #define REQUIRE_EXTENSIONS