diff --git a/plugins/include/admin.inc b/plugins/include/admin.inc index 07e08192..17d2c99b 100644 --- a/plugins/include/admin.inc +++ b/plugins/include/admin.inc @@ -234,7 +234,7 @@ methodmap AdminId { // @param maxlength Maximum size of the output name buffer. // Note: This will safely chop UTF-8 strings. // @return True if there was a password set, false otherwise. - public native bool GetPassword(char[] buffer="", maxlength=0); + public native bool GetPassword(char[] buffer="", int maxlength=0); // Tests whether one admin can target another. // @@ -584,7 +584,7 @@ native void SetAdminPassword(AdminId id, const char[] password); * Note: This will safely chop UTF-8 strings. * @return True if there was a password set, false otherwise. */ -native bool GetAdminPassword(AdminId id, char buffer[]="", int maxlength=0); +native bool GetAdminPassword(AdminId id, char[] buffer="", int maxlength=0); /** * Attempts to find an admin by an auth method and an identity. @@ -773,4 +773,3 @@ stock bool BitToFlag(int bit, AdminFlag &flag) return false; } - diff --git a/plugins/include/adminmenu.inc b/plugins/include/adminmenu.inc index f80586e2..a3cb6175 100644 --- a/plugins/include/adminmenu.inc +++ b/plugins/include/adminmenu.inc @@ -93,10 +93,10 @@ native TopMenu GetAdminTopMenu(); * @param alive_only True to only select alive players. * @return Number of clients added. */ -native AddTargetsToMenu(Handle:menu, - source_client, - bool:in_game_only=true, - bool:alive_only=false); +native int AddTargetsToMenu(Handle menu, + int source_client, + bool in_game_only=true, + bool alive_only=false); /** * Adds targets to an admin menu. @@ -109,7 +109,7 @@ native AddTargetsToMenu(Handle:menu, * @param flags COMMAND_FILTER flags from commandfilters.inc. * @return Number of clients added. */ -native AddTargetsToMenu2(Handle:menu, source_client, flags); +native int AddTargetsToMenu2(Handle menu, int source_client, int flags); /** * Re-displays the admin menu to a client after selecting an item. @@ -119,7 +119,7 @@ native AddTargetsToMenu2(Handle:menu, source_client, flags); * @param client Client index. * @return True on success, false on failure. */ -stock bool:RedisplayAdminMenu(Handle:topmenu, client) +stock bool RedisplayAdminMenu(Handle topmenu, int client) { if (topmenu == INVALID_HANDLE) { @@ -131,7 +131,7 @@ stock bool:RedisplayAdminMenu(Handle:topmenu, client) /* DO NOT EDIT BELOW THIS LINE */ -public SharedPlugin:__pl_adminmenu = +public SharedPlugin __pl_adminmenu = { name = "adminmenu", file = "adminmenu.smx", @@ -143,7 +143,7 @@ public SharedPlugin:__pl_adminmenu = }; #if !defined REQUIRE_PLUGIN -public __pl_adminmenu_SetNTVOptional() +public void __pl_adminmenu_SetNTVOptional() { MarkNativeAsOptional("GetAdminTopMenu"); MarkNativeAsOptional("AddTargetsToMenu"); diff --git a/plugins/include/adt_array.inc b/plugins/include/adt_array.inc index a2e3d6bc..778fd99c 100644 --- a/plugins/include/adt_array.inc +++ b/plugins/include/adt_array.inc @@ -42,7 +42,7 @@ * @param size Number of bytes. * @return Minimum number of cells required to fit the byte count. */ -stock ByteCountToCells(size) +stock int ByteCountToCells(int size) { if (!size) return 1; @@ -128,7 +128,7 @@ methodmap ArrayList < Handle { // @param maxlength Maximum size of the buffer. // @return Number of characters copied. // @error Invalid index. - public native int GetString(int index, char[] buffer, maxlength); + public native int GetString(int index, char[] buffer, int maxlength); // Retrieves an array of cells from an array. // @@ -256,10 +256,9 @@ native Handle CloneArray(Handle array); * * @param array Array Handle. * @param newsize New size. - * @noreturn * @error Invalid Handle or out of memory. */ -native bool ResizeArray(Handle array, int newsize); +native void ResizeArray(Handle array, int newsize); /** * Returns the array size. @@ -332,7 +331,7 @@ native any GetArrayCell(Handle array, int index, int block=0, bool asChar=false) * @return Number of characters copied. * @error Invalid Handle or invalid index. */ -native int GetArrayString(Handle array, int index, char[] buffer, maxlength); +native int GetArrayString(Handle array, int index, char[] buffer, int maxlength); /** * Retrieves an array of cells from an array. diff --git a/plugins/include/adt_stack.inc b/plugins/include/adt_stack.inc index f174696b..0ffdc86f 100644 --- a/plugins/include/adt_stack.inc +++ b/plugins/include/adt_stack.inc @@ -221,6 +221,6 @@ native bool IsStackEmpty(Handle stack); */ stock bool PopStack(Handle stack) { - new value; + int value; return PopStackCell(stack, value); } diff --git a/plugins/include/adt_trie.inc b/plugins/include/adt_trie.inc index d81f5f18..44548ab1 100644 --- a/plugins/include/adt_trie.inc +++ b/plugins/include/adt_trie.inc @@ -166,7 +166,7 @@ methodmap StringMapSnapshot < Handle * * @return New Map Handle, which must be freed via CloseHandle(). */ -native StringMap:CreateTrie(); +native StringMap CreateTrie(); /** * Sets a value in a hash map, either inserting a new entry or replacing an old one. @@ -261,7 +261,7 @@ native bool RemoveFromTrie(Handle map, const char[] key); * @param map Map Handle. * @error Invalid Handle. */ -native ClearTrie(Handle map); +native void ClearTrie(Handle map); /** * Retrieves the number of elements in a map. @@ -270,7 +270,7 @@ native ClearTrie(Handle map); * @return Number of elements in the trie. * @error Invalid Handle. */ -native GetTrieSize(Handle map); +native int GetTrieSize(Handle map); /** * Creates a snapshot of all keys in the map. If the map is changed after this @@ -291,7 +291,7 @@ native Handle CreateTrieSnapshot(Handle map); * @return Number of keys. * @error Invalid Handle. */ -native TrieSnapshotLength(Handle snapshot); +native int TrieSnapshotLength(Handle snapshot); /** * Returns the buffer size required to store a given key. That is, it returns @@ -302,7 +302,7 @@ native TrieSnapshotLength(Handle snapshot); * @return Buffer size required to store the key string. * @error Invalid Handle or index out of range. */ -native TrieSnapshotKeyBufferSize(Handle snapshot, int index); +native int TrieSnapshotKeyBufferSize(Handle snapshot, int index); /** * Retrieves the key string of a given key in a map snapshot. @@ -314,4 +314,4 @@ native TrieSnapshotKeyBufferSize(Handle snapshot, int index); * @return Number of bytes written to the buffer. * @error Invalid Handle or index out of range. */ -native GetTrieSnapshotKey(Handle snapshot, int index, char[] buffer, int maxlength); +native int GetTrieSnapshotKey(Handle snapshot, int index, char[] buffer, int maxlength); diff --git a/plugins/include/basecomm.inc b/plugins/include/basecomm.inc index 139b8241..54545c89 100644 --- a/plugins/include/basecomm.inc +++ b/plugins/include/basecomm.inc @@ -41,7 +41,7 @@ * @param client Client index * @param muteState True if client was muted, false otherwise */ - forward void BaseComm_OnClientMute(client, bool:muteState); + forward void BaseComm_OnClientMute(int client, bool muteState); /** * Called when a client is gagged or ungagged @@ -49,7 +49,7 @@ * @param client Client index * @param gagState True if client was gaged, false otherwise */ - forward void BaseComm_OnClientGag(client, bool:gagState); + forward void BaseComm_OnClientGag(int client, bool gagState); /** * Returns whether or not a client is gagged @@ -57,7 +57,7 @@ * @param client Client index. * @return True if client is gagged, false otherwise. */ -native bool:BaseComm_IsClientGagged(client); +native bool BaseComm_IsClientGagged(int client); /** * Returns whether or not a client is muted @@ -65,7 +65,7 @@ native bool:BaseComm_IsClientGagged(client); * @param client Client index. * @return True if client is muted, false otherwise. */ -native bool:BaseComm_IsClientMuted(client); +native bool BaseComm_IsClientMuted(int client); /** * Sets a client's gag state @@ -74,7 +74,7 @@ native bool:BaseComm_IsClientMuted(client); * @param gagState True to gag client, false to ungag. * @return True if this caused a change in gag state, false otherwise. */ -native bool:BaseComm_SetClientGag(client, bool:gagState); +native bool BaseComm_SetClientGag(int client, bool gagState); /** * Sets a client's mute state @@ -83,11 +83,11 @@ native bool:BaseComm_SetClientGag(client, bool:gagState); * @param muteState True to mute client, false to unmute. * @return True if this caused a change in mute state, false otherwise. */ -native bool:BaseComm_SetClientMute(client, bool:muteState); +native bool BaseComm_SetClientMute(int client, bool muteState); /* DO NOT EDIT BELOW THIS LINE */ -public SharedPlugin:__pl_basecomm = +public SharedPlugin __pl_basecomm = { name = "basecomm", file = "basecomm.smx", @@ -99,7 +99,7 @@ public SharedPlugin:__pl_basecomm = }; #if !defined REQUIRE_PLUGIN -public __pl_basecomm_SetNTVOptional() +public void __pl_basecomm_SetNTVOptional() { MarkNativeAsOptional("BaseComm_IsClientGagged"); MarkNativeAsOptional("BaseComm_IsClientMuted"); diff --git a/plugins/include/bitbuffer.inc b/plugins/include/bitbuffer.inc index 08510c12..1de58a56 100644 --- a/plugins/include/bitbuffer.inc +++ b/plugins/include/bitbuffer.inc @@ -312,7 +312,6 @@ native void BfWriteVecCoord(Handle bf, float coord[3]); * * @param bf bf_write handle to write to. * @param vec Vector to write. - * @noreturn * @error Invalid or incorrect Handle. */ native void BfWriteVecNormal(Handle bf, float vec[3]); diff --git a/plugins/include/clientprefs.inc b/plugins/include/clientprefs.inc index 62b20ff8..bdd6e53f 100644 --- a/plugins/include/clientprefs.inc +++ b/plugins/include/clientprefs.inc @@ -95,7 +95,7 @@ enum CookieMenuAction * exists, a handle to it will still be returned. * @error Cookie name is blank. */ -native Handle:RegClientCookie(const String:name[], const String:description[], CookieAccess:access); +native Handle RegClientCookie(const char[] name, const char[] description, CookieAccess access); /** * Searches for a Client preference cookie. @@ -106,7 +106,7 @@ native Handle:RegClientCookie(const String:name[], const String:description[], C * @param name Name of cookie to find. * @return A handle to the cookie if it is found. INVALID_HANDLE otherwise. */ -native Handle:FindClientCookie(const String:name[]); +native Handle FindClientCookie(const char[] name); /** * Set the value of a Client preference cookie. @@ -114,10 +114,9 @@ native Handle:FindClientCookie(const String:name[]); * @param client Client index. * @param cookie Client preference cookie handle. * @param value String value to set. - * @noreturn * @error Invalid cookie handle or invalid client index. */ -native SetClientCookie(client, Handle:cookie, const String:value[]); +native void SetClientCookie(int client, Handle cookie, const char[] value); /** * Retrieve the value of a Client preference cookie. @@ -126,10 +125,9 @@ native SetClientCookie(client, Handle:cookie, const String:value[]); * @param cookie Client preference cookie handle. * @param buffer Copyback buffer for value. * @param maxlen Maximum length of the buffer. - * @noreturn * @error Invalid cookie handle or invalid client index. */ -native GetClientCookie(client, Handle:cookie, String:buffer[], maxlen); +native void GetClientCookie(int client, Handle cookie, char[] buffer, int maxlen); /** * Sets the value of a Client preference cookie based on an authID string. @@ -137,10 +135,9 @@ native GetClientCookie(client, Handle:cookie, String:buffer[], maxlen); * @param authID String Auth/STEAM ID of player to set. * @param cookie Client preference cookie handle. * @param value String value to set. - * @noreturn * @error Invalid cookie handle. */ -native SetAuthIdCookie(const String:authID[], Handle:cookie, const String:value[]); +native void SetAuthIdCookie(const char[] authID, Handle cookie, const char[] value); /** * Checks if a clients cookies have been loaded from the database. @@ -149,14 +146,14 @@ native SetAuthIdCookie(const String:authID[], Handle:cookie, const String:value[ * @return True if loaded, false otherwise. * @error Invalid client index. */ -native bool:AreClientCookiesCached(client); +native bool AreClientCookiesCached(int client); /** * Called once a client's saved cookies have been loaded from the database. * * @param client Client index. */ -forward void OnClientCookiesCached(client); +forward void OnClientCookiesCached(int client); /** * Cookie Menu Callback prototype @@ -166,7 +163,6 @@ forward void OnClientCookiesCached(client); * @param info Info data passed. * @param buffer Outbut buffer. * @param maxlen Max length of the output buffer. - * @noreturn */ typedef CookieMenuHandler = function void ( int client, @@ -186,10 +182,9 @@ typedef CookieMenuHandler = function void ( * @param display Text to show on the menu. * @param handler Optional handler callback for translations and output on selection * @param info Info data to pass to the callback. - * @noreturn * @error Invalid cookie handle. */ -native SetCookiePrefabMenu(Handle:cookie, CookieMenu:type, const String:display[], CookieMenuHandler:handler=INVALID_FUNCTION, info=0); +native void SetCookiePrefabMenu(Handle cookie, CookieMenu type, const char[] display, CookieMenuHandler handler=INVALID_FUNCTION, any info=0); /** * Adds a new item to the client cookie settings menu. @@ -199,25 +194,23 @@ native SetCookiePrefabMenu(Handle:cookie, CookieMenu:type, const String:display[ * @param handler A MenuHandler callback function. * @param info Data to pass to the callback. * @param display Text to show on the menu. - * @noreturn * @error Invalid cookie handle. */ -native SetCookieMenuItem(CookieMenuHandler:handler, any:info, const String:display[]); +native void SetCookieMenuItem(CookieMenuHandler handler, any info, const char[] display); /** * Displays the settings menu to a client. * * @param client Client index. - * @noreturn */ -native ShowCookieMenu(client); +native void ShowCookieMenu(int client); /** * Gets a cookie iterator. Must be freed with CloseHandle(). * * @return A new cookie iterator. */ -native Handle:GetCookieIterator(); +native Handle GetCookieIterator(); /** * Reads a cookie iterator, then advances to the next cookie if any. @@ -230,12 +223,12 @@ native Handle:GetCookieIterator(); * @param descLen Cookie description buffer size. * @return True on success, false if there are no more commands. */ -native bool:ReadCookieIterator(Handle:iter, - String:name[], - nameLen, - &CookieAccess:access, - String:desc[]="", - descLen=0); +native bool ReadCookieIterator(Handle iter, + char[] name, + int nameLen, + CookieAccess &access, + char[] desc="", + int descLen=0); /** * Returns the access level of a cookie @@ -244,7 +237,7 @@ native bool:ReadCookieIterator(Handle:iter, * @return CookieAccess access level. * @error Invalid cookie handle. */ -native CookieAccess:GetCookieAccess(Handle:cookie); +native CookieAccess GetCookieAccess(Handle cookie); /** * Returns the last updated timestamp for a client cookie @@ -253,12 +246,12 @@ native CookieAccess:GetCookieAccess(Handle:cookie); * @param cookie Cookie handle. * @return Last updated timestamp. */ -native GetClientCookieTime(client, Handle:cookie); +native int GetClientCookieTime(int client, Handle cookie); /** * Do not edit below this line! */ -public Extension:__ext_cprefs = +public Extension __ext_cprefs = { name = "Client Preferences", file = "clientprefs.ext", @@ -271,7 +264,7 @@ public Extension:__ext_cprefs = }; #if !defined REQUIRE_EXTENSIONS -public __ext_cprefs_SetNTVOptional() +public void __ext_cprefs_SetNTVOptional() { MarkNativeAsOptional("RegClientCookie"); MarkNativeAsOptional("FindClientCookie"); diff --git a/plugins/include/commandfilters.inc b/plugins/include/commandfilters.inc index 32e3d9c6..67e1e5c7 100644 --- a/plugins/include/commandfilters.inc +++ b/plugins/include/commandfilters.inc @@ -75,14 +75,14 @@ * if one valid client is found. Otherwise, a COMMAND_TARGET reason * for failure is returned. */ -native ProcessTargetString(const String:pattern[], - admin, - targets[], - max_targets, - filter_flags, - String:target_name[], - tn_maxlength, - &bool:tn_is_ml); +native int ProcessTargetString(const char[] pattern, + int admin, + int[] targets, + int max_targets, + int filter_flags, + char[] target_name, + int tn_maxlength, + bool &tn_is_ml); /** * Replies to a client with a given message describing a targetting @@ -92,9 +92,8 @@ native ProcessTargetString(const String:pattern[], * * @param client Client index, or 0 for server. * @param reason COMMAND_TARGET reason. - * @noreturn */ -stock ReplyToTargetError(client, reason) +stock void ReplyToTargetError(int client, int reason) { switch (reason) { @@ -149,17 +148,14 @@ typedef MultiTargetFilter = function bool (const char[] pattern, Handle clients) * @param filter Filter function. * @param phrase Descriptive phrase to display on successful match. * @param phraseIsML True if phrase is multi-lingual, false otherwise. - * @noreturn */ -native AddMultiTargetFilter(const String:pattern[], MultiTargetFilter:filter, - const String:phrase[], bool:phraseIsML); +native void AddMultiTargetFilter(const char[] pattern, MultiTargetFilter filter, + const char[] phrase, bool phraseIsML); /** * Removes a multi-target filter function from ProcessTargetString(). * * @param pattern Pattern to match (case sensitive). * @param filter Filter function. - * @noreturn */ -native RemoveMultiTargetFilter(const String:pattern[], MultiTargetFilter:filter); - +native void RemoveMultiTargetFilter(const char[] pattern, MultiTargetFilter filter); diff --git a/plugins/include/commandline.inc b/plugins/include/commandline.inc index 291a8b6f..5ff7d227 100644 --- a/plugins/include/commandline.inc +++ b/plugins/include/commandline.inc @@ -43,7 +43,7 @@ * @return True if the command line is valid; otherwise, false. * @error No command line available, or no mod support. */ -native bool:GetCommandLine(String:commandLine[], maxlen); +native bool GetCommandLine(char[] commandLine, int maxlen); /** * Gets the value of a command line parameter the server was launched with. @@ -52,10 +52,9 @@ native bool:GetCommandLine(String:commandLine[], maxlen); * @param value Buffer to store the parameter value in. * @param maxlen Maximum length of the value buffer. * @param defValue The default value to return if the parameter wasn't specified. - * @return True if the command line is valid; otherwise, false. * @error No command line available, or no mod support. */ -native GetCommandLineParam(const String:param[], String:value[], maxlen, const String:defValue[]=""); +native void GetCommandLineParam(const char[] param, char[] value, int maxlen, const char[] defValue=""); /** * Gets the value of a command line parameter the server was launched with. @@ -65,7 +64,7 @@ native GetCommandLineParam(const String:param[], String:value[], maxlen, const S * @return The integer value of the command line parameter value. * @error No command line available, or no mod support. */ -native GetCommandLineParamInt(const String:param[], defValue=0); +native int GetCommandLineParamInt(const char[] param, int defValue=0); /** * Gets the value of a command line parameter the server was launched with. @@ -75,7 +74,7 @@ native GetCommandLineParamInt(const String:param[], defValue=0); * @return The floating point value of the command line parameter value. * @error No command line available, or no mod support. */ -native Float:GetCommandLineParamFloat(const String:param[], Float:defValue=0.0); +native float GetCommandLineParamFloat(const char[] param, float defValue=0.0); /** * Determines if a specific command line parameter is present. @@ -84,4 +83,4 @@ native Float:GetCommandLineParamFloat(const String:param[], Float:defValue=0.0); * @return True if the command line parameter is specified; otherwise, false. * @error No command line available, or no mod support. */ -native bool:FindCommandLineParam(const String:param[]); +native bool FindCommandLineParam(const char[] param); diff --git a/plugins/include/convars.inc b/plugins/include/convars.inc index 3dba68b4..6896ce12 100644 --- a/plugins/include/convars.inc +++ b/plugins/include/convars.inc @@ -216,7 +216,7 @@ methodmap ConVar < Handle // // @param name Buffer to store the name of the convar. // @param maxlength Maximum length of string buffer. - public native void GetName(char[] name, maxlength); + public native void GetName(char[] name, int maxlength); // Replicates a convar value to a specific client. This does not change the actual convar value. // @@ -405,7 +405,7 @@ native int GetConVarFlags(Handle convar); * @param flags A bitstring containing the FCVAR_* flags to enable. * @error Invalid or corrupt Handle. */ -native void SetConVarFlags(Handle convar, flags); +native void SetConVarFlags(Handle convar, int flags); /** * Retrieves the specified bound of a console variable. @@ -437,7 +437,7 @@ native void SetConVarBounds(Handle convar, ConVarBounds type, bool set, float va * @param maxlength Maximum length of string buffer. * @error Invalid or corrupt Handle. */ -native void GetConVarName(Handle convar, char[] name, maxlength); +native void GetConVarName(Handle convar, char[] name, int maxlength); /** * Replicates a convar value to a specific client. This does not change the actual convar value. diff --git a/plugins/include/core.inc b/plugins/include/core.inc index f859ab9c..315f79de 100644 --- a/plugins/include/core.inc +++ b/plugins/include/core.inc @@ -69,7 +69,7 @@ enum Identity Identity_Plugin = 2 }; -public PlVers:__version = +public PlVers __version = { version = SOURCEMOD_PLUGINAPI_VERSION, filevers = SOURCEMOD_VERSION, @@ -99,7 +99,7 @@ enum PluginStatus * Plugin information properties. Plugins can declare a global variable with * their info. Example, * - * public Plugin:myinfo = { + * public Plugin myinfo = { * name = "Admin Help", * author = "AlliedModders LLC", * description = "Display command information", @@ -140,13 +140,13 @@ struct SharedPlugin public bool required; /**< Whether or not to require */ }; -public Float:NULL_VECTOR[3]; /**< Pass this into certain functions to act as a C++ NULL */ -public const String:NULL_STRING[1]; /**< pass this into certain functions to act as a C++ NULL */ +public float NULL_VECTOR[3]; /**< Pass this into certain functions to act as a C++ NULL */ +public const char NULL_STRING[1]; /**< pass this into certain functions to act as a C++ NULL */ /** * Horrible compatibility shim. */ -public Extension:__ext_core = +public Extension __ext_core = { name = "Core", file = "core", @@ -154,7 +154,7 @@ public Extension:__ext_core = required = 0, }; -native VerifyCoreVersion(); +native int VerifyCoreVersion(); /** * Sets a native as optional, such that if it is unloaded, removed, @@ -162,11 +162,10 @@ native VerifyCoreVersion(); * removed natives results in a run-time error. * * @param name Native name. - * @noreturn */ -native MarkNativeAsOptional(const String:name[]); +native void MarkNativeAsOptional(const char[] name); -public __ext_core_SetNTVOptional() +public void __ext_core_SetNTVOptional() { MarkNativeAsOptional("GetFeatureStatus"); MarkNativeAsOptional("RequireFeature"); diff --git a/plugins/include/datapack.inc b/plugins/include/datapack.inc index a280d8e0..c3a3749c 100644 --- a/plugins/include/datapack.inc +++ b/plugins/include/datapack.inc @@ -81,7 +81,7 @@ methodmap DataPack < Handle // // @param buffer Destination string buffer. // @param maxlen Maximum length of output string buffer. - public native void ReadString(char[] buffer, maxlen); + public native void ReadString(char[] buffer, int maxlen); // Reads a function pointer from a data pack. // @@ -118,7 +118,6 @@ native DataPack CreateDataPack(); * * @param pack Handle to the data pack. * @param cell Cell to add. - * @noreturn * @error Invalid handle. */ native void WritePackCell(Handle pack, any cell); @@ -128,7 +127,6 @@ native void WritePackCell(Handle pack, any cell); * * @param pack Handle to the data pack. * @param val Float to add. - * @noreturn * @error Invalid handle. */ native void WritePackFloat(Handle pack, float val); @@ -138,7 +136,6 @@ native void WritePackFloat(Handle pack, float val); * * @param pack Handle to the data pack. * @param str String to add. - * @noreturn * @error Invalid handle. */ native void WritePackString(Handle pack, const char[] str); @@ -148,7 +145,6 @@ native void WritePackString(Handle pack, const char[] str); * * @param pack Handle to the data pack. * @param fktptr Function pointer to add. - * @noreturn * @error Invalid handle. */ native void WritePackFunction(Handle pack, Function fktptr); @@ -177,10 +173,9 @@ native float ReadPackFloat(Handle pack); * @param pack Handle to the data pack. * @param buffer Destination string buffer. * @param maxlen Maximum length of output string buffer. - * @noreturn * @error Invalid handle, or bounds error. */ -native void ReadPackString(Handle pack, char[] buffer, maxlen); +native void ReadPackString(Handle pack, char[] buffer, int maxlen); /** * Reads a function pointer from a data pack. @@ -196,7 +191,6 @@ native Function ReadPackFunction(Handle pack); * * @param pack Handle to the data pack. * @param clear If true, clears the contained data. - * @noreturn * @error Invalid handle. */ native void ResetPack(Handle pack, bool clear=false); @@ -215,7 +209,6 @@ native DataPackPos GetPackPosition(Handle pack); * * @param pack Handle to the data pack. * @param position New position to set. Must have been previously retrieved from a call to GetPackPosition. - * @noreturn * @error Invalid handle, or position is beyond the pack bounds. */ native void SetPackPosition(Handle pack, DataPackPos position); @@ -230,4 +223,3 @@ native void SetPackPosition(Handle pack, DataPackPos position); * @error Invalid handle. */ native bool IsPackReadable(Handle pack, int bytes); - diff --git a/plugins/include/dbi.inc b/plugins/include/dbi.inc index ccfc4016..1095f450 100644 --- a/plugins/include/dbi.inc +++ b/plugins/include/dbi.inc @@ -411,8 +411,8 @@ methodmap Database < Handle // @param data An optional value to pass to callbacks. // @param prio Priority queue to use. public native void Execute(Transaction txn, - SQLTxnSuccess:onSuccess = INVALID_FUNCTION, - SQLTxnFailure:onError = INVALID_FUNCTION, + SQLTxnSuccess onSuccess = INVALID_FUNCTION, + SQLTxnFailure onError = INVALID_FUNCTION, any data = 0, DBPriority priority = DBPrio_Normal); }; @@ -467,7 +467,7 @@ stock Database SQL_DefConnect(char[] error, int maxlength, bool persistent=true) */ native Database SQL_ConnectCustom(Handle keyvalues, char[] error, - maxlength, + int maxlength, bool persistent); /** @@ -487,9 +487,9 @@ native Database SQL_ConnectCustom(Handle keyvalues, */ stock Database SQLite_UseDatabase(const char[] database, char[] error, - maxlength) + int maxlength) { - KeyValues kv = CreateKeyValues(""); + KeyValues kv = new KeyValues(""); kv.SetString("driver", "sqlite"); kv.SetString("database", database); @@ -505,15 +505,15 @@ stock Database SQLite_UseDatabase(const char[] database, */ #pragma deprecated Use SQL_ConnectCustom instead. native Handle SQL_ConnectEx(Handle driver, - const String:host[], - const String:user[], - const String:pass[], - const String:database[], + const char[] host, + const char[] user, + const char[] pass, + const char[] database, char[] error, - maxlength, + int maxlength, bool persistent=true, - port=0, - maxTimeout=0); + int port=0, + int maxTimeout=0); /** * Returns if a named configuration is present in databases.cfg. @@ -543,7 +543,7 @@ native Handle SQL_GetDriver(const char[] name=""); * @param ident_length Maximum length of the buffer. * @return Driver Handle. */ -native Handle SQL_ReadDriver(Handle database, char[] ident="", ident_length=0); +native Handle SQL_ReadDriver(Handle database, char[] ident="", int ident_length=0); /** * Retrieves a driver's identification string. @@ -553,7 +553,6 @@ native Handle SQL_ReadDriver(Handle database, char[] ident="", ident_length=0); * @param driver Driver Handle, or INVALID_HANDLE for the default driver. * @param ident Identification string buffer. * @param maxlength Maximum length of the buffer. - * @noreturn * @error Invalid Handle other than INVALID_HANDLE. */ native void SQL_GetDriverIdent(Handle driver, char[] ident, int maxlength); @@ -566,7 +565,6 @@ native void SQL_GetDriverIdent(Handle driver, char[] ident, int maxlength); * @param driver Driver Handle, or INVALID_HANDLE for the default driver. * @param product Product string buffer. * @param maxlength Maximum length of the buffer. - * @noreturn * @error Invalid Handle other than INVALID_HANDLE. */ native void SQL_GetDriverProduct(Handle driver, char[] product, int maxlength); @@ -648,8 +646,8 @@ native bool SQL_EscapeString(Handle database, stock bool SQL_QuoteString(Handle database, const char[] string, char[] buffer, - maxlength, - &written=0) + int maxlength, + int &written=0) { return SQL_EscapeString(database, string, buffer, maxlength, written); } @@ -754,7 +752,7 @@ native int SQL_GetFieldCount(Handle query); * @error Invalid query Handle, invalid field index, or * no current result set. */ -native void SQL_FieldNumToName(Handle query, int field, String:name[], int maxlength); +native void SQL_FieldNumToName(Handle query, int field, char[] name, int maxlength); /** * Retrieves a field index by name. @@ -765,7 +763,7 @@ native void SQL_FieldNumToName(Handle query, int field, String:name[], int maxle * @return True if found, false if not found. * @error Invalid query Handle or no current result set. */ -native bool SQL_FieldNameToNum(Handle query, const char[] name, &field); +native bool SQL_FieldNameToNum(Handle query, const char[] name, int &field); /** * Fetches a row from the current result set. This must be @@ -813,7 +811,7 @@ native bool SQL_Rewind(Handle query); * type conversion requested from the database, * or no current result set. */ -native int SQL_FetchString(Handle query, int field, char[] buffer, int maxlength, DBResult &result=DBVal_Error); +native int SQL_FetchString(Handle query, int field, char[] buffer, int maxlength, DBResult &result=DBVal_Error); /** * Fetches a float from a field in the current row of a result set. @@ -1034,13 +1032,12 @@ native int SQL_AddQuery(Transaction txn, const char[] query, any data=0); * @param onError An optional callback to receive an error message. * @param data An optional value to pass to callbacks. * @param prio Priority queue to use. - * @noreturn * @error An invalid handle. */ native SQL_ExecuteTransaction( Handle db, - Transaction:txn, - SQLTxnSuccess:onSuccess = INVALID_FUNCTION, - SQLTxnFailure:onError = INVALID_FUNCTION, + Transaction txn, + SQLTxnSuccess onSuccess = INVALID_FUNCTION, + SQLTxnFailure onError = INVALID_FUNCTION, any data=0, - DBPriority:priority=DBPrio_Normal); + DBPriority priority=DBPrio_Normal); diff --git a/plugins/include/events.inc b/plugins/include/events.inc index 18c11e44..d7d799a1 100644 --- a/plugins/include/events.inc +++ b/plugins/include/events.inc @@ -66,7 +66,6 @@ typeset EventHook // this event has set the hook mode EventHookMode_PostNoCopy. // @param name String containing the name of the event. // @param dontBroadcast True if event was not broadcast to clients, false otherwise. - // @noreturn /// function void (Event event, const char[] name, bool dontBroadcast); }; @@ -170,7 +169,6 @@ methodmap Event < Handle * @param name Name of event. * @param callback An EventHook function pointer. * @param mode Optional EventHookMode determining the type of hook. - * @noreturn * @error Invalid event name or invalid callback function. */ native void HookEvent(const char[] name, EventHook callback, EventHookMode mode=EventHookMode_Post); @@ -192,7 +190,6 @@ native bool HookEventEx(const char[] name, EventHook callback, EventHookMode mod * @param name Name of event. * @param callback An EventHook function pointer. * @param mode Optional EventHookMode determining the type of hook. - * @noreturn * @error Invalid callback function or no active hook for specified event. */ native void UnhookEvent(const char[] name, EventHook callback, EventHookMode mode=EventHookMode_Post); @@ -218,7 +215,6 @@ native Event CreateEvent(const char[] name, bool force=false); * * @param event Handle to the event. * @param dontBroadcast Optional boolean that determines if event should be broadcast to clients. - * @noreturn * @error Invalid or corrupt Handle. */ native void FireEvent(Handle event, bool dontBroadcast=false); @@ -227,7 +223,6 @@ native void FireEvent(Handle event, bool dontBroadcast=false); * Cancels a previously created game event that has not been fired. * * @param event Handled to the event. - * @noreturn * @error Invalid or corrupt Handle. */ native void CancelCreatedEvent(Handle event); @@ -249,7 +244,6 @@ native bool GetEventBool(Handle event, const char[] key, bool defValue=false); * @param event Handle to the event. * @param key Name of event key. * @param value New boolean value. - * @noreturn * @error Invalid or corrupt Handle. */ native void SetEventBool(Handle event, const char[] key, bool value); @@ -276,7 +270,6 @@ native int GetEventInt(Handle event, const char[] key, int defValue=0); * @param event Handle to the event. * @param key Name of event key. * @param value New integer value. - * @noreturn * @error Invalid or corrupt Handle. */ native void SetEventInt(Handle event, const char[] key, int value); @@ -298,7 +291,6 @@ native float GetEventFloat(Handle event, const char[] key, float defValue=0.0); * @param event Handle to the event. * @param key Name of event key. * @param value New floating point value. - * @noreturn * @error Invalid or corrupt Handle. */ native void SetEventFloat(Handle event, const char[] key, float value); @@ -311,7 +303,6 @@ native void SetEventFloat(Handle event, const char[] key, float value); * @param value Buffer to store the value of the specified event key. * @param maxlength Maximum length of string buffer. * @param defValue Optional default value to use if the key is not found. - * @noreturn * @error Invalid or corrupt Handle. */ native void GetEventString(Handle event, const char[] key, char[] value, int maxlength, const char[] defvalue=""); @@ -322,7 +313,6 @@ native void GetEventString(Handle event, const char[] key, char[] value, int max * @param event Handle to the event. * @param key Name of event key. * @param value New string value. - * @noreturn * @error Invalid or corrupt Handle. */ native void SetEventString(Handle event, const char[] key, const char[] value); @@ -333,7 +323,6 @@ native void SetEventString(Handle event, const char[] key, const char[] value); * @param event Handle to the event. * @param name Buffer to store the name of the event. * @param maxlength Maximum length of string buffer. - * @noreturn * @error Invalid or corrupt Handle. */ native void GetEventName(Handle event, char[] name, int maxlength); @@ -346,7 +335,6 @@ native void GetEventName(Handle event, char[] name, int maxlength); * * @param event Handle to an event from an event hook. * @param dontBroadcast True to disable broadcasting, false otherwise. - * @noreturn * @error Invalid Handle. */ native void SetEventBroadcast(Handle event, bool dontBroadcast); diff --git a/plugins/include/files.inc b/plugins/include/files.inc index 23a52c01..9111ac78 100644 --- a/plugins/include/files.inc +++ b/plugins/include/files.inc @@ -55,7 +55,7 @@ /** * File inode types. */ -enum FileType: +enum FileType { FileType_Unknown = 0, /* Unknown file type (device/socket) */ FileType_Directory = 1, /* File is a directory */ @@ -65,7 +65,7 @@ enum FileType: /** * File time modes. */ -enum FileTimeMode: +enum FileTimeMode { FileTime_LastAccess = 0, /* Last access (does not work on FAT) */ FileTime_Created = 1, /* Creation (does not work on FAT) */ @@ -81,7 +81,7 @@ enum FileTimeMode: /** * Path types. */ -enum PathType: +enum PathType { Path_SM, /**< SourceMod root folder */ }; @@ -167,7 +167,7 @@ methodmap File < Handle // @param format Formatting rules. // @param ... Variable number of format parameters. // @return True on success, false otherwise. - public native bool WriteLine(const char[] format, any:...); + public native bool WriteLine(const char[] format, any ...); // Reads a single int8 (byte) from a file. The returned value is sign- // extended to an int32. @@ -251,7 +251,7 @@ methodmap File < Handle * @param ... Format arguments. * @return Number of bytes written to buffer (not including null terminator). */ -native int BuildPath(PathType type, char[] buffer, int maxlength, const char[] fmt, any:...); +native int BuildPath(PathType type, char[] buffer, int maxlength, const char[] fmt, any ...); /** * Opens a directory/folder for contents enumeration. @@ -409,7 +409,7 @@ native bool WriteFileString(Handle hndl, const char[] buffer, bool term); * @return True on success, false otherwise. * @error Invalid Handle. */ -native bool WriteFileLine(Handle hndl, const char[] format, any:...); +native bool WriteFileLine(Handle hndl, const char[] format, any ...); /** * Reads a single binary cell from a file. @@ -584,7 +584,7 @@ native bool CreateDirectory(const char[] path, int mode, bool use_valve_fs=false * @param mode Permissions to set. * @return True on success, false otherwise. */ -native bool SetFilePermissions(const String:path[], int mode); +native bool SetFilePermissions(const char[] path, int mode); /** * Returns a file timestamp as a unix timestamp. @@ -604,7 +604,7 @@ native GetFileTime(const char[] file, FileTimeMode tmode); * @param ... Message format parameters. * @error Invalid Handle. */ -native void LogToOpenFile(Handle hndl, const char[] message, any:...); +native void LogToOpenFile(Handle hndl, const char[] message, any ...); /** * Same as LogToFileEx(), except uses an open file Handle. The file must @@ -615,5 +615,4 @@ native void LogToOpenFile(Handle hndl, const char[] message, any:...); * @param ... Message format parameters. * @error Invalid Handle. */ -native void LogToOpenFileEx(Handle hndl, const char[] message, any:...); - +native void LogToOpenFileEx(Handle hndl, const char[] message, any ...); diff --git a/plugins/include/geoip.inc b/plugins/include/geoip.inc index 14ede1fb..57d0862d 100644 --- a/plugins/include/geoip.inc +++ b/plugins/include/geoip.inc @@ -48,7 +48,7 @@ * @param ccode Destination string buffer to store the code. * @return True on success, false if no country found. */ -native bool:GeoipCode2(const String:ip[], String:ccode[3]); +native bool GeoipCode2(const char[] ip, char ccode[3]); /** * Gets the three character country code from an IP address. (USA, CAN, etc) @@ -57,7 +57,7 @@ native bool:GeoipCode2(const String:ip[], String:ccode[3]); * @param ccode Destination string buffer to store the code. * @return True on success, false if no country found. */ -native bool:GeoipCode3(const String:ip[], String:ccode[4]); +native bool GeoipCode3(const char[] ip, char ccode[4]); /** * Gets the full country name. (max length of output string is 45) @@ -67,7 +67,7 @@ native bool:GeoipCode3(const String:ip[], String:ccode[4]); * @param maxlength Maximum length of output string buffer. * @return True on success, false if no country found. */ -native bool:GeoipCountry(const String:ip[], String:name[], maxlength); +native bool GeoipCountry(const char[] ip, char[] name, int maxlength); /** * @endsection @@ -76,7 +76,7 @@ native bool:GeoipCountry(const String:ip[], String:name[], maxlength); /** * Do not edit below this line! */ -public Extension:__ext_geoip = +public Extension __ext_geoip = { name = "GeoIP", file = "geoip.ext", @@ -93,7 +93,7 @@ public Extension:__ext_geoip = }; #if !defined REQUIRE_EXTENSIONS -public __ext_geoip_SetNTVOptional() +public void __ext_geoip_SetNTVOptional() { MarkNativeAsOptional("GeoipCode2"); MarkNativeAsOptional("GeoipCode3"); diff --git a/plugins/include/handles.inc b/plugins/include/handles.inc index ece25b5d..c7d5992f 100644 --- a/plugins/include/handles.inc +++ b/plugins/include/handles.inc @@ -38,7 +38,7 @@ /** * Preset Handle values. */ -enum Handle: // Tag disables introducing "Handle" as a symbol. +enum Handle // Tag disables introducing "Handle" as a symbol. { INVALID_HANDLE = 0, }; @@ -54,7 +54,7 @@ enum Handle: // Tag disables introducing "Handle" as a symbol. * @param hndl Handle to close. * @error Invalid handles will cause a run time error. */ -native CloseHandle(Handle:hndl); +native void CloseHandle(Handle hndl); /** * Clones a Handle. When passing handles in between plugins, caching handles @@ -73,7 +73,7 @@ native CloseHandle(Handle:hndl); * @return Handle on success, INVALID_HANDLE if not cloneable. * @error Invalid handles will cause a run time error. */ -native Handle:CloneHandle(Handle:hndl, Handle:plugin=INVALID_HANDLE); +native Handle CloneHandle(Handle hndl, Handle plugin=INVALID_HANDLE); using __intrinsics__.Handle; @@ -94,4 +94,4 @@ using __intrinsics__.Handle; * @return True if handle is valid, false otherwise. */ #pragma deprecated Do not use this function. -native bool:IsValidHandle(Handle:hndl); +native bool IsValidHandle(Handle hndl); diff --git a/plugins/include/helpers.inc b/plugins/include/helpers.inc index ea1f915f..aa15a22a 100644 --- a/plugins/include/helpers.inc +++ b/plugins/include/helpers.inc @@ -43,12 +43,12 @@ * @param buffer Buffer for text. * @param maxlength Maximum length of text. */ -stock FormatUserLogText(client, String:buffer[], maxlength) +stock void FormatUserLogText(int client, char[] buffer, int maxlength) { - decl String:auth[32]; - decl String:name[MAX_NAME_LENGTH]; + char auth[32]; + char name[MAX_NAME_LENGTH]; - new userid = GetClientUserId(client); + int userid = GetClientUserId(client); if (!GetClientAuthString(client, auth, sizeof(auth))) { strcopy(auth, sizeof(auth), "UNKNOWN"); @@ -69,12 +69,12 @@ stock FormatUserLogText(client, String:buffer[], maxlength) * @param filename Filename of the plugin to search for. * @return Handle to plugin if found, INVALID_HANDLE otherwise. */ -stock Handle:FindPluginByFile(const String:filename[]) +stock Handle FindPluginByFile(const char[] filename) { - decl String:buffer[256]; + char buffer[256]; - new Handle:iter = GetPluginIterator(); - new Handle:pl; + Handle iter = GetPluginIterator(); + Handle pl; while (MorePlugins(iter)) { @@ -152,12 +152,13 @@ stock int SearchForClients(const char[] pattern, int[] clients, int maxClients) * @param immunity Optional. Set to false to ignore target immunity. * @return Index of target client, or -1 on error. */ -stock FindTarget(client, const String:target[], bool:nobots = false, bool:immunity = true) +stock int FindTarget(int client, const char[] target, bool nobots = false, bool immunity = true) { - decl String:target_name[MAX_TARGET_LENGTH]; - decl target_list[1], target_count, bool:tn_is_ml; + char target_name[MAX_TARGET_LENGTH]; + int target_list[1], target_count; + bool tn_is_ml; - new flags = COMMAND_FILTER_NO_MULTI; + int flags = COMMAND_FILTER_NO_MULTI; if (nobots) { flags |= COMMAND_FILTER_NO_BOTS; @@ -202,10 +203,10 @@ stock FindTarget(client, const String:target[], bool:nobots = false, bool:immuni * @return Number of maps loaded or 0 if in error. */ #pragma deprecated Use ReadMapList() instead. - stock LoadMaps(Handle:array, &fileTime = 0, Handle:fileCvar = INVALID_HANDLE) + stock int LoadMaps(Handle array, int &fileTime = 0, Handle fileCvar = INVALID_HANDLE) { - decl String:mapPath[256], String:mapFile[64]; - new bool:fileFound = false; + char mapPath[256], mapFile[64]; + bool fileFound = false; if (fileCvar != INVALID_HANDLE) { @@ -216,7 +217,7 @@ stock FindTarget(client, const String:target[], bool:nobots = false, bool:immuni if (!fileFound) { - new Handle:mapCycleFile = FindConVar("mapcyclefile"); + Handle mapCycleFile = FindConVar("mapcyclefile"); GetConVarString(mapCycleFile, mapPath, sizeof(mapPath)); fileFound = FileExists(mapPath); } @@ -231,7 +232,7 @@ stock FindTarget(client, const String:target[], bool:nobots = false, bool:immuni // If the file hasn't changed, there's no reason to reload // all of the maps. - new newTime = GetFileTime(mapPath, FileTime_LastChange); + int newTime = GetFileTime(mapPath, FileTime_LastChange); if (fileTime == newTime) { return GetArraySize(array); diff --git a/plugins/include/keyvalues.inc b/plugins/include/keyvalues.inc index 2eb5849f..afa228a1 100644 --- a/plugins/include/keyvalues.inc +++ b/plugins/include/keyvalues.inc @@ -107,7 +107,7 @@ methodmap KeyValues < Handle // // @param key Name of the key, or NULL_STRING. // @param value Large integer value (0=High bits, 1=Low bits) - public native void SetUInt64(const char[] key, const value[2]); + public native void SetUInt64(const char[] key, const int value[2]); // Sets a floating point value of a KeyValues key. // @@ -167,7 +167,7 @@ methodmap KeyValues < Handle // @param g Green value, set by reference. // @param b Blue value, set by reference. // @param a Alpha value, set by reference. - public native void GetColor(const char[] key, &r, &g, &b, &a); + public native void GetColor(const char[] key, int &r, int &g, int &b, int &a); // Retrieves a set of color values from a KeyValues key. // @@ -359,7 +359,7 @@ native void KvSetNum(Handle kv, const char[] key, int value); * @param value Large integer value (0=High bits, 1=Low bits) * @error Invalid Handle. */ -native void KvSetUInt64(Handle kv, const char[] key, const value[2]); +native void KvSetUInt64(Handle kv, const char[] key, const int value[2]); /** * Sets a floating point value of a KeyValues key. diff --git a/plugins/include/lang.inc b/plugins/include/lang.inc index f4cb0695..c46c974a 100644 --- a/plugins/include/lang.inc +++ b/plugins/include/lang.inc @@ -42,9 +42,8 @@ * If no extension is specified, .txt is assumed. * * @param file Translation file. - * @noreturn */ -native LoadTranslations(const String:file[]); +native void LoadTranslations(const char[] file); /** * Sets the global language target. This is useful for creating functions @@ -53,9 +52,8 @@ native LoadTranslations(const String:file[]); * not during this function call. * * @param client Client index or LANG_SERVER. - * @noreturn */ -native SetGlobalTransTarget(client); +native void SetGlobalTransTarget(int client); /** * Retrieves the language number of a client. @@ -64,21 +62,21 @@ native SetGlobalTransTarget(client); * @return Language number client is using. * @error Invalid client index or client not connected. */ -native GetClientLanguage(client); +native int GetClientLanguage(int client); /** * Retrieves the server's language. * * @return Language number server is using. */ -native GetServerLanguage(); +native int GetServerLanguage(); /** * Returns the number of languages known in languages.cfg. * * @return Language count. */ -native GetLanguageCount(); +native int GetLanguageCount(); /** * Retrieves info about a given language number. @@ -88,20 +86,18 @@ native GetLanguageCount(); * @param codeLen Maximum length of the language code buffer. * @param name Language name buffer. * @param nameLen Maximum length of the language name buffer. - * @noreturn * @error Invalid language number. */ -native GetLanguageInfo(language, String:code[]="", codeLen=0, String:name[]="", nameLen=0); +native void GetLanguageInfo(int language, char[] code="", int codeLen=0, char[] name="", int nameLen=0); /** * Sets the language number of a client. * * @param client Client index. * @param language Language number. - * @noreturn * @error Invalid client index or client not connected. */ -native SetClientLanguage(client, language); +native void SetClientLanguage(int client, int language); /** * Retrieves the language number from a language code. @@ -109,7 +105,7 @@ native SetClientLanguage(client, language); * @param code Language code (2-3 characters usually). * @return Language number. -1 if not found. */ -native GetLanguageByCode(const String:code[]); +native int GetLanguageByCode(const char[] code); /** * Retrieves the language number from a language name. @@ -117,4 +113,4 @@ native GetLanguageByCode(const String:code[]); * @param name Language name (case insensitive). * @return Language number. -1 if not found. */ -native GetLanguageByName(const String:name[]); +native int GetLanguageByName(const char[] name); diff --git a/plugins/include/logging.inc b/plugins/include/logging.inc index 280bee03..2683dda5 100644 --- a/plugins/include/logging.inc +++ b/plugins/include/logging.inc @@ -41,9 +41,8 @@ * * @param format String format. * @param ... Format arguments. - * @noreturn */ -native LogMessage(const String:format[], any:...); +native void LogMessage(const char[] format, any ...); /** * Logs a message to any file. The log message will be in the normal @@ -52,10 +51,9 @@ native LogMessage(const String:format[], any:...); * @param file File to write the log message in. * @param format String format. * @param ... Format arguments. - * @noreturn * @error File could not be opened/written. */ -native LogToFile(const String:file[], const String:format[], any:...); +native void LogToFile(const char[] file, const char[] format, any ...); /** * Same as LogToFile(), except no plugin logtag is prepended. @@ -63,10 +61,9 @@ native LogToFile(const String:file[], const String:format[], any:...); * @param file File to write the log message in. * @param format String format. * @param ... Format arguments. - * @noreturn * @error File could not be opened/written. */ -native LogToFileEx(const String:file[], const String:format[], any:...); +native void LogToFileEx(const char[] file, const char[] format, any ...); /** * Logs an action from a command or event whereby interception and routing may @@ -77,18 +74,16 @@ native LogToFileEx(const String:file[], const String:format[], any:...); * @param target Client being targetted, or -1 if not applicable. * @param message Message format. * @param ... Message formatting parameters. - * @noreturn */ -native LogAction(client, target, const String:message[], any:...); +native void LogAction(int client, int target, const char[] message, any ...); /** * Logs a plugin error message to the SourceMod logs. * * @param format String format. * @param ... Format arguments. - * @noreturn */ -native LogError(const String:format[], any:...); +native void LogError(const char[] format, any ...); /** * Called when an action is going to be logged. @@ -104,11 +99,11 @@ native LogError(const String:format[], any:...); * Plugin_Stop is the same as Handled, but prevents any other * plugins from handling the message. */ -forward Action:OnLogAction(Handle:source, - Identity:ident, - client, - target, - const String:message[]); +forward Action OnLogAction(Handle source, + Identity ident, + int client, + int target, + const char[] message); /** * Called when a game log message is received. @@ -129,14 +124,12 @@ typedef GameLogHook = function Action (const char[] message); * Adds a game log hook. * * @param hook Hook function. - * @noreturn */ -native AddGameLogHook(GameLogHook:hook); +native void AddGameLogHook(GameLogHook hook); /** * Removes a game log hook. * * @param hook Hook function. - * @noreturn */ -native RemoveGameLogHook(GameLogHook:hook); +native void RemoveGameLogHook(GameLogHook hook); diff --git a/plugins/include/mapchooser.inc b/plugins/include/mapchooser.inc index 6c283180..173faf25 100644 --- a/plugins/include/mapchooser.inc +++ b/plugins/include/mapchooser.inc @@ -80,7 +80,6 @@ native bool RemoveNominationByOwner(int owner); * Gets the current list of excluded maps. * * @param array An ADT array handle to add the map strings to. - * @noreturn */ native void GetExcludeMapList(ArrayList array); @@ -89,7 +88,6 @@ native void GetExcludeMapList(ArrayList array); * * @param maparray An ADT array handle to add the map strings to. * @param ownerarray An optional ADT array handle to add the nominator client indexes to. - * @noreturn */ native void GetNominatedMapList(ArrayList maparray, ArrayList ownerarray = null); @@ -159,4 +157,3 @@ public void __pl_mapchooser_SetNTVOptional() MarkNativeAsOptional("HasEndOfMapVoteFinished"); MarkNativeAsOptional("EndOfMapVoteEnabled"); } - diff --git a/plugins/include/menus.inc b/plugins/include/menus.inc index 26ac16f1..604502e5 100644 --- a/plugins/include/menus.inc +++ b/plugins/include/menus.inc @@ -176,7 +176,7 @@ methodmap Panel < Handle // No numbering or newlines are needed. // @param style ITEMDRAW style flags. // @return A slot position, or 0 if item was a rawline or could not be drawn. - public native int DrawItem(const char[] text, style=ITEMDRAW_DEFAULT); + public native int DrawItem(const char[] text, int style=ITEMDRAW_DEFAULT); // Draws a raw line of text on a panel, without any markup other than a // newline. @@ -784,10 +784,10 @@ native bool VoteMenu(Handle menu, int[] clients, int numClients, int time, int f */ stock bool VoteMenuToAll(Handle menu, int time, int flags=0) { - new total; - decl players[MaxClients]; + int total; + int[] players = new int[MaxClients]; - for (new i=1; i<=MaxClients; i++) + for (int i=1; i<=MaxClients; i++) { if (!IsClientInGame(i) || IsFakeClient(i)) { @@ -970,7 +970,7 @@ native void SetPanelTitle(Handle panel, const char[] text, bool onlyIfEmpty=fals * @return A slot position, or 0 if item was a rawline or could not be drawn. * @error Invalid Handle. */ -native int DrawPanelItem(Handle panel, const char[] text, style=ITEMDRAW_DEFAULT); +native int DrawPanelItem(Handle panel, const char[] text, int style=ITEMDRAW_DEFAULT); /** * Draws a raw line of text on a panel, without any markup other than a newline. @@ -992,7 +992,7 @@ native bool DrawPanelText(Handle panel, const char[] text); * @return True if item is drawable, false otherwise. * @error Invalid Handle. */ -native bool CanPanelDrawFlags(Handle panel, style); +native bool CanPanelDrawFlags(Handle panel, int style); /** * Sets the selectable key map of a panel. This is not supported by @@ -1096,7 +1096,7 @@ native bool InternalShowMenu(int client, const char[] str, int time, int keys=-1 * @param winningVotes Number of votes received by the winning option. * @param totalVotes Number of total votes received. */ -stock void GetMenuVoteInfo(param2, &winningVotes, &totalVotes) +stock void GetMenuVoteInfo(int param2, int &winningVotes, int &totalVotes) { winningVotes = param2 & 0xFFFF; totalVotes = param2 >> 16; @@ -1119,4 +1119,3 @@ stock bool IsNewVoteAllowed() return true; } - diff --git a/plugins/include/nextmap.inc b/plugins/include/nextmap.inc index a1632679..cb86b711 100644 --- a/plugins/include/nextmap.inc +++ b/plugins/include/nextmap.inc @@ -58,7 +58,6 @@ native bool GetNextMap(char[] map, int maxlen); * * @param map Map to change to. * @param reason Reason for change. - * @noreturn */ native void ForceChangeLevel(const char[] map, const char[] reason); @@ -78,7 +77,6 @@ native int GetMapHistorySize(); * @param reason Buffer to store the change reason. * @param reasonLen Length of the reason buffer. * @param startTime Time the map started. - * @noreturn * @error Invalid item number. */ -native void GetMapHistory(int item, char[] map, int mapLen, char[] reason, int reasonLen, int &startTime); \ No newline at end of file +native void GetMapHistory(int item, char[] map, int mapLen, char[] reason, int reasonLen, int &startTime); diff --git a/plugins/include/profiler.inc b/plugins/include/profiler.inc index 51c72aec..ed5a7ee3 100644 --- a/plugins/include/profiler.inc +++ b/plugins/include/profiler.inc @@ -45,25 +45,23 @@ * * @return Handle to the profiler object. */ -native Handle:CreateProfiler(); +native Handle CreateProfiler(); /** * Starts profiling. * * @param prof Profiling object. - * @noreturn * @error Invalid Handle. */ -native StartProfiling(Handle:prof); +native void StartProfiling(Handle prof); /** * Stops profiling. * * @param prof Profiling object. - * @noreturn * @error Invalid Handle or profiling was never started. */ -native StopProfiling(Handle:prof); +native void StopProfiling(Handle prof); /** * Returns the amount of high-precision time in seconds @@ -74,7 +72,7 @@ native StopProfiling(Handle:prof); * @return Time elapsed in seconds. * @error Invalid Handle. */ -native Float:GetProfilerTime(Handle:prof); +native float GetProfilerTime(Handle prof); /** * Mark the start of a profiling event. @@ -82,19 +80,18 @@ native Float:GetProfilerTime(Handle:prof); * @param group Budget group. This can be "all" for a default, or a short * description like "Timers" or "Events". * @param name A name to attribute to this profiling event. - * @noreturn */ -native EnterProfilingEvent(const String:group[], const String:name[]); +native void EnterProfilingEvent(const char[] group, const char[] name); /** * Mark the end of the last profiling event. This must be called in the same * stack frame as StartProfilingEvent(). Not doing so, or throwing errors, * will make the resulting profile very wrong. */ -native LeaveProfilingEvent(); +native void LeaveProfilingEvent(); /** * Returns true if the global profiler is enabled; false otherwise. It is * not necessary to call this before Enter/LeaveProfilingEvent. */ -native bool:IsProfilingActive(); +native bool IsProfilingActive(); diff --git a/plugins/include/protobuf.inc b/plugins/include/protobuf.inc index 1d264b31..56bebc5f 100644 --- a/plugins/include/protobuf.inc +++ b/plugins/include/protobuf.inc @@ -306,7 +306,7 @@ native bool PbReadBool(Handle pb, const char[] field, int index = PB_FIELD_NOT_R * @param index Index into repeated field. * @error Invalid or incorrect Handle, non-existent field, or incorrect field type. */ -native void PbReadString(Handle pb, const char[] field, String:buffer[], maxlength, int index = PB_FIELD_NOT_REPEATED); +native void PbReadString(Handle pb, const char[] field, char[] buffer, int maxlength, int index = PB_FIELD_NOT_REPEATED); /** * Reads an RGBA color value from a protobuf message. @@ -317,7 +317,7 @@ native void PbReadString(Handle pb, const char[] field, String:buffer[], maxleng * @param index Index into repeated field. * @error Invalid or incorrect Handle, non-existent field, or incorrect field type. */ -native void PbReadColor(Handle pb, const char[] field, buffer[4], int index = PB_FIELD_NOT_REPEATED); +native void PbReadColor(Handle pb, const char[] field, int buffer[4], int index = PB_FIELD_NOT_REPEATED); /** * Reads an XYZ angle value from a protobuf message. diff --git a/plugins/include/sdktools.inc b/plugins/include/sdktools.inc index cb9cf78b..2adc408d 100644 --- a/plugins/include/sdktools.inc +++ b/plugins/include/sdktools.inc @@ -107,17 +107,15 @@ enum SDKPassMethod * Starts the preparation of an SDK call. * * @param type Type of function call this will be. - * @noreturn */ -native StartPrepSDKCall(SDKCallType:type); +native void StartPrepSDKCall(SDKCallType type); /** * Sets the virtual index of the SDK call if it is virtual. * * @param vtblidx Virtual table index. - * @noreturn */ -native PrepSDKCall_SetVirtual(vtblidx); +native void PrepSDKCall_SetVirtual(int vtblidx); /** * Finds an address in a library and sets it as the address to use for the SDK call. @@ -129,7 +127,7 @@ native PrepSDKCall_SetVirtual(vtblidx); * @param bytes Number of bytes in the binary search string. * @return True on success, false if nothing was found. */ -native bool:PrepSDKCall_SetSignature(SDKLibrary:lib, const String:signature[], bytes); +native bool PrepSDKCall_SetSignature(SDKLibrary lib, const char[] signature, int bytes); /** * Uses the given function address for the SDK call. @@ -137,7 +135,7 @@ native bool:PrepSDKCall_SetSignature(SDKLibrary:lib, const String:signature[], b * @param addr Address of function to use. * @return True on success, false on failure. */ -native bool:PrepSDKCall_SetAddress(Address:addr); +native bool PrepSDKCall_SetAddress(Address addr); /** * Finds an address or virtual function index in a GameConfig file and sets it as @@ -148,7 +146,7 @@ native bool:PrepSDKCall_SetAddress(Address:addr); * @param name Name of the property to find. * @return True on success, false if nothing was found. */ -native bool:PrepSDKCall_SetFromConf(Handle:gameconf, SDKFuncConfSource:source, const String:name[]); +native bool PrepSDKCall_SetFromConf(Handle gameconf, SDKFuncConfSource source, const char[] name); /** * Sets the return information of an SDK call. Do not call this if there is no return data. @@ -159,9 +157,8 @@ native bool:PrepSDKCall_SetFromConf(Handle:gameconf, SDKFuncConfSource:source, c * @param pass How the data is passed in C++. * @param decflags Flags on decoding from the plugin to C++. * @param encflags Flags on encoding from C++ to the plugin. - * @noreturn */ -native PrepSDKCall_SetReturnInfo(SDKType:type, SDKPassMethod:pass, decflags=0, encflags=0); +native void PrepSDKCall_SetReturnInfo(SDKType type, SDKPassMethod pass, int decflags=0, int encflags=0); /** * Adds a parameter to the calling convention. This should be called in normal ascending order. @@ -170,16 +167,15 @@ native PrepSDKCall_SetReturnInfo(SDKType:type, SDKPassMethod:pass, decflags=0, e * @param pass How the data is passed in C++. * @param decflags Flags on decoding from the plugin to C++. * @param encflags Flags on encoding from C++ to the plugin. - * @noreturn */ -native PrepSDKCall_AddParameter(SDKType:type, SDKPassMethod:pass, decflags=0, encflags=0); +native void PrepSDKCall_AddParameter(SDKType type, SDKPassMethod pass, int decflags=0, int encflags=0); /** * Finalizes an SDK call preparation and returns the resultant Handle. * * @return A new SDKCall Handle on success, or INVALID_HANDLE on failure. */ -native Handle:EndPrepSDKCall(); +native Handle EndPrepSDKCall(); /** * Calls an SDK function with the given parameters. @@ -201,21 +197,21 @@ native Handle:EndPrepSDKCall(); * @return Simple return value, if any. * @error Invalid Handle or internal decoding error. */ -native any:SDKCall(Handle:call, any:...); +native any SDKCall(Handle call, any ...); /** * Returns the entity index of the player resource/manager entity. * * @return Index of resource entity or -1 if not found. */ -native GetPlayerResourceEntity(); +native int GetPlayerResourceEntity(); #include /** * Do not edit below this line! */ -public Extension:__ext_sdktools = +public Extension __ext_sdktools = { name = "SDKTools", file = "sdktools.ext", diff --git a/plugins/include/sdktools_client.inc b/plugins/include/sdktools_client.inc index 950b67d5..00446344 100644 --- a/plugins/include/sdktools_client.inc +++ b/plugins/include/sdktools_client.inc @@ -39,14 +39,12 @@ * Sets the client to an inactive state waiting for a new map * * @param client The client index - * @noreturn */ -native InactivateClient(client); +native void InactivateClient(int client); /** * Reconnect a client without dropping the netchannel * * @param client The client index - * @noreturn */ -native ReconnectClient(client); +native void ReconnectClient(int client); diff --git a/plugins/include/sdktools_engine.inc b/plugins/include/sdktools_engine.inc index 6e39b157..280d970e 100644 --- a/plugins/include/sdktools_engine.inc +++ b/plugins/include/sdktools_engine.inc @@ -42,28 +42,25 @@ * * @param client Client index. * @param entity Entity index. - * @noreturn * @error Invalid client or entity, lack of mod support, or client not in * game. */ -native SetClientViewEntity(client, entity); +native void SetClientViewEntity(int client, int entity); /** * Sets a light style. * * @param style Light style (from 0 to MAX_LIGHTSTYLES-1) * @param value Light value string (see world.cpp/light.cpp in dlls) - * @noreturn * @error Light style index is out of range. */ -native SetLightStyle(style, const String:value[]); +native void SetLightStyle(int style, const char[] value); /** * Returns the client's eye position. * * @param client Player's index. * @param pos Destination vector to store the client's eye position. - * @noreturn * @error Invalid client index, client not in game, or no mod support. */ -native GetClientEyePosition(client, Float:pos[3]); +native void GetClientEyePosition(int client, float pos[3]); diff --git a/plugins/include/sdktools_entinput.inc b/plugins/include/sdktools_entinput.inc index be1bbfc7..5d0c836e 100644 --- a/plugins/include/sdktools_entinput.inc +++ b/plugins/include/sdktools_entinput.inc @@ -48,69 +48,61 @@ * @return True if successful otherwise false. * @error Invalid entity index or no mod support. */ -native bool:AcceptEntityInput(dest, const String:input[], activator=-1, caller=-1, outputid=0); +native bool AcceptEntityInput(int dest, const char[] input, int activator=-1, int caller=-1, int outputid=0); /** * Sets a bool value in the global variant object. * * @param val Input value. - * @noreturn */ -native SetVariantBool(bool:val); +native void SetVariantBool(bool val); /** * Sets a string in the global variant object. * * @param str Input string. - * @noreturn */ -native SetVariantString(const String:str[]); +native void SetVariantString(const char[] str); /** * Sets an integer value in the global variant object. * * @param val Input value. - * @noreturn */ -native SetVariantInt(val); +native void SetVariantInt(int val); /** * Sets a floating point value in the global variant object. * * @param val Input value. - * @noreturn */ -native SetVariantFloat(Float:val); +native void SetVariantFloat(float val); /** * Sets a 3D vector in the global variant object. * * @param vec Input vector. - * @noreturn */ -native SetVariantVector3D(const Float:vec[3]); +native void SetVariantVector3D(const float vec[3]); /** * Sets a 3D position vector in the global variant object. * * @param vec Input position vector. - * @noreturn */ -native SetVariantPosVector3D(const Float:vec[3]); +native void SetVariantPosVector3D(const float vec[3]); /** * Sets a color in the global variant object. * * @param color Input color. - * @noreturn */ -native SetVariantColor(const color[4]); +native void SetVariantColor(const int color[4]); /** * Sets an entity in the global variant object. * * @param entity Entity index. - * @noreturn * @error Invalid entity index. */ -native SetVariantEntity(entity); +native void SetVariantEntity(int entity); diff --git a/plugins/include/sdktools_entoutput.inc b/plugins/include/sdktools_entoutput.inc index a7332a57..3d627a6f 100644 --- a/plugins/include/sdktools_entoutput.inc +++ b/plugins/include/sdktools_entoutput.inc @@ -58,10 +58,9 @@ typeset EntityOutput * @param classname The classname to hook. * @param output The output name to hook. * @param callback An EntityOutput function pointer. - * @noreturn * @error Entity Outputs disabled. */ -native HookEntityOutput(const String:classname[], const String:output[], EntityOutput:callback); +native void HookEntityOutput(const char[] classname, const char[] output, EntityOutput callback); /** * Remove an entity output hook. @@ -71,7 +70,7 @@ native HookEntityOutput(const String:classname[], const String:output[], EntityO * @return True on success, false if no valid hook was found. * @error Entity Outputs disabled. */ -native bool:UnhookEntityOutput(const String:classname[], const String:output[], EntityOutput:callback); +native bool UnhookEntityOutput(const char[] classname, const char[] output, EntityOutput callback); /** * Add an entity output hook on a single entity instance @@ -80,10 +79,9 @@ native bool:UnhookEntityOutput(const String:classname[], const String:output[], * @param output The output name to hook. * @param callback An EntityOutput function pointer. * @param once Only fire this hook once and then remove itself. - * @noreturn * @error Entity Outputs disabled or Invalid Entity index. */ -native HookSingleEntityOutput(entity, const String:output[], EntityOutput:callback , bool:once=false); +native void HookSingleEntityOutput(int entity, const char[] output, EntityOutput callback, bool once=false); /** * Remove a single entity output hook. @@ -94,5 +92,4 @@ native HookSingleEntityOutput(entity, const String:output[], EntityOutput:callba * @return True on success, false if no valid hook was found. * @error Entity Outputs disabled or Invalid Entity index. */ -native bool:UnhookSingleEntityOutput(entity, const String:output[], EntityOutput:callback); - +native bool UnhookSingleEntityOutput(int entity, const char[] output, EntityOutput callback); diff --git a/plugins/include/sdktools_gamerules.inc b/plugins/include/sdktools_gamerules.inc index 1bb5704c..30527fcf 100644 --- a/plugins/include/sdktools_gamerules.inc +++ b/plugins/include/sdktools_gamerules.inc @@ -82,7 +82,7 @@ enum RoundState { * @return Value at the given property offset. * @error Not supported. */ -native GameRules_GetProp(const String:prop[], size=4, element=0); +native int GameRules_GetProp(const char[] prop, int size=4, int element=0); /** * Sets an integer value for a property of the gamerules entity. @@ -95,9 +95,8 @@ native GameRules_GetProp(const String:prop[], size=4, element=0); * @param element Element # (starting from 0) if property is an array. * @param changeState This parameter is ignored. * @error Not supported. - * @noreturn */ -native GameRules_SetProp(const String:prop[], any:value, size=4, element=0, bool:changeState=false); +native void GameRules_SetProp(const char[] prop, any value, int size=4, int element=0, bool changeState=false); /** * Retrieves a float value from a property of the gamerules entity. @@ -107,7 +106,7 @@ native GameRules_SetProp(const String:prop[], any:value, size=4, element=0, bool * @return Value at the given property offset. * @error Not supported. */ -native Float:GameRules_GetPropFloat(const String:prop[], element=0); +native float GameRules_GetPropFloat(const char[] prop, int element=0); /** * Sets a float value for a property of the gamerules entity. @@ -116,10 +115,9 @@ native Float:GameRules_GetPropFloat(const String:prop[], element=0); * @param value Value to set. * @param element Element # (starting from 0) if property is an array. * @param changeState This parameter is ignored. - * @noreturn * @error Not supported. */ -native GameRules_SetPropFloat(const String:prop[], Float:value, element=0, bool:changeState=false); +native void GameRules_SetPropFloat(const char[] prop, float value, int element=0, bool changeState=false); /** * Retrieves a entity index from a property of the gamerules entity. @@ -131,7 +129,7 @@ native GameRules_SetPropFloat(const String:prop[], Float:value, element=0, bool: * then -1 is returned. * @error Not supported. */ -native GameRules_GetPropEnt(const String:prop[], element=0); +native int GameRules_GetPropEnt(const char[] prop, int element=0); /** * Sets an entity index for a property of the gamerules entity. @@ -140,10 +138,9 @@ native GameRules_GetPropEnt(const String:prop[], element=0); * @param other Entity index to set, or -1 to unset. * @param element Element # (starting from 0) if property is an array. * @param changeState This parameter is ignored. - * @noreturn * @error Not supported. */ -native GameRules_SetPropEnt(const String:prop[], other, element=0, bool:changeState=false); +native void GameRules_SetPropEnt(const char[] prop, int other, int element=0, bool changeState=false); /** * Retrieves a vector of floats from the gamerules entity, given a named network property. @@ -151,10 +148,9 @@ native GameRules_SetPropEnt(const String:prop[], other, element=0, bool:changeSt * @param prop Property name. * @param vec Vector buffer to store data in. * @param element Element # (starting from 0) if property is an array. - * @noreturn * @error Not supported. */ -native GameRules_GetPropVector(const String:prop[], Float:vec[3], element=0); +native void GameRules_GetPropVector(const char[] prop, float vec[3], int element=0); /** * Sets a vector of floats in the gamerules entity, given a named network property. @@ -163,10 +159,9 @@ native GameRules_GetPropVector(const String:prop[], Float:vec[3], element=0); * @param vec Vector to set. * @param element Element # (starting from 0) if property is an array. * @param changeState This parameter is ignored. - * @noreturn * @error Not supported. */ -native GameRules_SetPropVector(const String:prop[], const Float:vec[3], element=0, bool:changeState=false); +native void GameRules_SetPropVector(const char[] prop, const float vec[3], int element=0, bool changeState=false); /** * Gets a gamerules property as a string. @@ -177,7 +172,7 @@ native GameRules_SetPropVector(const String:prop[], const Float:vec[3], element= * @return Number of non-null bytes written. * @error Not supported. */ -native GameRules_GetPropString(const String:prop[], String:buffer[], maxlen); +native int GameRules_GetPropString(const char[] prop, char[] buffer, int maxlen); /** * Sets a gamerules property as a string. @@ -188,7 +183,7 @@ native GameRules_GetPropString(const String:prop[], String:buffer[], maxlen); * @return Number of non-null bytes written. * @error Not supported. */ -native GameRules_SetPropString(const String:prop[], const String:buffer[], bool:changeState=false); +native int GameRules_SetPropString(const char[] prop, const char[] buffer, bool changeState=false); /** * Gets the current round state. @@ -196,7 +191,7 @@ native GameRules_SetPropString(const String:prop[], const String:buffer[], bool: * @return Round state. * @error Game doesn't support round state. */ -stock RoundState:GameRules_GetRoundState() +stock RoundState GameRules_GetRoundState() { - return RoundState:GameRules_GetProp("m_iRoundState"); + return view_as(GameRules_GetProp("m_iRoundState")); } diff --git a/plugins/include/sdktools_hooks.inc b/plugins/include/sdktools_hooks.inc index 18591285..315b058c 100644 --- a/plugins/include/sdktools_hooks.inc +++ b/plugins/include/sdktools_hooks.inc @@ -56,7 +56,7 @@ * @note To see if all 11 params are available, use FeatureType_Capability and * FEATURECAP_PLAYERRUNCMD_11PARAMS. */ -forward Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2]); +forward Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]); /** * @brief Called when a client requests a file from the server. @@ -66,7 +66,7 @@ forward Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:an * * @return Plugin_Handled to block the transfer, Plugin_Continue to let it proceed. */ -forward Action:OnFileSend(client, const String:sFile[]); +forward Action OnFileSend(int client, const char[] sFile); /** * @brief Called when a client sends a file to the server. @@ -76,4 +76,4 @@ forward Action:OnFileSend(client, const String:sFile[]); * * @return Plugin_Handled to block the transfer, Plugin_Continue to let it proceed. */ -forward Action:OnFileReceive(client, const String:sFile[]); +forward Action OnFileReceive(int client, const char[] sFile); diff --git a/plugins/include/sdktools_stocks.inc b/plugins/include/sdktools_stocks.inc index 13e2159a..2af01a8a 100644 --- a/plugins/include/sdktools_stocks.inc +++ b/plugins/include/sdktools_stocks.inc @@ -47,14 +47,14 @@ * -1 if no team matched. * -2 if more than one team matched. */ -stock FindTeamByName(const String:name[]) +stock int FindTeamByName(const char[] name) { - new name_len = strlen(name); - new num_teams = GetTeamCount(); - decl String:team_name[32]; - new found_team = -1; + int name_len = strlen(name); + int num_teams = GetTeamCount(); + char team_name[32]; + int found_team = -1; - for (new i = 0; i < num_teams; i++) + for (int i = 0; i < num_teams; i++) { GetTeamName(i, team_name, sizeof(team_name)); @@ -73,4 +73,3 @@ stock FindTeamByName(const String:name[]) return found_team; } - diff --git a/plugins/include/sdktools_stringtables.inc b/plugins/include/sdktools_stringtables.inc index bd0c12a6..59e13f1b 100644 --- a/plugins/include/sdktools_stringtables.inc +++ b/plugins/include/sdktools_stringtables.inc @@ -44,14 +44,14 @@ * @param name Name of string table to find. * @return A string table index number if found, INVALID_STRING_TABLE otherwise. */ -native FindStringTable(const String:name[]); +native int FindStringTable(const char[] name); /** * Returns the number of string tables that currently exist. * * @return Number of string tables that currently exist. */ -native GetNumStringTables(); +native int GetNumStringTables(); /** * Returns the number of strings that currently exist in a given string table. @@ -60,7 +60,7 @@ native GetNumStringTables(); * @return Number of strings that currently exist. * @error Invalid string table index. */ -native GetStringTableNumStrings(tableidx); +native int GetStringTableNumStrings(int tableidx); /** * Returns the maximum number of strings that are allowed in a given string table. @@ -69,7 +69,7 @@ native GetStringTableNumStrings(tableidx); * @return Maximum number of strings allowed. * @error Invalid string table index. */ -native GetStringTableMaxStrings(tableidx); +native int GetStringTableMaxStrings(int tableidx); /** * Retrieves the name of a string table. @@ -80,7 +80,7 @@ native GetStringTableMaxStrings(tableidx); * @return Number of bytes written to the buffer (UTF-8 safe). * @error Invalid string table index. */ -native GetStringTableName(tableidx, String:name[], maxlength); +native int GetStringTableName(int tableidx, char[] name, int maxlength); /** * Searches for the index of a given string in a string table. @@ -90,7 +90,7 @@ native GetStringTableName(tableidx, String:name[], maxlength); * @return String index if found, INVALID_STRING_INDEX otherwise. * @error Invalid string table index. */ -native FindStringIndex(tableidx, const String:str[]); +native int FindStringIndex(int tableidx, const char[] str); /** * Retrieves the string at a given index of a string table. @@ -102,7 +102,7 @@ native FindStringIndex(tableidx, const String:str[]); * @return Number of bytes written to the buffer (UTF-8 safe). * @error Invalid string table index or string index. */ -native ReadStringTable(tableidx, stringidx, String:str[], maxlength); +native int ReadStringTable(int tableidx, int stringidx, char[] str, int maxlength); /** * Returns the length of the user data associated with a given string index. @@ -112,7 +112,7 @@ native ReadStringTable(tableidx, stringidx, String:str[], maxlength); * @return Length of user data. This will be 0 if there is no user data. * @error Invalid string table index or string index. */ -native GetStringTableDataLength(tableidx, stringidx); +native int GetStringTableDataLength(int tableidx, int stringidx); /** * Retrieves the user data associated with a given string index. @@ -124,7 +124,7 @@ native GetStringTableDataLength(tableidx, stringidx); * @return Number of bytes written to the buffer (UTF-8 safe). * @error Invalid string table index or string index. */ -native GetStringTableData(tableidx, stringidx, String:userdata[], maxlength); +native int GetStringTableData(int tableidx, int stringidx, char[] userdata, int maxlength); /** * Sets the user data associated with a given string index. @@ -136,7 +136,7 @@ native GetStringTableData(tableidx, stringidx, String:userdata[], maxlength); * @return Number of bytes written to the buffer (UTF-8 safe). * @error Invalid string table index or string index. */ -native SetStringTableData(tableidx, stringidx, const String:userdata[], length); +native int SetStringTableData(int tableidx, int stringidx, const char[] userdata, int length); /** * Adds a string to a given string table. @@ -148,7 +148,7 @@ native SetStringTableData(tableidx, stringidx, const String:userdata[], length); * If set to -1, then user data will be not be altered if the specified string * already exists in the string table. */ -native AddToStringTable(tableidx, const String:str[], const String:userdata[]="", length=-1); +native void AddToStringTable(int tableidx, const char[] str, const char[] userdata="", int length=-1); /** * Locks or unlocks the network string tables. @@ -157,7 +157,7 @@ native AddToStringTable(tableidx, const String:str[], const String:userdata[]="" * True means the tables should be locked for writing; false means unlocked. * @return Previous lock state. */ -native bool:LockStringTables(bool:lock); +native bool LockStringTables(bool lock); /** * Adds a file to the downloadables network string table. @@ -165,16 +165,16 @@ native bool:LockStringTables(bool:lock); * * @param filename File that will be added to downloadables table. */ -stock AddFileToDownloadsTable(const String:filename[]) +stock void AddFileToDownloadsTable(const char[] filename) { - static table = INVALID_STRING_TABLE; + static int table = INVALID_STRING_TABLE; if (table == INVALID_STRING_TABLE) { table = FindStringTable("downloadables"); } - new bool:save = LockStringTables(false); + bool save = LockStringTables(false); AddToStringTable(table, filename); LockStringTables(save); } diff --git a/plugins/include/sdktools_tempents_stocks.inc b/plugins/include/sdktools_tempents_stocks.inc index 3901e662..853e4641 100644 --- a/plugins/include/sdktools_tempents_stocks.inc +++ b/plugins/include/sdktools_tempents_stocks.inc @@ -83,9 +83,8 @@ * @param dir Direction of the sparks. * @param Magnitude Sparks size. * @param TrailLength Trail lenght of the sparks. - * @noreturn */ -stock TE_SetupSparks(const Float:pos[3], const Float:dir[3], Magnitude, TrailLength) +stock void TE_SetupSparks(const float pos[3], const float dir[3], int Magnitude, int TrailLength) { TE_Start("Sparks"); TE_WriteVector("m_vecOrigin[0]", pos); @@ -101,9 +100,8 @@ stock TE_SetupSparks(const Float:pos[3], const Float:dir[3], Magnitude, TrailLen * @param Model Precached model index. * @param Scale Scale of the smoke. * @param FrameRate Frame rate of the smoke. - * @noreturn */ -stock TE_SetupSmoke(const Float:pos[3], Model, Float:Scale, FrameRate) +stock void TE_SetupSmoke(const float pos[3], int Model, float Scale, int FrameRate) { TE_Start("Smoke"); TE_WriteVector("m_vecOrigin", pos); @@ -119,9 +117,8 @@ stock TE_SetupSmoke(const Float:pos[3], Model, Float:Scale, FrameRate) * @param dir Direction of the dust. * @param Size Dust cloud size. * @param Speed Dust cloud speed. - * @noreturn */ -stock TE_SetupDust(const Float:pos[3], const Float:dir[3], Float:Size, Float:Speed) +stock void TE_SetupDust(const float pos[3], const float dir[3], float Size, float Speed) { TE_Start("Dust"); TE_WriteVector("m_vecOrigin[0]", pos); @@ -137,9 +134,8 @@ stock TE_SetupDust(const Float:pos[3], const Float:dir[3], Float:Size, Float:Spe * @param angles Rotation angles of the muzzle flash. * @param Scale Scale of the muzzle flash. * @param Type Muzzle flash type to render (Mod specific). - * @noreturn */ -stock TE_SetupMuzzleFlash(const Float:pos[3], const Float:angles[3], Float:Scale, Type) +stock void TE_SetupMuzzleFlash(const float pos[3], const float angles[3], float Scale, int Type) { TE_Start("MuzzleFlash"); TE_WriteVector("m_vecOrigin", pos); @@ -153,9 +149,8 @@ stock TE_SetupMuzzleFlash(const Float:pos[3], const Float:angles[3], Float:Scale * * @param pos Position of the metal sparks. * @param dir Direction of the metal sparks. - * @noreturn */ -stock TE_SetupMetalSparks(const Float:pos[3], const Float:dir[3]) +stock void TE_SetupMetalSparks(const float pos[3], const float dir[3]) { TE_Start("Metal Sparks"); TE_WriteVector("m_vecPos", pos); @@ -168,9 +163,8 @@ stock TE_SetupMetalSparks(const Float:pos[3], const Float:dir[3]) * @param pos Position of the energy splash. * @param dir Direction of the energy splash. * @param Explosive Makes the effect explosive. - * @noreturn */ -stock TE_SetupEnergySplash(const Float:pos[3], const Float:dir[3], bool:Explosive) +stock void TE_SetupEnergySplash(const float pos[3], const float dir[3], bool Explosive) { TE_Start("Energy Splash"); TE_WriteVector("m_vecPos", pos); @@ -183,9 +177,8 @@ stock TE_SetupEnergySplash(const Float:pos[3], const Float:dir[3], bool:Explosiv * * @param pos Position of the armor ricochet. * @param dir Direction of the armor ricochet. - * @noreturn */ -stock TE_SetupArmorRicochet(const Float:pos[3], const Float:dir[3]) +stock void TE_SetupArmorRicochet(const float pos[3], const float dir[3]) { TE_Start("Armor Ricochet"); TE_WriteVector("m_vecPos", pos); @@ -200,9 +193,8 @@ stock TE_SetupArmorRicochet(const Float:pos[3], const Float:dir[3]) * @param Life Time duration of the sprite. * @param Size Sprite size. * @param Brightness Sprite brightness. - * @noreturn */ -stock TE_SetupGlowSprite(const Float:pos[3], Model, Float:Life, Float:Size, Brightness) +stock void TE_SetupGlowSprite(const float pos[3], int Model, float Life, float Size, int Brightness) { TE_Start("GlowSprite"); TE_WriteVector("m_vecOrigin", pos); @@ -224,9 +216,8 @@ stock TE_SetupGlowSprite(const Float:pos[3], Model, Float:Life, Float:Size, Brig * @param Magnitude Explosion size. * @param normal Normal vector to the explosion. * @param MaterialType Exploded material type. - * @noreturn */ -stock TE_SetupExplosion(const Float:pos[3], Model, Float:Scale, Framerate, Flags, Radius, Magnitude, const Float:normal[3]={0.0, 0.0, 1.0}, MaterialType='C') +stock void TE_SetupExplosion(const float pos[3], int Model, float Scale, int Framerate, int Flags, int Radius, int Magnitude, const float normal[3]={0.0, 0.0, 1.0}, int MaterialType='C') { TE_Start("Explosion"); TE_WriteVector("m_vecOrigin[0]", pos); @@ -249,9 +240,8 @@ stock TE_SetupExplosion(const Float:pos[3], Model, Float:Scale, Framerate, Flags * @param Size Sprite size. * @param SprayModel Precached model index. * @param BloodDropModel Precached model index. - * @noreturn */ -stock TE_SetupBloodSprite(const Float:pos[3], const Float:dir[3], const color[4], Size, SprayModel, BloodDropModel) +stock void TE_SetupBloodSprite(const float pos[3], const float dir[3], const int color[4], int Size, int SprayModel, int BloodDropModel) { TE_Start("Blood Sprite"); TE_WriteVector("m_vecOrigin", pos); @@ -281,10 +271,9 @@ stock TE_SetupBloodSprite(const Float:pos[3], const Float:dir[3], const color[4] * @param Color Color array (r, g, b, a). * @param Speed Speed of the beam. * @param Flags Beam flags. - * @noreturn */ -stock TE_SetupBeamRingPoint(const Float:center[3], Float:Start_Radius, Float:End_Radius, ModelIndex, HaloIndex, StartFrame, - FrameRate, Float:Life, Float:Width, Float:Amplitude, const Color[4], Speed, Flags) +stock void TE_SetupBeamRingPoint(const float center[3], float Start_Radius, float End_Radius, int ModelIndex, int HaloIndex, int StartFrame, + int FrameRate, float Life, float Width, float Amplitude, const int Color[4], int Speed, int Flags) { TE_Start("BeamRingPoint"); TE_WriteVector("m_vecCenter", center); @@ -323,10 +312,9 @@ stock TE_SetupBeamRingPoint(const Float:center[3], Float:Start_Radius, Float:End * @param Amplitude Beam amplitude. * @param Color Color array (r, g, b, a). * @param Speed Speed of the beam. - * @noreturn */ -stock TE_SetupBeamPoints(const Float:start[3], const Float:end[3], ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, - Float:Width, Float:EndWidth, FadeLength, Float:Amplitude, const Color[4], Speed) +stock void TE_SetupBeamPoints(const float start[3], const float end[3], int ModelIndex, int HaloIndex, int StartFrame, int FrameRate, float Life, + float Width, float EndWidth, int FadeLength, float Amplitude, const int Color[4], int Speed) { TE_Start("BeamPoints"); TE_WriteVector("m_vecStartPoint", start); @@ -363,10 +351,9 @@ stock TE_SetupBeamPoints(const Float:start[3], const Float:end[3], ModelIndex, H * @param Amplitude Beam amplitude. * @param Color Color array (r, g, b, a). * @param Speed Speed of the beam. - * @noreturn */ -stock TE_SetupBeamLaser(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, - Float:Width, Float:EndWidth, FadeLength, Float:Amplitude, const Color[4], Speed) +stock void TE_SetupBeamLaser(int StartEntity, int EndEntity, int ModelIndex, int HaloIndex, int StartFrame, int FrameRate, float Life, + float Width, float EndWidth, int FadeLength, float Amplitude, const int Color[4], int Speed) { TE_Start("BeamLaser"); TE_WriteEncodedEnt("m_nStartEntity", StartEntity); @@ -402,9 +389,8 @@ stock TE_SetupBeamLaser(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFram * @param Color Color array (r, g, b, a). * @param Speed Speed of the beam. * @param Flags Beam flags. - * @noreturn */ -stock TE_SetupBeamRing(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, Float:Width, Float:Amplitude, const Color[4], Speed, Flags) +stock void TE_SetupBeamRing(int StartEntity, int EndEntity, int ModelIndex, int HaloIndex, int StartFrame, int FrameRate, float Life, float Width, float Amplitude, const int Color[4], int Speed, int Flags) { TE_Start("BeamRing"); TE_WriteEncodedEnt("m_nStartEntity", StartEntity); @@ -437,9 +423,8 @@ stock TE_SetupBeamRing(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFrame * @param EndWidth Final beam width. * @param FadeLength Beam fade time duration. * @param Color Color array (r, g, b, a). - * @noreturn */ -stock TE_SetupBeamFollow(EntIndex, ModelIndex, HaloIndex, Float:Life, Float:Width, Float:EndWidth, FadeLength, const Color[4]) +stock void TE_SetupBeamFollow(int EntIndex, int ModelIndex, int HaloIndex, float Life, float Width, float EndWidth, int FadeLength, const int Color[4]) { TE_Start("BeamFollow"); TE_WriteEncodedEnt("m_iEntIndex", EntIndex); diff --git a/plugins/include/sdktools_voice.inc b/plugins/include/sdktools_voice.inc index fae9b334..505a0ab6 100644 --- a/plugins/include/sdktools_voice.inc +++ b/plugins/include/sdktools_voice.inc @@ -61,9 +61,8 @@ enum ListenOverride * * @param client The client index * @param flags The voice flags - * @noreturn */ -native SetClientListeningFlags(client, flags); +native void SetClientListeningFlags(int client, int flags); /** * Retrieve the client current listening flags. @@ -71,7 +70,7 @@ native SetClientListeningFlags(client, flags); * @param client The client index * @return The current voice flags */ -native GetClientListeningFlags(client); +native int GetClientListeningFlags(int client); /** * Set the receiver ability to listen to the sender. @@ -82,7 +81,7 @@ native GetClientListeningFlags(client); * @return True if successful otherwise false. */ #pragma deprecated Use SetListenOverride() instead -native bool:SetClientListening(iReceiver, iSender, bool:bListen); +native bool SetClientListening(int iReceiver, int iSender, bool bListen); /** * Retrieves if the receiver can listen to the sender. @@ -92,7 +91,7 @@ native bool:SetClientListening(iReceiver, iSender, bool:bListen); * @return True if successful otherwise false. */ #pragma deprecated GetListenOverride() instead -native bool:GetClientListening(iReceiver, iSender); +native bool GetClientListening(int iReceiver, int iSender); /** * Override the receiver's ability to listen to the sender. @@ -102,7 +101,7 @@ native bool:GetClientListening(iReceiver, iSender); * @param override The override of the receiver's ability to listen to the sender. * @return True if successful otherwise false. */ -native bool:SetListenOverride(iReceiver, iSender, ListenOverride:override); +native bool SetListenOverride(int iReceiver, int iSender, ListenOverride override); /** * Retrieves the override of the receiver's ability to listen to the sender. @@ -111,7 +110,7 @@ native bool:SetListenOverride(iReceiver, iSender, ListenOverride:override); * @param iSender The sender index. * @return The override value. */ -native ListenOverride:GetListenOverride(iReceiver, iSender); +native ListenOverride GetListenOverride(int iReceiver, int iSender); /** * Retrieves if the muter has muted the mutee. @@ -120,5 +119,4 @@ native ListenOverride:GetListenOverride(iReceiver, iSender); * @param iMutee The mutee index. * @return True if muter has muted mutee, false otherwise. */ -native bool:IsClientMuted(iMuter, iMutee); - +native bool IsClientMuted(int iMuter, int iMutee); diff --git a/plugins/include/sorting.inc b/plugins/include/sorting.inc index 303f7739..b7e8bf80 100644 --- a/plugins/include/sorting.inc +++ b/plugins/include/sorting.inc @@ -62,9 +62,8 @@ enum SortType * @param array Array of integers to sort in-place. * @param array_size Size of the array. * @param order Sorting order to use. - * @noreturn */ -native SortIntegers(array[], array_size, SortOrder:order = Sort_Ascending); +native void SortIntegers(int[] array, int array_size, SortOrder order = Sort_Ascending); /** * Sorts an array of float point numbers. @@ -72,9 +71,8 @@ native SortIntegers(array[], array_size, SortOrder:order = Sort_Ascending); * @param array Array of floating point numbers to sort in-place. * @param array_size Size of the array. * @param order Sorting order to use. - * @noreturn */ -native SortFloats(Float:array[], array_size, SortOrder:order = Sort_Ascending); +native void SortFloats(float[] array, int array_size, SortOrder order = Sort_Ascending); /** * Sorts an array of strings. @@ -82,9 +80,8 @@ native SortFloats(Float:array[], array_size, SortOrder:order = Sort_Ascending); * @param array Array of strings to sort in-place. * @param array_size Size of the array. * @param order Sorting order to use. - * @noreturn */ -native SortStrings(String:array[][], array_size, SortOrder:order = Sort_Ascending); +native void SortStrings(char[][] array, int array_size, SortOrder order = Sort_Ascending); /** * Sort comparison function for 1D array elements. @@ -107,9 +104,8 @@ typedef SortFunc1D = function int (int elem1, int elem2, const int[] array, Hand * @param array_size Size of the array to sort. * @param sortfunc Sort function. * @param hndl Optional Handle to pass through the comparison calls. - * @noreturn */ -native SortCustom1D(array[], array_size, SortFunc1D:sortfunc, Handle:hndl=INVALID_HANDLE); +native void SortCustom1D(int[] array, int array_size, SortFunc1D sortfunc, Handle hndl=INVALID_HANDLE); /** * Sort comparison function for 2D array elements (sub-arrays). @@ -136,9 +132,8 @@ typeset SortFunc2D * @param array_size Size of the major array to sort (first index, outermost). * @param sortfunc Sort comparison function to use. * @param hndl Optional Handle to pass through the comparison calls. - * @noreturn */ -native SortCustom2D(array[][], array_size, SortFunc2D:sortfunc, Handle:hndl=INVALID_HANDLE); +native void SortCustom2D(any[][] array, int array_size, SortFunc2D sortfunc, Handle hndl=INVALID_HANDLE); /** * Sort an ADT Array. Specify the type as Integer, Float, or String. @@ -146,9 +141,8 @@ native SortCustom2D(array[][], array_size, SortFunc2D:sortfunc, Handle:hndl=INVA * @param array Array Handle to sort * @param order Sort order to use, same as other sorts. * @param type Data type stored in the ADT Array - * @noreturn */ -native SortADTArray(Handle:array, SortOrder:order, SortType:type); +native void SortADTArray(Handle array, SortOrder order, SortType type); /** * Sort comparison function for ADT Array elements. Function provides you with @@ -171,6 +165,5 @@ typedef SortFuncADTArray = function int (int index1, int index2, Handle array, H * @param array Array Handle to sort * @param sortfunc Sort comparison function to use * @param hndl Optional Handle to pass through the comparison calls. - * @noreturn */ -native SortADTArrayCustom(Handle:array, SortFuncADTArray:sortfunc, Handle:hndl=INVALID_HANDLE); +native void SortADTArrayCustom(Handle array, SortFuncADTArray sortfunc, Handle hndl=INVALID_HANDLE); diff --git a/plugins/include/textparse.inc b/plugins/include/textparse.inc index 7a88647a..e8320329 100644 --- a/plugins/include/textparse.inc +++ b/plugins/include/textparse.inc @@ -45,7 +45,7 @@ /** * Parse result directive. */ -enum SMCResult: +enum SMCResult { SMCParse_Continue, /**< Continue parsing */ SMCParse_Halt, /**< Stop parsing here */ @@ -55,7 +55,7 @@ enum SMCResult: /** * Parse error codes. */ -enum SMCError: +enum SMCError { SMCError_Okay = 0, /**< No error */ SMCError_StreamOpen, /**< Stream failed to open */ @@ -109,7 +109,6 @@ typedef SMC_EndSection = function SMCResult (SMCParser smc); // @param smc The SMCParser. // @param halted True if abnormally halted, false otherwise. // @param failed True if parsing failed, false otherwise. -// @noreturn typedef SMC_ParseEnd = function void (SMCParser smc, bool halted, bool failed); // Callback for whenever a new line of text is about to be parsed. @@ -212,7 +211,6 @@ native bool SMC_GetErrorString(SMCError error, char[] buffer, int buf_max); * * @param smc Handle to an SMC Parse. * @param func SMC_ParseStart function. - * @noreturn * @error Invalid or corrupt Handle. */ native SMC_SetParseStart(Handle smc, SMC_ParseStart func); @@ -222,7 +220,6 @@ native SMC_SetParseStart(Handle smc, SMC_ParseStart func); * * @param smc Handle to an SMC Parse. * @param func SMC_ParseEnd function. - * @noreturn * @error Invalid or corrupt Handle. */ native SMC_SetParseEnd(Handle smc, SMC_ParseEnd func); diff --git a/plugins/include/timers.inc b/plugins/include/timers.inc index f6b7f95c..16762639 100644 --- a/plugins/include/timers.inc +++ b/plugins/include/timers.inc @@ -87,7 +87,7 @@ typeset Timer * @return Handle to the timer object. You do not need to call CloseHandle(). * If the timer could not be created, INVALID_HANDLE will be returned. */ -native Handle:CreateTimer(Float:interval, Timer:func, any:data=INVALID_HANDLE, flags=0); +native Handle CreateTimer(float interval, Timer func, any data=INVALID_HANDLE, int flags=0); /** * Kills a timer. Use this instead of CloseHandle() if you need more options. @@ -95,10 +95,9 @@ native Handle:CreateTimer(Float:interval, Timer:func, any:data=INVALID_HANDLE, f * @param timer Timer Handle to kill. * @param autoClose If autoClose is true, the data that was passed to CreateTimer() will * be closed as a handle if TIMER_DATA_HNDL_CLOSE was not specified. - * @noreturn * @error Invalid handles will cause a run time error. */ -native KillTimer(Handle:timer, bool:autoClose=false); +native void KillTimer(Handle timer, bool autoClose=false); /** * Manually triggers a timer so its function will be called. @@ -106,9 +105,8 @@ native KillTimer(Handle:timer, bool:autoClose=false); * @param timer Timer Handle to trigger. * @param reset If reset is true, the elapsed time counter is reset * so the full interval must pass again. - * @noreturn */ -native TriggerTimer(Handle:timer, bool:reset=false); +native void TriggerTimer(Handle timer, bool reset=false); /** * Returns the simulated game time. @@ -121,7 +119,7 @@ native TriggerTimer(Handle:timer, bool:reset=false); * * @return Time based on the game tick count. */ -native Float:GetTickedTime(); +native float GetTickedTime(); /** * Returns an estimate of the time left before the map ends. If the server @@ -132,7 +130,7 @@ native Float:GetTickedTime(); * value is less than 0, the time limit is infinite. * @return True if the operation is supported, false otherwise. */ -native bool:GetMapTimeLeft(&timeleft); +native bool GetMapTimeLeft(int &timeleft); /** * Retrieves the current map time limit. If the server has not processed any @@ -143,7 +141,7 @@ native bool:GetMapTimeLeft(&timeleft); * limit, or 0 if there is no time limit set. * @return True on success, false if operation is not supported. */ -native bool:GetMapTimeLimit(&time); +native bool GetMapTimeLimit(int &time); /** * Extends the map time limit in a way that will notify all plugins. @@ -153,7 +151,7 @@ native bool:GetMapTimeLimit(&time); * If 0, the map will be set to have no time limit. * @return True on success, false if operation is not supported. */ -native bool:ExtendMapTimeLimit(time); +native bool ExtendMapTimeLimit(int time); /** * Returns the number of seconds in between game server ticks. @@ -162,7 +160,7 @@ native bool:ExtendMapTimeLimit(time); * * @return Number of seconds in between ticks. */ -native Float:GetTickInterval(); +native float GetTickInterval(); /** * Notification that the map's time left has changed via a change in the time @@ -189,7 +187,7 @@ forward void OnMapTimeLeftChanged(); * * @return True if the server is ticking, false otherwise. */ -native bool:IsServerProcessing(); +native bool IsServerProcessing(); /** * Creates a timer associated with a new datapack, and returns the datapack. @@ -203,10 +201,9 @@ native bool:IsServerProcessing(); * @param flags Timer flags. * @return Handle to the timer object. You do not need to call CloseHandle(). */ -stock Handle:CreateDataTimer(Float:interval, Timer:func, &Handle:datapack, flags=0) +stock Handle CreateDataTimer(float interval, Timer func, Handle &datapack, int flags=0) { - datapack = CreateDataPack(); + datapack = new DataPack(); flags |= TIMER_DATA_HNDL_CLOSE; return CreateTimer(interval, func, datapack, flags); } - diff --git a/plugins/include/topmenus.inc b/plugins/include/topmenus.inc index 8227f763..a4cb7939 100644 --- a/plugins/include/topmenus.inc +++ b/plugins/include/topmenus.inc @@ -40,7 +40,7 @@ /** * Actions a top menu will take on an topobj. */ -enum TopMenuAction: +enum TopMenuAction { /** * An option is being drawn for a menu (or for sorting purposes). @@ -92,7 +92,7 @@ enum TopMenuAction: /** * Top menu topobj types. */ -enum TopMenuObjectType: +enum TopMenuObjectType { TopMenuObject_Category = 0, /**< Category (sub-menu branching from root) */ TopMenuObject_Item = 1 /**< Item on a sub-menu */ @@ -101,7 +101,7 @@ enum TopMenuObjectType: /** * Top menu starting positions for display. */ -enum TopMenuPosition: +enum TopMenuPosition { TopMenuPosition_Start = 0, /**< Start/root of the menu */ TopMenuPosition_LastRoot = 1, /**< Last position in the root menu */ @@ -111,7 +111,7 @@ enum TopMenuPosition: /** * Top menu topobj tag for type checking. */ -enum TopMenuObject: +enum TopMenuObject { INVALID_TOPMENUOBJECT = 0, }; @@ -125,7 +125,6 @@ enum TopMenuObject: * @param param Extra parameter (if used). * @param buffer Output buffer (if used). * @param maxlength Output buffer (if used). - * @noreturn */ typedef TopMenuHandler = function void ( TopMenu topmenu, @@ -351,7 +350,6 @@ native int GetTopMenuObjName(Handle topmenu, TopMenuObject topobj, char[] buffer * * @param topmenu TopMenu Handle. * @param topobj TopMenuObject ID. - * @noreturn * @error Invalid TopMenu Handle. */ native void RemoveFromTopMenu(Handle topmenu, TopMenuObject topobj); @@ -397,7 +395,6 @@ native TopMenuObject FindTopMenuCategory(Handle topmenu, const char[] name); * @param topmenu TopMenu Handle. * @param cache_titles Cache the menu titles and don't call the handler with * TopMenuAction_DisplayTitle everytime the menu is drawn? - * @noreturn * @error Invalid TopMenu Handle */ native void SetTopMenuTitleCaching(Handle topmenu, bool cache_titles); @@ -423,7 +420,7 @@ public Extension __ext_topmenus = }; #if !defined REQUIRE_EXTENSIONS -public __ext_topmenus_SetNTVOptional() +public void __ext_topmenus_SetNTVOptional() { MarkNativeAsOptional("CreateTopMenu"); MarkNativeAsOptional("LoadTopMenuConfig"); diff --git a/plugins/include/usermessages.inc b/plugins/include/usermessages.inc index 7445c0b9..ee6042e2 100644 --- a/plugins/include/usermessages.inc +++ b/plugins/include/usermessages.inc @@ -68,13 +68,13 @@ enum UserMessageType * * @return The supported usermessage type. */ -native UserMessageType:GetUserMessageType(); +native UserMessageType GetUserMessageType(); stock Protobuf UserMessageToProtobuf(Handle msg) { if (GetUserMessageType() != UM_Protobuf) return null; - return Protobuf:msg; + return view_as(msg); } // Make sure to only call this on writable buffers (eg from StartMessage). @@ -82,7 +82,7 @@ stock BfWrite UserMessageToBfWrite(Handle msg) { if (GetUserMessageType() == UM_Protobuf) return null; - return BfWrite:msg; + return view_as(msg); } // Make sure to only call this on readable buffers (eg from a message hook). @@ -90,7 +90,7 @@ stock BfWrite UserMessageToBfRead(Handle msg) { if (GetUserMessageType() == UM_Protobuf) return null; - return BfRead:msg; + return view_as(msg); } /** @@ -99,7 +99,7 @@ stock BfWrite UserMessageToBfRead(Handle msg) * @param msg String containing message name (case sensitive). * @return A message index, or INVALID_MESSAGE_ID on failure. */ -native UserMsg:GetUserMessageId(const String:msg[]); +native UserMsg GetUserMessageId(const char[] msg); /** * Retrieves the name of a message by ID. @@ -109,7 +109,7 @@ native UserMsg:GetUserMessageId(const String:msg[]); * @param maxlength Maximum length of string buffer. * @return True if message index is valid, false otherwise. */ -native bool:GetUserMessageName(UserMsg:msg_id, String:msg[], maxlength); +native bool GetUserMessageName(UserMsg msg_id, char[] msg, int maxlength); /** * Starts a usermessage (network message). @@ -125,7 +125,7 @@ native bool:GetUserMessageName(UserMsg:msg_id, String:msg[], maxlength); * @error Invalid message name, unable to start a message, invalid client, * or client not connected. */ -native Handle:StartMessage(String:msgname[], clients[], numClients, flags=0); +native Handle StartMessage(char[] msgname, int[] clients, int numClients, int flags=0); /** * Starts a usermessage (network message). @@ -141,14 +141,12 @@ native Handle:StartMessage(String:msgname[], clients[], numClients, flags=0); * @error Invalid message name, unable to start a message, invalid client, * or client not connected. */ -native Handle:StartMessageEx(UserMsg:msg, clients[], numClients, flags=0); +native Handle StartMessageEx(UserMsg msg, int[] clients, int numClients, int flags=0); /** * Ends a previously started user message (network message). - * - * @noreturn */ -native EndMessage(); +native void EndMessage(); /** * Hook function types for user messages. @@ -190,7 +188,6 @@ typeset MsgHook * * @param msg_id Message index. * @param sent True if message was sent, false if blocked. - * @noreturn */ typedef MsgPostHook = function void (UserMsg msg_id, bool sent); @@ -203,10 +200,9 @@ typedef MsgPostHook = function void (UserMsg msg_id, bool sent); * allowing the user to block the message. Otherwise, * the hook is normal and ignores the return value. * @param post Notification function. - * @noreturn * @error Invalid message index. */ -native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false, MsgPostHook:post=INVALID_FUNCTION); +native void HookUserMessage(UserMsg msg_id, MsgHook hook, bool intercept=false, MsgPostHook post=INVALID_FUNCTION); /** * Removes one usermessage hook. @@ -214,10 +210,9 @@ native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false, MsgPo * @param msg_id Message index. * @param hook Function used for the hook. * @param intercept Specifies whether the hook was an intercept hook or not. - * @noreturn * @error Invalid message index. */ -native UnhookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false); +native void UnhookUserMessage(UserMsg msg_id, MsgHook hook, bool intercept=false); /** * Starts a usermessage (network message) that broadcasts to all clients. @@ -228,11 +223,11 @@ native UnhookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false); * @return A handle to a bf_write bit packing structure, or * INVALID_HANDLE on failure. */ -stock Handle:StartMessageAll(String:msgname[], flags=0) +stock Handle StartMessageAll(char[] msgname, int flags=0) { - new total = 0; - new clients[MaxClients]; - for (new i=1; i<=MaxClients; i++) + int total = 0; + int[] clients = new int[MaxClients]; + for (int i=1; i<=MaxClients; i++) { if (IsClientConnected(i)) { @@ -252,9 +247,9 @@ stock Handle:StartMessageAll(String:msgname[], flags=0) * @return A handle to a bf_write bit packing structure, or * INVALID_HANDLE on failure. */ -stock Handle:StartMessageOne(String:msgname[], client, flags=0) +stock Handle StartMessageOne(char[] msgname, int client, int flags=0) { - new players[1]; + int players[1]; players[0] = client; diff --git a/plugins/include/vector.inc b/plugins/include/vector.inc index ae1ede62..a6aea087 100644 --- a/plugins/include/vector.inc +++ b/plugins/include/vector.inc @@ -42,7 +42,7 @@ * @param squared If true, the result will be squared (for optimization). * @return Vector length (magnitude). */ -native Float:GetVectorLength(const Float:vec[3], bool:squared=false); +native float GetVectorLength(const float vec[3], bool squared=false); /** * Calculates the distance between two vectors. @@ -52,7 +52,7 @@ native Float:GetVectorLength(const Float:vec[3], bool:squared=false); * @param squared If true, the result will be squared (for optimization). * @return Vector distance. */ -native Float:GetVectorDistance(const Float:vec1[3], const Float:vec2[3], bool:squared=false); +native float GetVectorDistance(const float vec1[3], const float vec2[3], bool squared=false); /** * Calculates the dot product of two vectors. @@ -61,7 +61,7 @@ native Float:GetVectorDistance(const Float:vec1[3], const Float:vec2[3], bool:sq * @param vec2 Second vector. * @return Dot product of the two vectors. */ -native Float:GetVectorDotProduct(const Float:vec1[3], const Float:vec2[3]); +native float GetVectorDotProduct(const float vec1[3], const float vec2[3]); /** * Computes the cross product of two vectors. Any input array can be the same @@ -70,9 +70,8 @@ native Float:GetVectorDotProduct(const Float:vec1[3], const Float:vec2[3]); * @param vec1 First vector. * @param vec2 Second vector. * @param result Resultant vector. - * @noreturn */ -native GetVectorCrossProduct(const Float:vec1[3], const Float:vec2[3], Float:result[3]); +native void GetVectorCrossProduct(const float vec1[3], const float vec2[3], float result[3]); /** * Normalizes a vector. The input array can be the same as the output array. @@ -81,7 +80,7 @@ native GetVectorCrossProduct(const Float:vec1[3], const Float:vec2[3], Float:res * @param result Resultant vector. * @return Vector length. */ -native Float:NormalizeVector(const Float:vec[3], Float:result[3]); +native float NormalizeVector(const float vec[3], float result[3]); /** * Returns vectors in the direction of an angle. @@ -90,18 +89,16 @@ native Float:NormalizeVector(const Float:vec[3], Float:result[3]); * @param fwd Forward vector buffer or NULL_VECTOR. * @param right Right vector buffer or NULL_VECTOR. * @param up Up vector buffer or NULL_VECTOR. - * @noreturn */ -native GetAngleVectors(const Float:angle[3], Float:fwd[3], Float:right[3], Float:up[3]); +native void GetAngleVectors(const float angle[3], float fwd[3], float right[3], float up[3]); /** * Returns angles from a vector. * * @param vec Vector. * @param angle Angle buffer. - * @noreturn */ -native GetVectorAngles(const Float:vec[3], Float:angle[3]); +native void GetVectorAngles(const float vec[3], float angle[3]); /** * Returns direction vectors from a vector. @@ -109,9 +106,8 @@ native GetVectorAngles(const Float:vec[3], Float:angle[3]); * @param vec Vector. * @param right Right vector buffer or NULL_VECTOR. * @param up Up vector buffer or NULL_VECTOR. - * @noreturn */ -native GetVectorVectors(const Float:vec[3], Float:right[3], Float:up[3]); +native void GetVectorVectors(const float vec[3], float right[3], float up[3]); /** * Adds two vectors. It is safe to use either input buffer as an output @@ -120,9 +116,8 @@ native GetVectorVectors(const Float:vec[3], Float:right[3], Float:up[3]); * @param vec1 First vector. * @param vec2 Second vector. * @param result Result buffer. - * @noreturn */ -stock AddVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3]) +stock void AddVectors(const float vec1[3], const float vec2[3], float result[3]) { result[0] = vec1[0] + vec2[0]; result[1] = vec1[1] + vec2[1]; @@ -136,9 +131,8 @@ stock AddVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3]) * @param vec1 First vector. * @param vec2 Second vector to subtract from first. * @param result Result buffer. - * @noreturn */ -stock SubtractVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3]) +stock void SubtractVectors(const float vec1[3], const float vec2[3], float result[3]) { result[0] = vec1[0] - vec2[0]; result[1] = vec1[1] - vec2[1]; @@ -150,9 +144,8 @@ stock SubtractVectors(const Float:vec1[3], const Float:vec2[3], Float:result[3]) * * @param vec Vector. * @param scale Scale value. - * @noreturn */ -stock ScaleVector(Float:vec[3], Float:scale) +stock void ScaleVector(float vec[3], float scale) { vec[0] *= scale; vec[1] *= scale; @@ -163,9 +156,8 @@ stock ScaleVector(Float:vec[3], Float:scale) * Negatives a vector. * * @param vec Vector. - * @noreturn */ -stock NegateVector(Float:vec[3]) +stock void NegateVector(float vec[3]) { vec[0] = -vec[0]; vec[1] = -vec[1]; @@ -178,9 +170,8 @@ stock NegateVector(Float:vec[3]) * @param pt1 First point (to be subtracted from the second). * @param pt2 Second point. * @param output Output vector buffer. - * @noreturn */ -stock MakeVectorFromPoints(const Float:pt1[3], const Float:pt2[3], Float:output[3]) +stock void MakeVectorFromPoints(const float pt1[3], const float pt2[3], float output[3]) { output[0] = pt2[0] - pt1[0]; output[1] = pt2[1] - pt1[1];