Updated compiler and includes to version 1.3.4.

This commit is contained in:
Richard Helgeby
2010-07-25 20:58:18 +02:00
parent e6509e59a7
commit 038c03dbbe
32 changed files with 613 additions and 74 deletions
+98 -17
View File
@@ -74,6 +74,13 @@ struct Plugin
#include <commandfilters>
#include <nextmap>
enum APLRes
{
APLRes_Success = 0, /**< Plugin should load */
APLRes_Failure, /**< Plugin shouldn't load and should display an error */
APLRes_SilentFailure /**< Plugin shouldn't load but do so silently */
};
/**
* Declare this as a struct in your plugin to expose its information.
* Example:
@@ -101,26 +108,35 @@ public Plugin:myinfo;
* @noreturn
*/
forward OnPluginStart();
/**
* @deprecated Use AskPluginLoad2() instead.
* If a plugin contains both AskPluginLoad() and AskPluginLoad2(), the former will
* not be called, but old plugins with only AskPluginLoad() will work.
*/
#pragma deprecated Use AskPluginLoad2() instead
forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
/**
* Called before OnPluginStart, in case the plugin wants to check for load failure.
* This is called even if the plugin type is "private." Any natives from modules are
* not available at this point. Thus, this forward should only be used for explicit
* pre-emptive things, such as adding dynamic natives, or setting certain types of load filters.
* pre-emptive things, such as adding dynamic natives, setting certain types of load
* filters (such as not loading the plugin for certain games).
*
* @note It is not safe to call externally resolved natives until OnPluginStart().
* @note Any sort of RTE in this function will cause the plugin to fail loading.
* @note You MUST remember to return SOMETHING here. The act of not returning is
* equivalent to returning 0 (false). If you forgot to return, it will
* cause your plugin to not load with a very strange error message.
* @note If you do not return anything, it is treated like returning success.
* @note If a plugin has an AskPluginLoad2(), AskPluginLoad() will not be called.
*
*
* @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.
* @return APLRes_Success for load success, APLRes_Failure or APLRes_SilentFailure otherwise
*/
forward bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max);
forward APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max);
/**
* Called when the plugin is about to be unloaded.
@@ -394,16 +410,6 @@ native GetSysTickCount();
*/
native AutoExecConfig(bool:autoCreate=true, const String:name[]="", const String:folder[]="sourcemod");
/**
* Sets a native as optional, such that if it is unloaded, removed,
* or otherwise non-existent, the plugin will still work. Calling
* removed natives results in a run-time error.
*
* @param name Native name.
* @noreturn
*/
native MarkNativeAsOptional(const String:name[]);
/**
* Registers a library name for identifying as a dependency to
* other plugins.
@@ -549,6 +555,81 @@ forward bool:OnClientFloodCheck(client);
*/
forward OnClientFloodResult(client, bool:blocked);
/**
* Feature types.
*/
enum FeatureType
{
/**
* A native function call.
*/
FeatureType_Native,
/**
* A named capability. This is distinctly different from checking for a
* native, because the underlying functionality could be enabled on-demand
* to improve loading time. Thus a native may appear to exist, but it might
* be part of a set of features that are not compatible with the current game
* or version of SourceMod.
*/
FeatureType_Capability
};
/**
* Feature statuses.
*/
enum FeatureStatus
{
/**
* Feature is available for use.
*/
FeatureStatus_Available,
/**
* Feature is not available.
*/
FeatureStatus_Unavailable,
/**
* Feature is not known at all.
*/
FeatureStatus_Unknown
};
/**
* Returns whether "GetFeatureStatus" will work. Using this native
* or this function will not cause SourceMod to fail loading on older versions,
* however, GetFeatureStatus will only work if this function returns true.
*
* @return True if GetFeatureStatus will work, false otherwise.
*/
stock bool:CanTestFeatures()
{
return LibraryExists("__CanTestFeatures__");
}
/**
* Returns whether a feature exists, and if so, whether it is usable.
*
* @param type Feature type.
* @param name Feature name.
* @return Feature status.
*/
native FeatureStatus:GetFeatureStatus(FeatureType:type, const String:name[]);
/**
* Requires that a given feature is available. If it is not, SetFailState()
* is called with the given message.
*
* @param type Feature type.
* @param name Feature name.
* @param fmt Message format string, or empty to use default.
* @param ... Message format parameters, if any.
* @noreturn
*/
native RequireFeature(FeatureType:type, const String:name[],
const String:fmt[]="", any:...);
#include <helpers>
#include <entity>
#include <entity_prop_stocks>