diff --git a/bin/spcomp b/bin/spcomp index c4ad26c..f52b14d 100755 Binary files a/bin/spcomp and b/bin/spcomp differ diff --git a/src/include/admin.inc b/src/include/admin.inc index ece7259..b367eb5 100644 --- a/src/include/admin.inc +++ b/src/include/admin.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: admin.inc 1409 2007-09-10 23:38:58Z dvander $ + * Version: $Id$ */ #if defined _admin_included diff --git a/src/include/adminmenu.inc b/src/include/adminmenu.inc index 9385055..c417b4c 100644 --- a/src/include/adminmenu.inc +++ b/src/include/adminmenu.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: adminmenu.inc 1838 2008-01-04 16:05:26Z dvander $ + * Version: $Id$ */ #if defined _adminmenu_included diff --git a/src/include/adt.inc b/src/include/adt.inc index 185395c..75051bf 100644 --- a/src/include/adt.inc +++ b/src/include/adt.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: adt.inc 2093 2008-04-24 10:25:27Z damagedsoul $ + * Version: $Id$ */ #if defined _adt_included @@ -37,3 +37,4 @@ #include #include +#include diff --git a/src/include/adt_array.inc b/src/include/adt_array.inc index 65c8231..b76991c 100644 --- a/src/include/adt_array.inc +++ b/src/include/adt_array.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: adt_array.inc 2093 2008-04-24 10:25:27Z damagedsoul $ + * Version: $Id$ */ #if defined _adt_array_included @@ -85,8 +85,8 @@ native ClearArray(Handle:array); * no relation to the original. You MUST close it. * * @param array Array handle to be cloned - * @return New handle to the cloned array object - * @error Invalid Handle + * @return New handle to the cloned array object + * @error Invalid Handle */ native Handle:CloneArray(Handle:array); diff --git a/src/include/adt_stack.inc b/src/include/adt_stack.inc new file mode 100644 index 0000000..54029c3 --- /dev/null +++ b/src/include/adt_stack.inc @@ -0,0 +1,154 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This file is part of the SourceMod/SourcePawn SDK. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +#if defined _adt_stack_included + #endinput +#endif +#define _adt_stack_included + +/** + * Creates a stack structure. A stack is a LIFO (last in, first out) + * vector (array) of items. It has O(1) insertion and O(1) removal. + * + * Stacks have two operations: Push (adding an item) and Pop (removes + * items in reverse-push order). + * + * The contents of the stack are uniform; i.e. storing a string and then + * retrieving it as an integer is NOT the same as StringToInt()! + * + * The "blocksize" determines how many cells each slot has; it cannot + * be changed after creation. + * + * @param blocksize The number of cells each entry in the stack can + * hold. For example, 32 cells is equivalent to: + * new Array[X][32] + * @return New stack Handle. + */ +native Handle:CreateStack(blocksize=1); + +/** + * Pushes a value onto the end of the stack, adding a new index. + * + * This may safely be used even if the stack has a blocksize + * greater than 1. + * + * @param stack Stack Handle. + * @param value Value to push. + * @noreturn + * @error Invalid Handle or out of memory. + */ +native PushStackCell(Handle:stack, any:value); + +/** + * Pushes a string onto the end of a stack, truncating it if it is + * too big. + * + * @param stack Stack Handle. + * @param value String to push. + * @noreturn + * @error Invalid Handle or out of memory. + */ +native PushStackString(Handle:stack, const String:value[]); + +/** + * Pushes an array of cells onto the end of a stack. The cells + * are pushed as a block (i.e. the entire array takes up one stack slot), + * rather than pushing each cell individually. + * + * @param stack Stack Handle. + * @param values Block of values to copy. + * @param size If not set, the number of elements copied from the array + * will be equal to the blocksize. If set higher than the + * blocksize, the operation will be truncated. + * @noreturn + * @error Invalid Handle or out of memory. + */ +native PushStackArray(Handle:stack, const any:values[], size=-1); + +/** + * Pops a cell value from a stack. + * + * @param stack Stack Handle. + * @param value Variable to store the value. + * @param block Optionally specify which block to read from + * (useful if the blocksize > 0). + * @param asChar Optionally read as a byte instead of a cell. + * @return True on success, false if the stack is empty. + * @error Invalid Handle. + */ +native bool:PopStackCell(Handle:stack, &any:value, block=0, bool:asChar=false); + +/** + * Pops a string value from a stack. + * + * @param stack Stack Handle. + * @param buffer Buffer to store string. + * @param maxlength Maximum size of the buffer. + * @return True on success, false if the stack is empty. + * @error Invalid Handle. + */ +native bool:PopStackString(Handle:stack, String:buffer[], maxlength, &written=0); + +/** + * Pops an array of cells from a stack. + * + * @param stack Stack Handle. + * @param buffer Buffer to store the array in. + * @param size If not set, assumes the buffer size is equal to the + * blocksize. Otherwise, the size passed is used. + * @return True on success, false if the stack is empty. + * @error Invalid Handle. + */ +native bool:PopStackArray(Handle:stack, any:buffer[], size=-1); + +/** + * Checks if a stack is empty. + * + * @param stack Stack Handle. + * @return True if empty, false if not empty. + * @error Invalid Handle. + */ +native bool:IsStackEmpty(Handle:stack); + +/** + * Pops a value off a stack, ignoring it completely. + * + * @param stack Stack Handle. + * @return True if something was popped, false otherwise. + * @error Invalid Handle. + */ +stock PopStack(Handle:stack) +{ + new value; + + return PopStackCell(stack, value); +} diff --git a/src/include/adt_trie.inc b/src/include/adt_trie.inc index 37fcee1..516c794 100644 --- a/src/include/adt_trie.inc +++ b/src/include/adt_trie.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: adt_trie.inc 2093 2008-04-24 10:25:27Z damagedsoul $ + * Version: $Id$ */ #if defined _adt_trie_included diff --git a/src/include/banning.inc b/src/include/banning.inc index c3431eb..038b113 100644 --- a/src/include/banning.inc +++ b/src/include/banning.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: banning.inc 1456 2007-09-21 14:56:18Z dvander $ + * Version: $Id$ */ #if defined _banning_included @@ -144,7 +144,7 @@ native bool:BanIdentity(const String:identity[], * * @param identity String to unban (ip or authstring). * @param flags Flags (only IP and AUTHID are valid flags here). - * @param command Command strnig to identify the source. If this is left + * @param command Command string to identify the source. If this is left * empty, then OnRemoveBan will not be called. * @param source A source value that could be interpreted as a player * index of any sort (not actually checked by Core). diff --git a/src/include/bitbuffer.inc b/src/include/bitbuffer.inc index b8741d3..fd1c18e 100644 --- a/src/include/bitbuffer.inc +++ b/src/include/bitbuffer.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: bitbuffer.inc 2038 2008-04-11 17:22:19Z damagedsoul $ + * Version: $Id$ */ #if defined _bitbuffer_included diff --git a/src/include/clientprefs.inc b/src/include/clientprefs.inc new file mode 100644 index 0000000..723bb93 --- /dev/null +++ b/src/include/clientprefs.inc @@ -0,0 +1,238 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This file is part of the SourceMod/SourcePawn SDK. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +#if defined _clientprefs_included + #endinput +#endif +#define _clientprefs_included + +/** + * Cookie access types for client viewing + */ +enum CookieAccess +{ + CookieAccess_Public, /**< Visible and Changeable by users */ + CookieAccess_Protected, /**< Read only to users */ + CookieAccess_Private, /**< Completely hidden cookie */ +}; + +/** + * Cookie Prefab menu types + */ +enum CookieMenu +{ + CookieMenu_YesNo, /**< Yes/No menu with "yes"/"no" results saved into the cookie */ + CookieMenu_YesNo_Int, /**< Yes/No menu with 1/0 saved into the cookie */ + CookieMenu_OnOff, /**< On/Off menu with "on"/"off" results saved into the cookie */ + CookieMenu_OnOff_Int, /**< On/Off menu with 1/0 saved into the cookie */ +}; + +enum CookieMenuAction +{ + /** + * An option is being drawn for a menu. + * + * INPUT : Client index and data if available. + * OUTPUT: Buffer for rendering, maxlength of buffer. + */ + CookieMenuAction_DisplayOption = 0, + + /** + * A menu option has been selected. + * + * INPUT : Client index and any data if available. + */ + CookieMenuAction_SelectOption = 1, +}; + +/** + * Note: + * + * A successful return value/result on any client prefs native only guarantees that the local cache has been updated. + * Database connection problems can still prevent the data from being permanently saved. Connection problems will be logged as + * errors by the clientprefs extension. + */ + +/** + * Creates a new Client preference cookie. + * + * @param name Name of the new preference cookie. + * @param description Optional description of the preference cookie. + * @param access What CookieAccess level to assign to this cookie. + * @return A handle to the newly created cookie. If the cookie already 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); + +/** + * Searches for a Client preference cookie. + * + * @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[]); + +/** + * Set the value of a Client preference cookie. + * + * @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[]); + +/** + * Retrieve the value of a Client preference cookie. + * + * @param client Client index. + * @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); + +/** + * Checks if a clients cookies have been loaded from the database. + * + * @param client Client index. + * @return True if loaded, false otherwise. + * @error Invalid client index. + */ +native bool:AreClientCookiesCached(client); + +/** + * Called once a client's saved cookies have been loaded from the database. + * + * @param client Client index. + */ +forward OnClientCookiesCached(client); + +/** + * Cookie Menu Callback prototype + * + * @param client Client index. + * @param action CookeMenuAction being performed. + * @param data Info data passed. + * @param buffer Outbut buffer. + * @param maxlen Max length of the output buffer. + */ +functag public CookieMenuHandler(client, CookieMenuAction:action, any:info, String:buffer[], maxlen); + +/** + * Add a new prefab item to the client cookie settings menu. + * + * Note: This handles everything automatically and does not require a callback + * + * @param cookie Client preference cookie handle. + * @param type A CookieMenu prefab menu type. + * @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=CookieMenuHandler:-1, info=0); + +/** + * Adds a new item to the client cookie settings menu. + * + * Note: This only adds the top level menu item. You need to handle any submenus from the callback. + * + * @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[]); + +/** + * Displays the settings menu to a client. + * + * @param client Client index. + * @noreturn + */ +native ShowCookieMenu(client); + +/** + * Gets a cookie iterator. Must be freed with CloseHandle(). + * + * @return A new cookie iterator. + */ +native Handle:GetCookieIterator(); + +/** + * Reads a cookie iterator, then advances to the next cookie if any. + * + * @param iter Cookie iterator Handle. + * @param name Name buffer. + * @param nameLen Name buffer size. + * @param access Access level of the cookie. + * @param desc Cookie description buffer. + * @param descLen Cookie description buffer size. + * @param + * @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); + +/** + * Returns the access level of a cookie + * + * @param cookie Client preference cookie handle. + * @return CookieAccess access level. + * @error Invalid cookie handle. + */ +native CookieAccess:GetCookieAccess(Handle:cookie); + +/** + * Do not edit below this line! + */ +public Extension:__ext_clientprefs = +{ + name = "Client Preferences", + file = "clientprefs.ext", + autoload = 1, +#if defined REQUIRE_EXTENSIONS + required = 1, +#else + required = 0, +#endif +}; diff --git a/src/include/clients.inc b/src/include/clients.inc index eb59667..98d5808 100644 --- a/src/include/clients.inc +++ b/src/include/clients.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: clients.inc 2362 2008-07-06 00:44:56Z dvander $ + * Version: $Id$ */ #if defined _clients_included @@ -45,11 +45,23 @@ enum NetFlow NetFlow_Both, /**< Both values added together */ }; -#define MAXPLAYERS 64 /**< Maximum number of players that can be in server */ +/** + * MAXPLAYERS is not the same as MaxClients. + * MAXPLAYERS is a hardcoded value as an upper limit. MaxClients changes based on the server. + * + * Both GetMaxClients() and MaxClients are only available once the map is loaded, and should + * not be used in OnPluginStart(). + */ + +#define MAXPLAYERS 64 /**< Maximum number of players SourceMod supports */ #define MAX_NAME_LENGTH 32 /**< Maximum buffer required to store a client name */ +public const MaxClients; /**< Maximum number of players the server supports (dynamic) */ + /** - * Called on client connection. + * Called on client connection. If you return true, the client will be allowed in the server. + * If you return false (or return nothing), the client will be rejected. If the client is + * rejected by this forward or any other, OnClientDisconnect will not be called. * * @param client Client index. * @param rejectmsg Buffer to store the rejection message when the connection is refused. @@ -58,6 +70,14 @@ enum NetFlow */ forward bool:OnClientConnect(client, String:rejectmsg[], maxlen); +/** + * Called once a client successfully connects. This callback is paired with OnClientDisconnect. + * + * @param client Client index. + * @noreturn + */ +forward OnClientConnected(client); + /** * Called when a client is entering the game. * @@ -169,10 +189,16 @@ forward OnClientPostAdminFilter(client); forward OnClientPostAdminCheck(client); /** + * This function will be deprecated in a future release. Use the MaxClients variable instead. + * * Returns the maximum number of clients allowed on the server. This may * return 0 if called before OnMapStart(), and thus should not be called * in OnPluginStart(). * + * You should not globally cache the value to GetMaxClients() because it can change from + * SourceTV or TF2's arena mode. Use the "MaxClients" dynamic variable documented at the + * top of this file. + * * @return Maximum number of clients allowed. */ native GetMaxClients(); @@ -682,3 +708,17 @@ native KickClientEx(client, const String:format[]="", any:...); */ native ChangeClientTeam(client, team); +/** + * Returns the clients unique serial identifier. + * + * @return Serial number. + */ +native GetClientSerial(client); + +/** + * Returns the client index by its serial number. + * + * @return Client index, or 0 for invalid serial. + */ +native GetClientFromSerial(serial); + diff --git a/src/include/commandfilters.inc b/src/include/commandfilters.inc index f00a654..1143627 100644 --- a/src/include/commandfilters.inc +++ b/src/include/commandfilters.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: commandfilters.inc 2080 2008-04-19 00:44:11Z dvander $ + * Version: $Id$ */ #if defined _commandfilters_included diff --git a/src/include/console.inc b/src/include/console.inc index 578054a..b3e3d42 100644 --- a/src/include/console.inc +++ b/src/include/console.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: console.inc 2482 2008-09-02 03:58:23Z dvander $ + * Version: $Id$ */ #if defined _console_included @@ -286,6 +286,24 @@ native ShowActivity(client, const String:format[], any:...); */ native ShowActivityEx(client, const String:tag[], const String:format[], any:...); +/** + * Given an originating client and a target client, returns the string + * that describes the originating client according to the sm_show_activity cvar. + * + * For example, "ADMIN", "PLAYER", or a player's name could be placed in this buffer. + * + * @param client Originating client; may be 0 for server console. + * @param target Targeted client. + * @param namebuf Name buffer. + * @param maxlength Maximum size of the name buffer. + * @return True if activity should be shown. False otherwise. In either + * case, the name buffer is filled. The return value can be used + * to broadcast a "safe" name to all players regardless of the + * sm_show_activity filters. + * @error Invalid client index or client not connected. + */ +native FormatActivitySource(client, target, const String:namebuf[], maxlength); + /** * Called when a server-only command is invoked. * @@ -293,7 +311,7 @@ native ShowActivityEx(client, const String:tag[], const String:format[], any:... * @return An Action value. Not handling the command * means that Source will report it as "not found." */ -functag SrvCmd Action:public(args); +functag public Action:SrvCmd(args); /** * Creates a server-only console command, or hooks an already existing one. @@ -317,7 +335,7 @@ native RegServerCmd(const String:cmd[], SrvCmd:callback, const String:descriptio * @return An Action value. Not handling the command * means that Source will report it as "not found." */ -functag ConCmd Action:public(client, args); +functag public Action:ConCmd(client, args); /** * Creates a console command, or hooks an already existing one. @@ -421,7 +439,7 @@ native Handle:FindConVar(const String:name[]); * @param newValue String containing the new value of the convar. * @noreturn */ -functag ConVarChanged public(Handle:convar, const String:oldValue[], const String:newValue[]); +functag public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[]); /** * Creates a hook for when a console variable's value is changed. @@ -455,6 +473,10 @@ native bool:GetConVarBool(Handle:convar); /** * Sets the boolean value of a console variable. * + * Note: The replicate and notify params are ignored on the engines for Episode 2/Orange Box + * and Left 4 Dead. These engines automatically replicates and notifies as soon as the convar + * is changed. + * * @param convar Handle to the convar. * @param value New boolean value. * @param replicate If set to true, the new convar value will be set on all clients. @@ -479,6 +501,10 @@ native GetConVarInt(Handle:convar); /** * Sets the integer value of a console variable. * + * Note: The replicate and notify params are ignored on the engines for Episode 2/Orange Box + * and Left 4 Dead. These engines automatically replicates and notifies as soon as the convar + * is changed. + * * @param convar Handle to the convar. * @param value New integer value. * @param replicate If set to true, the new convar value will be set on all clients. @@ -503,6 +529,10 @@ native Float:GetConVarFloat(Handle:convar); /** * Sets the floating point value of a console variable. * + * Note: The replicate and notify params are ignored on the engines for Episode 2/Orange Box + * and Left 4 Dead. These engines automatically replicates and notifies as soon as the convar + * is changed. + * * @param convar Handle to the convar. * @param value New floating point value. * @param replicate If set to true, the new convar value will be set on all clients. @@ -529,6 +559,10 @@ native GetConVarString(Handle:convar, String:value[], maxlength); /** * Sets the string value of a console variable. * + * Note: The replicate and notify params are ignored on the engines for Episode 2/Orange Box + * and Left 4 Dead. These engines automatically replicates and notifies as soon as the convar + * is changed. + * * @param convar Handle to the convar. * @param value New string value. * @param replicate If set to true, the new convar value will be set on all clients. @@ -544,6 +578,10 @@ native SetConVarString(Handle:convar, const String:value[], bool:replicate=false /** * Resets the console variable to its default value. * + * Note: The replicate and notify params are ignored on the engines for Episode 2/Orange Box + * and Left 4 Dead. These engines automatically replicates and notifies as soon as the convar + * is changed. + * * @param convar Handle to the convar. * @param replicate If set to true, the new convar value will be set on all clients. * This will only work if the convar has the FCVAR_REPLICATED flag @@ -777,3 +815,23 @@ native bool:FindNextConCommand(Handle:search, String:buffer[], max_size, &bool:i * @error Invalid client index, client not in game, or client is fake */ native bool:SendConVarValue(client, Handle:convar, const String:value[]); + +/** + * Appends a string to Valve's sv_tags convar and makes sure it remains after mapchanges. + * + * Note: Tags are automatically removed on plugin unload + * + * @param tag Tag string to append. + * @noreturn + */ +native AddServerTag(const String:tag[]); + +/** + * Removes a string from valve's sv_tags convar. + * + * Note: You can only remove tags created by you. + * + * @param tag Tag string to remove. + * @noreturn + */ +native RemoveServerTag(const String:tag[]); diff --git a/src/include/core.inc b/src/include/core.inc index 76b792f..751a849 100644 --- a/src/include/core.inc +++ b/src/include/core.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: core.inc 2243 2008-06-02 05:04:02Z dvander $ + * Version: $Id$ */ #if defined _core_included @@ -37,7 +37,9 @@ #include -#define SOURCEMOD_PLUGINAPI_VERSION 3 +/** If this gets changed, you need to update Core's check. */ +#define SOURCEMOD_PLUGINAPI_VERSION 5 + struct PlVers { version, @@ -136,6 +138,25 @@ struct SharedPlugin 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 */ +/** + * Horrible compatibility shim. + */ +public Extension:__ext_core = +{ + name = "Core", + file = "core", + autoload = 0, + required = 0, +}; + +native VerifyCoreVersion(); + +public __ext_core_SetNTVOptional() +{ + VerifyCoreVersion(); +} + + #define AUTOLOAD_EXTENSIONS #define REQUIRE_EXTENSIONS #define REQUIRE_PLUGIN diff --git a/src/include/cstrike.inc b/src/include/cstrike.inc index eb5ad84..954dc2f 100644 --- a/src/include/cstrike.inc +++ b/src/include/cstrike.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: cstrike.inc 1828 2007-12-24 20:41:33Z pred $ + * Version: $Id$ */ #if defined _cstrike_included diff --git a/src/include/datapack.inc b/src/include/datapack.inc index a289081..4ad8eb4 100644 --- a/src/include/datapack.inc +++ b/src/include/datapack.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: datapack.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _datapack_included diff --git a/src/include/dbi.inc b/src/include/dbi.inc index cc60e94..ed82476 100644 --- a/src/include/dbi.inc +++ b/src/include/dbi.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: dbi.inc 1918 2008-03-02 18:01:49Z dvander $ + * Version: $Id$ */ #if defined _dbi_included @@ -115,6 +115,7 @@ native Handle:SQL_Connect(const String:confname[], bool:persistent, String:error * @param persistent True to re-use a previous persistent connection * if possible, false otherwise. * @return A database connection Handle, or INVALID_HANDLE on failure. + * On failure the error buffer will be filled with a message. */ stock Handle:SQL_DefConnect(String:error[], maxlength, bool:persistent=true) { @@ -122,22 +123,65 @@ stock Handle:SQL_DefConnect(String:error[], maxlength, bool:persistent=true) } /** - * Creates an SQL connection from specific parameters. + * Connects to a database using key value pairs containing the database info. + * The key/value pairs should match what would be in databases.cfg. * - * @param driver Driver Handle, or INVALID_HANDLE for default. - * @param host Host name. - * @param user User name. - * @param pass User password. - * @param database Database name. + * I.e. "driver" should be "default" or a driver name (or ommitted for + * the default). For SQLite, only the "database" parameter is needed in addition. + * For drivers which require external connections, more of the parameters may be + * needed. + * + * In general it is discouraged to use this function. Connections should go through + * databases.cfg for greatest flexibility on behalf of users. + * + * @param keyvalues Key/value pairs from a KeyValues handle, describing the connection. * @param error Error buffer. * @param maxlength Maximum length of the error buffer. - * @param persistent True to re-use a previous persistent connection - * if possible, false otherwise. - * @param port Optional port to specify. - * @param maxTimeout Maximum timeout in seconds if applicable. * @return A database connection Handle, or INVALID_HANDLE on failure. - * @error Invalid driver Handle other than INVALID_HANDLE. + * On failure the error buffer will be filled with a message. + * @error Invalid KeyValues handle. */ +native Handle:SQL_ConnectCustom(Handle:keyvalues, + String:error[], + maxlength, + bool:persistent); + +/** + * Grabs a handle to an SQLite database, creating one if it does not exist. + * + * Unless there are extenuating circumstances, you should consider using "sourcemod-local" as the + * database name. This provides some unification between plugins on behalf of users. + * + * As a precaution, you should always create some sort of unique prefix to your table names so + * there are no conflicts, and you should never drop or modify tables that you do not own. + * + * @param database Database name. + * @param error Error buffer. + * @param maxlength Maximum length of the error buffer. + * @return A database connection Handle, or INVALID_HANDLE on failure. + * On failure the error buffer will be filled with a message. + */ +stock Handle:SQLite_UseDatabase(const String:database[], + String:error[], + maxlength) +{ + new Handle:kv, Handle:db; + + kv = CreateKeyValues(""); + KvSetString(kv, "driver", "sqlite"); + KvSetString(kv, "database", database); + + db = SQL_ConnectCustom(kv, error, maxlength, false); + + CloseHandle(kv); + + return db; +} + +/** + * This function is deprecated. Use SQL_ConnectCustom or SQLite_UseDatabase instead. + */ +#pragma deprecated Use SQL_ConnectCustom instead. native Handle:SQL_ConnectEx(Handle:driver, const String:host[], const String:user[], @@ -581,7 +625,7 @@ native SQL_UnlockDatabase(Handle:database); * @param data Data passed in via the original threaded invocation. * @param */ -functag SQLTCallback public(Handle:owner, Handle:hndl, const String:error[], any:data); +functag public SQLTCallback(Handle:owner, Handle:hndl, const String:error[], any:data); /** * Tells whether two database handles both point to the same database diff --git a/src/include/entity.inc b/src/include/entity.inc index 26eaa96..8a7335c 100644 --- a/src/include/entity.inc +++ b/src/include/entity.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: entity.inc 1890 2008-02-22 16:51:15Z dvander $ + * Version: $Id$ */ #if defined _entity_included @@ -273,10 +273,11 @@ native SetEntDataFloat(entity, offset, Float:value, bool:changeState=false); * @return Entity index at the given location, or 0 if none. * @error Invalid entity or offset out of reasonable bounds. */ +#pragma deprecated Use GetEntDataEnt2() instead. native GetEntDataEnt(entity, offset); /** - * This function is deprecated. Use GetEntDataEnt2 instead, for + * This function is deprecated. Use SetEntDataEnt2 instead, for * reasons explained in the notes. * * Note: This function uses 0 as an indicator to unset data, but @@ -290,6 +291,7 @@ native GetEntDataEnt(entity, offset); * @noreturn * @error Invalid entity or offset out of reasonable bounds. */ +#pragma deprecated Use SetEntDataEnt2() instead. native SetEntDataEnt(entity, offset, other, bool:changeState=false); /** @@ -479,8 +481,7 @@ stock GetEntSendPropOffs(ent, const String:prop[], bool:actual=false) * Retrieves an integer value from an entity's property. * * This function is considered safer and more robust over GetEntData, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -497,8 +498,7 @@ native GetEntProp(entity, PropType:type, const String:prop[], size=4); * Sets an integer value in an entity's property. * * This function is considered safer and more robust over SetEntData, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -515,8 +515,7 @@ native SetEntProp(entity, PropType:type, const String:prop[], any:value, size=4) * Retrieves a float value from an entity's property. * * This function is considered safer and more robust over GetEntDataFloat, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -530,8 +529,7 @@ native Float:GetEntPropFloat(entity, PropType:type, const String:prop[]); * Sets a float value in an entity's property. * * This function is considered safer and more robust over SetEntDataFloat, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -546,8 +544,7 @@ native SetEntPropFloat(entity, PropType:type, const String:prop[], Float:value); * Retrieves an entity index from an entity's property. * * This function is considered safer and more robust over GetEntDataEnt*, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -563,8 +560,7 @@ native GetEntPropEnt(entity, PropType:type, const String:prop[]); * Sets an entity index in an entity's property. * * This function is considered safer and more robust over SetEntDataEnt*, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -579,8 +575,7 @@ native SetEntPropEnt(entity, PropType:type, const String:prop[], other); * Retrieves a vector of floats from an entity, given a named network property. * * This function is considered safer and more robust over GetEntDataVector, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. @@ -596,8 +591,7 @@ native GetEntPropVector(entity, PropType:type, const String:prop[], Float:vec[3] * Sets a vector of floats in an entity, given a named network property. * * This function is considered safer and more robust over SetEntDataVector, - * because it performs strict offset checking and typing rules. There is a - * very minor performance hit from this. + * because it performs strict offset checking and typing rules. * * @param entity Entity/edict index. * @param type Property type. diff --git a/src/include/entity_prop_stocks.inc b/src/include/entity_prop_stocks.inc index 10dc1a0..855f6a6 100644 --- a/src/include/entity_prop_stocks.inc +++ b/src/include/entity_prop_stocks.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: entity_prop_stocks.inc 1943 2008-03-16 23:16:34Z dvander $ + * Version: $Id$ */ #if defined _entity_prop_stocks_included @@ -170,9 +170,27 @@ enum RenderFx */ stock GetEntityFlags(entity) { - return GetEntProp(entity, Prop_Data, "m_fFlags"); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_fFlags", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_fFlags"); + } + + gotconfig = true; + } + + return GetEntProp(entity, Prop_Data, datamap); } + /** * Gets an entity's movetype. * @@ -182,8 +200,24 @@ stock GetEntityFlags(entity) */ stock MoveType:GetEntityMoveType(entity) { - new offset = GetEntSendPropOffs(entity, "movetype"); - return MoveType:GetEntData(entity, offset, 1); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_MoveType", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_MoveType"); + } + + gotconfig = true; + } + + return MoveType:GetEntProp(entity, Prop_Data, datamap); } /** @@ -196,8 +230,24 @@ stock MoveType:GetEntityMoveType(entity) */ stock SetEntityMoveType(entity, MoveType:mt) { - new offset = GetEntSendPropOffs(entity, "movetype"); - SetEntData(entity, offset, mt, 1, true); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_MoveType", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_MoveType"); + } + + gotconfig = true; + } + + SetEntProp(entity, Prop_Data, datamap, mt); } /** @@ -209,7 +259,24 @@ stock SetEntityMoveType(entity, MoveType:mt) */ stock RenderMode:GetEntityRenderMode(entity) { - return RenderMode:GetEntProp(entity, Prop_Send, "m_nRenderMode", 1); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_nRenderMode", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_nRenderMode"); + } + + gotconfig = true; + } + + return RenderMode:GetEntProp(entity, Prop_Send, prop, 1); } /** @@ -222,7 +289,24 @@ stock RenderMode:GetEntityRenderMode(entity) */ stock SetEntityRenderMode(entity, RenderMode:mode) { - SetEntProp(entity, Prop_Send, "m_nRenderMode", mode, 1); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_nRenderMode", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_nRenderMode"); + } + + gotconfig = true; + } + + SetEntProp(entity, Prop_Send, prop, mode, 1); } /** @@ -234,7 +318,24 @@ stock SetEntityRenderMode(entity, RenderMode:mode) */ stock RenderFx:GetEntityRenderFx(entity) { - return RenderFx:GetEntProp(entity, Prop_Send, "m_nRenderFX", 1); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_nRenderFX", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_nRenderFX"); + } + + gotconfig = true; + } + + return RenderFx:GetEntProp(entity, Prop_Send, prop, 1); } /** @@ -247,7 +348,24 @@ stock RenderFx:GetEntityRenderFx(entity) */ stock SetEntityRenderFx(entity, RenderFx:fx) { - SetEntProp(entity, Prop_Send, "m_nRenderFX", fx, 1); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_nRenderFX", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_nRenderFX"); + } + + gotconfig = true; + } + + SetEntProp(entity, Prop_Send, prop, fx, 1); } /** @@ -263,15 +381,36 @@ stock SetEntityRenderFx(entity, RenderFx:fx) */ stock SetEntityRenderColor(entity, r=255, g=255, b=255, a=255) { - new offset = GetEntSendPropOffs(entity, "m_clrRender"); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_clrRender", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_clrRender"); + } + + gotconfig = true; + } + + new offset = GetEntSendPropOffs(entity, prop); + + if (offset <= 0) + { + ThrowError("SetEntityRenderColor not supported by this mod"); + } + SetEntData(entity, offset, r, 1, true); SetEntData(entity, offset + 1, g, 1, true); SetEntData(entity, offset + 2, b, 1, true); SetEntData(entity, offset + 3, a, 1, true); } -/* GuessSDKVersion */ - /** * Gets an entity's gravity. * @@ -281,7 +420,24 @@ stock SetEntityRenderColor(entity, r=255, g=255, b=255, a=255) */ stock Float:GetEntityGravity(entity) { - return GetEntPropFloat(entity, Prop_Data, "m_flGravity"); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_flGravity", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_flGravity"); + } + + gotconfig = true; + } + + return GetEntPropFloat(entity, Prop_Data, datamap); } /** @@ -294,7 +450,24 @@ stock Float:GetEntityGravity(entity) */ stock SetEntityGravity(entity, Float:amount) { - SetEntPropFloat(entity, Prop_Data, "m_flGravity", amount); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_flGravity", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_flGravity"); + } + + gotconfig = true; + } + + SetEntPropFloat(entity, Prop_Data, datamap, amount); } /** @@ -307,7 +480,50 @@ stock SetEntityGravity(entity, Float:amount) */ stock SetEntityHealth(entity, amount) { - SetEntProp(entity, Prop_Send, "m_iHealth", amount); + static bool:gotconfig = false; + static String:prop[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_iHealth", prop, sizeof(prop)); + CloseHandle(gc); + + if (!exists) + { + strcopy(prop, sizeof(prop), "m_iHealth"); + } + + gotconfig = true; + } + + decl String:cls[64]; + new PropFieldType:type; + new offset; + + if (!GetEntityNetClass(entity, cls, sizeof(cls))) + { + ThrowError("SetEntityHealth not supported by this mod: Could not get serverclass name"); + return; + } + + offset = FindSendPropInfo(cls, prop, type); + + if (offset <= 0) + { + ThrowError("SetEntityHealth not supported by this mod"); + return; + } + + /* Dark Messiah uses a float for the health instead an integer */ + if (type == PropField_Float) + { + SetEntDataFloat(entity, offset, float(amount)); + } + else + { + SetEntProp(entity, Prop_Send, prop, amount); + } } /** @@ -320,5 +536,22 @@ stock SetEntityHealth(entity, amount) */ stock GetClientButtons(client) { - return GetEntProp(client, Prop_Data, "m_nButtons"); + static bool:gotconfig = false; + static String:datamap[32]; + + if (!gotconfig) + { + new Handle:gc = LoadGameConfigFile("core.games"); + new bool:exists = GameConfGetKeyValue(gc, "m_nButtons", datamap, sizeof(datamap)); + CloseHandle(gc); + + if (!exists) + { + strcopy(datamap, sizeof(datamap), "m_nButtons"); + } + + gotconfig = true; + } + + return GetEntProp(client, Prop_Data, datamap); } diff --git a/src/include/events.inc b/src/include/events.inc index d643c65..aa28408 100644 --- a/src/include/events.inc +++ b/src/include/events.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: events.inc 1857 2008-01-19 20:58:10Z dvander $ + * Version: $Id$ */ #if defined _events_included diff --git a/src/include/files.inc b/src/include/files.inc index d462d69..8a4d2d2 100644 --- a/src/include/files.inc +++ b/src/include/files.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: files.inc 1860 2008-01-22 17:04:59Z dvander $ + * Version: $Id$ */ #if defined _files_included @@ -176,11 +176,11 @@ native ReadFile(Handle:hndl, items[], num_items, size); * @param hndl Handle to the file. * @param buffer Buffer to store the string. * @param max_size Maximum size of the string buffer. - * @param stop If true, reading will stop once max_size-1 bytes have - * been read. If false, reading will stop once a NUL - * terminator is reached. The buffer will simply be - * terminated in either case, the difference is in how - * the far the file position is changed. + * @param read_count If -1, reads until a null terminator is encountered in + * the file. Otherwise, read_count bytes are read + * into the buffer provided. In this case the buffer + * is not explicitly null terminated, and the buffer + * will contain any null terminators read from the file. * @return Number of characters written to the buffer, or -1 * if an error was encountered. * @error Invalid Handle, or read_count > max_size. @@ -353,6 +353,25 @@ native FlushFile(Handle:file); */ native bool:RemoveDir(const String:path[]); +#define FPERM_U_READ 0x0100 /* User can read. */ +#define FPERM_U_WRITE 0x0080 /* User can write. */ +#define FPERM_U_EXEC 0x0040 /* User can exec. */ +#define FPERM_G_READ 0x0020 /* Group can read. */ +#define FPERM_G_WRITE 0x0010 /* Group can write. */ +#define FPERM_G_EXEC 0x0008 /* Group can exec. */ +#define FPERM_O_READ 0x0004 /* Anyone can read. */ +#define FPERM_O_WRITE 0x0002 /* Anyone can write. */ +#define FPERM_O_EXEC 0x0001 /* Anyone can exec. */ + +/** + * Creates a directory. + * + * @param path Path to create. + * @param mode Permissions (default is o=rx,g=rx,u=rwx). Note that folders must have + * the execute bit set on Linux. On Windows, the mode is ignored. + */ +native bool:CreateDirectory(const String:path[], mode); + /** * Returns a file timestamp as a unix timestamp. * diff --git a/src/include/float.inc b/src/include/float.inc index 1e44a7d..13ad7f6 100644 --- a/src/include/float.inc +++ b/src/include/float.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: float.inc 1942 2008-03-16 23:08:56Z dvander $ + * Version: $Id$ */ #if defined _float_included diff --git a/src/include/functions.inc b/src/include/functions.inc index 4d8048a..1ad804f 100644 --- a/src/include/functions.inc +++ b/src/include/functions.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: functions.inc 2360 2008-07-06 00:01:40Z dvander $ + * Version: $Id$ */ #define SP_PARAMFLAG_BYREF (1<<0) /**< Internal use only. */ @@ -352,7 +352,7 @@ native Call_Cancel(); * @param numParams Number of parameters passed to the native. * @return Value for the native call to return. */ -functag NativeCall public(Handle:plugin, numParams); +functag public NativeCall(Handle:plugin, numParams); /** * Creates a dynamic native. This should only be called in AskPluginLoad(), or diff --git a/src/include/geoip.inc b/src/include/geoip.inc index 8048bc9..725126e 100644 --- a/src/include/geoip.inc +++ b/src/include/geoip.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: geoip.inc 1579 2007-10-15 04:27:56Z dvander $ + * Version: $Id$ */ #if defined _geoip_included diff --git a/src/include/halflife.inc b/src/include/halflife.inc index 6d832e3..2b9811e 100644 --- a/src/include/halflife.inc +++ b/src/include/halflife.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: halflife.inc 1921 2008-03-02 23:54:38Z dvander $ + * Version: $Id$ */ #if defined _halflife_included @@ -37,8 +37,10 @@ #define SOURCE_SDK_UNKNOWN 0 /**< Could not determine the engine version */ #define SOURCE_SDK_ORIGINAL 10 /**< Original Source engine (still used by "The Ship") */ +#define SOURCE_SDK_DARKMESSIAH 15 /**< Modified version of original engine used by Dark Messiah (no SDK) */ #define SOURCE_SDK_EPISODE1 20 /**< SDK+Engine released after Episode 1 */ -#define SOURCE_SDK_EPISODE2 30 /**< Engine released after Episode 2 (no SDK yet) */ +#define SOURCE_SDK_EPISODE2 30 /**< SDK+Engine released after Episode 2/Orange Box */ +#define SOURCE_SDK_LEFT4DEAD 40 /**< Engine released after Left 4 Dead (no SDK yet) */ #define MOTDPANEL_TYPE_TEXT 0 /**< Treat msg as plain text */ #define MOTDPANEL_TYPE_INDEX 1 /**< Msg is auto determined by the engine */ @@ -51,7 +53,7 @@ enum DialogType DialogType_Menu, /**< an options menu */ DialogType_Text, /**< a richtext dialog */ DialogType_Entry, /**< an entry box */ - DialogType_AskConnect /**< ask the client to connect to a specified IP */ + DialogType_AskConnect /**< ask the client to connect to a specified IP */ }; /** diff --git a/src/include/handles.inc b/src/include/handles.inc index 19a8b6c..053ad6f 100644 --- a/src/include/handles.inc +++ b/src/include/handles.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: handles.inc 1771 2007-12-05 15:38:45Z dvander $ + * Version: $Id$ */ #if defined _handles_included diff --git a/src/include/helpers.inc b/src/include/helpers.inc index 841601a..31c4c3b 100644 --- a/src/include/helpers.inc +++ b/src/include/helpers.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: helpers.inc 1895 2008-02-22 21:01:08Z dvander $ + * Version: $Id$ */ #if defined _helpers_included diff --git a/src/include/keyvalues.inc b/src/include/keyvalues.inc index 9e07883..97f4991 100644 --- a/src/include/keyvalues.inc +++ b/src/include/keyvalues.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: keyvalues.inc 1740 2007-12-01 00:37:47Z faluco $ + * Version: $Id$ */ #if defined _keyvalues_included diff --git a/src/include/lang.inc b/src/include/lang.inc index 3186d40..4f570a6 100644 --- a/src/include/lang.inc +++ b/src/include/lang.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: lang.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _lang_included diff --git a/src/include/logging.inc b/src/include/logging.inc index 569c3c5..39028c6 100644 --- a/src/include/logging.inc +++ b/src/include/logging.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: logging.inc 1920 2008-03-02 19:08:27Z dvander $ + * Version: $Id$ */ #if defined _sm_logging_included @@ -134,7 +134,7 @@ forward Action:OnLogAction(Handle:source, * @return Plugin_Handled or Plugin_Stop will prevent the message * from being written to the log file. */ -functag GameLogHook Action:public(const String:message[]); +functag public Action:GameLogHook(const String:message[]); /** * Adds a game log hook. diff --git a/src/include/mapchooser.inc b/src/include/mapchooser.inc new file mode 100644 index 0000000..7da8a29 --- /dev/null +++ b/src/include/mapchooser.inc @@ -0,0 +1,99 @@ +#if defined _mapchooser_included_ + #endinput +#endif +#define _mapchooser_included_ + +enum NominateResult +{ + Nominate_Added, /** The map was added to the nominate list */ + Nominate_Replaced, /** A clients existing nomination was replaced */ + Nominate_AlreadyInVote, /** Specified map was already in the vote */ + Nominate_InvalidMap, /** Mapname specifed wasn't a valid map */ + Nominate_VoteFull, /** This will only occur if force was set to false */ +}; + +enum MapChange +{ + MapChange_Instant, /** Change map as soon as the voting results have come in */ + MapChange_RoundEnd, /** Change map at the end of the round */ + MapChange_MapEnd, /** Change the sm_nextmap cvar */ +}; + +/** + * Attempt to add a map to the mapchooser map list. + * + * @param map Map to add. + * @param force Should we force the map in even if it requires overwriting an existing nomination? + * @param owner Client index of the nominater. If the client disconnects the nomination will be removed. Use 0 for constant nominations + * @return Nominate Result of the outcome + */ +native NominateResult:NominateMap(const String:map[], bool:force, owner); + +/** + * Gets the current list of excluded maps. + * + * @param array An ADT array handle to add the map strings to. Needs to be + * @noreturn + */ +native GetExcludeMapList(Handle:array); + +/** + * Checks if MapChooser will allow a vote + * + * @return True if a vote can be held, or false if mapchooser is already holding a vote. + */ +native bool:CanMapChooserStartVote(); + +/** + * Initiates a MapChooser map vote + * + * Note: If no input array is specified mapchooser will use its internal list. This includes + * any nominations and excluded maps (as per mapchoosers convars). + * + * @param when MapChange consant of when the resulting mapchange should occur. + * @param inputarray ADT array list of maps to add to the vote. + */ +native InitiateMapChooserVote(MapChange:when, Handle:inputarray=INVALID_HANDLE); + +/** + * Checks if MapChooser's end of map vote has completed. + * + * @return True if complete, false otherwise. + */ +native bool:HasEndOfMapVoteFinished(); + +/** + * Checks if MapChooser is set to run an end of map vote. + * + * @return True if enabled, false otherwise. + */ +native bool:EndOfMapVoteEnabled(); + +/** + * Called when mapchooser removes a nomination from its list. + * Nominations cleared on map start will not trigger this forward + */ +forward OnNominationRemoved(const String:map[], owner); + + +public SharedPlugin:__pl_mapchooser = +{ + name = "mapchooser", + file = "mapchooser.smx", +#if defined REQUIRE_PLUGIN + required = 1, +#else + required = 0, +#endif +}; + +public __pl_mapchooser_SetNTVOptional() +{ + MarkNativeAsOptional("NominateMap"); + MarkNativeAsOptional("GetExcludeMapList"); + MarkNativeAsOptional("CanMapChooserStartVote"); + MarkNativeAsOptional("InitiateMapChooserVote"); + MarkNativeAsOptional("HasEndOfMapVoteFinished"); + MarkNativeAsOptional("EndOfMapVoteEnabled"); +} + diff --git a/src/include/menus.inc b/src/include/menus.inc index 700ac51..c7c81de 100644 --- a/src/include/menus.inc +++ b/src/include/menus.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: menus.inc 1777 2007-12-06 12:26:59Z dvander $ + * Version: $Id$ */ #if defined _menus_included @@ -149,7 +149,7 @@ enum MenuSource * @param param2 Second action parameter (usually the item). * @noreturn */ -functag MenuHandler public(Handle:menu, MenuAction:action, param1, param2); +functag public MenuHandler(Handle:menu, MenuAction:action, param1, param2); /** * Creates a new, empty menu using the default style. @@ -513,7 +513,7 @@ stock VoteMenuToAll(Handle:menu, time) * defines. * @noreturn */ -functag VoteHandler public(Handle:menu, +functag public VoteHandler(Handle:menu, num_votes, num_clients, const client_info[][2], @@ -540,6 +540,28 @@ native SetVoteResultCallback(Handle:menu, VoteHandler:callback); */ native CheckVoteDelay(); +/** + * Returns whether a client is in the pool of clients allowed + * to participate in the current vote. This is determined by + * the client list passed to StartVote(). + * + * @param client Client index. + * @return True if client is allowed to vote, false otherwise. + * @error If no vote is in progress or client index is invalid. + */ +native bool:IsClientInVotePool(client); + +/** + * Redraws the current vote menu to a client in the voting pool. + * + * @param client Client index. + * @return True on success, false if the client is in the vote pool + * but cannot vote again. + * @error No vote in progress, client is not in the voting pool, + * or client index is invalid. + */ +native bool:RedrawClientVoteMenu(client); + /** * Returns a style's global Handle. * diff --git a/src/include/nextmap.inc b/src/include/nextmap.inc new file mode 100644 index 0000000..af539f7 --- /dev/null +++ b/src/include/nextmap.inc @@ -0,0 +1,84 @@ +/** + * vim: set ts=4 : + * ============================================================================= + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. + * ============================================================================= + * + * This file is part of the SourceMod/SourcePawn SDK. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + * As a special exception, AlliedModders LLC gives you permission to link the + * code of this program (as well as its derivative works) to "Half-Life 2," the + * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software + * by the Valve Corporation. You must obey the GNU General Public License in + * all respects for all other code used. Additionally, AlliedModders LLC grants + * this exception to all derivative works. AlliedModders LLC defines further + * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), + * or . + * + * Version: $Id$ + */ + +#if defined _nextmap_included_ + #endinput +#endif +#define _nextmap_included_ + +/** + * Sets SourceMod's internal nextmap. + * Equivalent to changing sm_nextmap but with an added validity check. + * + * @param map Next map to set. + * @return True if the nextmap was set, false if map was invalid. + */ +native bool:SetNextMap(const String:map[]); + +/** + * Returns SourceMod's internal nextmap. + * + * @param map Buffer to store the nextmap name. + * @param maxlen Maximum length of the map buffer. + * @return True if a Map was found and copied, false if no nextmap is set (map will be unchanged). + */ +native bool:GetNextMap(String:map[], maxlen); + +/** + * Changes the current map and records the reason for the change with maphistory + * + * @param map Map to change to. + * @param reason Reason for change. + * @noreturn + */ +native ForceChangeLevel(const String:map[], const String:reason[]); + +/** + * Gets the current number of maps in the map history + * + * @return Number of maps. + */ +native GetMapHistorySize(); + +/** + * Retrieves a map from the map history list. + * + * @param item Item number. Must be 0 or greater and less than GetMapHistorySize(). + * @param map Buffer to store the map name. + * @param mapLen Length of map buffer. + * @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 GetMapHistory(item, String:map[], mapLen, String:reason[], reasonLen, &startTime); \ No newline at end of file diff --git a/src/include/profiler.inc b/src/include/profiler.inc index a6f6c9e..68f1ca7 100644 --- a/src/include/profiler.inc +++ b/src/include/profiler.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: profiler.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _profiler_included diff --git a/src/include/regex.inc b/src/include/regex.inc index 53ed2bd..bfdd22c 100644 --- a/src/include/regex.inc +++ b/src/include/regex.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: regex.inc 2086 2008-04-19 10:34:56Z pred $ + * Version: $Id$ */ #if defined _regex_included diff --git a/src/include/sdktools.inc b/src/include/sdktools.inc index 176721d..9963539 100644 --- a/src/include/sdktools.inc +++ b/src/include/sdktools.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools.inc 1990 2008-04-06 05:40:11Z dvander $ + * Version: $Id$ */ #if defined _sdktools_included diff --git a/src/include/sdktools_engine.inc b/src/include/sdktools_engine.inc index 1c44dae..a34439e 100644 --- a/src/include/sdktools_engine.inc +++ b/src/include/sdktools_engine.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_engine.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _sdktools_engine_included diff --git a/src/include/sdktools_entinput.inc b/src/include/sdktools_entinput.inc index ad66d10..1eb5f6b 100644 --- a/src/include/sdktools_entinput.inc +++ b/src/include/sdktools_entinput.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_entinput.inc 1504 2007-09-28 19:56:19Z faluco $ + * Version: $Id$ */ #if defined _sdktools_entinput_included diff --git a/src/include/sdktools_entoutput.inc b/src/include/sdktools_entoutput.inc index 350ae7f..b7aeaaa 100644 --- a/src/include/sdktools_entoutput.inc +++ b/src/include/sdktools_entoutput.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_entoutput.inc 1990 2008-04-06 05:40:11Z dvander $ + * Version: $Id$ */ #if defined _sdktools_entoutput_included @@ -43,7 +43,7 @@ * @param activator Entity index of the activator. * @param delay Delay in seconds? before the event gets fired. */ -functag EntityOutput public(const String:output[], caller, activator, Float:delay); +functag public EntityOutput(const String:output[], caller, activator, Float:delay); /** * Add an entity output hook on a entity classname diff --git a/src/include/sdktools_functions.inc b/src/include/sdktools_functions.inc index ccb65bb..507af1d 100644 --- a/src/include/sdktools_functions.inc +++ b/src/include/sdktools_functions.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_functions.inc 2069 2008-04-16 23:29:37Z dvander $ + * Version: $Id$ */ #if defined _sdktools_functions_included @@ -308,3 +308,15 @@ native EquipPlayerWeapon(client, weapon); * @error Invalid entity or lack of mod support. */ native ActivateEntity(entity); + +/** + * Sets values to client info buffer keys and notifies the engine of the change. + * The change does not get propogated to mods until the next frame. + * + * @param client Player's index. + * @param key Key string. + * @param value Value string. + * @noreturn + * @error Invalid client index, or client not connected. + */ +native SetClientInfo(client, const String:key[], const String:value[]); diff --git a/src/include/sdktools_sound.inc b/src/include/sdktools_sound.inc index 5688325..a8a9f99 100644 --- a/src/include/sdktools_sound.inc +++ b/src/include/sdktools_sound.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_sound.inc 1934 2008-03-12 05:21:56Z dvander $ + * Version: $Id$ */ #if defined _sdktools_sound_included @@ -274,7 +274,7 @@ native EmitSentence(const clients[], * @return Plugin_Continue to allow the sound to be played, Plugin_Stop to block it, * Plugin_Changed when any parameter has been modified. */ -functag AmbientSHook Action:public(String:sample[PLATFORM_MAX_PATH], &entity, &Float:volume, &level, &pitch, Float:pos[3], &flags, &Float:delay); +functag public Action:AmbientSHook(String:sample[PLATFORM_MAX_PATH], &entity, &Float:volume, &level, &pitch, Float:pos[3], &flags, &Float:delay); /** * Called when a sound is going to be emitted to one or more clients. @@ -292,7 +292,7 @@ functag AmbientSHook Action:public(String:sample[PLATFORM_MAX_PATH], &entity, &F * @return Plugin_Continue to allow the sound to be played, Plugin_Stop to block it, * Plugin_Changed when any parameter has been modified. */ -functag NormalSHook Action:public(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags); +functag public Action:NormalSHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags); /** * Hooks all played ambient sounds. diff --git a/src/include/sdktools_stocks.inc b/src/include/sdktools_stocks.inc index ec25166..744df58 100644 --- a/src/include/sdktools_stocks.inc +++ b/src/include/sdktools_stocks.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_stocks.inc 1622 2007-10-21 00:16:46Z dvander $ + * Version: $Id$ */ #if defined _sdktools_stocks_included @@ -52,13 +52,13 @@ stock FindTeamByName(const String:name[]) new name_len = strlen(name); new num_teams = GetTeamCount(); decl String:team_name[32]; - new found_team = -1 + new found_team = -1; for (new i = 0; i < num_teams; i++) { GetTeamName(i, team_name, sizeof(team_name)); - if (strncmp(team_name, name, name_len) == 0) + if (strncmp(team_name, name, name_len, false) == 0) { if (found_team >= 0) { diff --git a/src/include/sdktools_stringtables.inc b/src/include/sdktools_stringtables.inc index 4eec397..b54583b 100644 --- a/src/include/sdktools_stringtables.inc +++ b/src/include/sdktools_stringtables.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_stringtables.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _sdktools_stringtables_included diff --git a/src/include/sdktools_tempents.inc b/src/include/sdktools_tempents.inc index acea043..1224e0e 100644 --- a/src/include/sdktools_tempents.inc +++ b/src/include/sdktools_tempents.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_tempents.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _sdktools_tempents_included @@ -44,7 +44,7 @@ * @param delay Delay in seconds to send the TE. * @return Plugin_Continue to allow the transmission of the TE, Plugin_Stop to block it. */ -functag TEHook Action:public(const String:te_name[], const Players[], numClients, Float:delay); +functag public Action:TEHook(const String:te_name[], const Players[], numClients, Float:delay); /** * Hooks a temp entity. diff --git a/src/include/sdktools_tempents_stocks.inc b/src/include/sdktools_tempents_stocks.inc index 6730cac..2a52bf1 100644 --- a/src/include/sdktools_tempents_stocks.inc +++ b/src/include/sdktools_tempents_stocks.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_tempents_stocks.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _te_stocks_included diff --git a/src/include/sdktools_trace.inc b/src/include/sdktools_trace.inc index 06eb955..ac715e1 100644 --- a/src/include/sdktools_trace.inc +++ b/src/include/sdktools_trace.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_trace.inc 2208 2008-05-29 03:50:36Z dvander $ + * Version: $Id$ */ #if defined _sdktools_trace_included diff --git a/src/include/sdktools_voice.inc b/src/include/sdktools_voice.inc index 2cf33bb..19ed4ec 100644 --- a/src/include/sdktools_voice.inc +++ b/src/include/sdktools_voice.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sdktools_voice.inc 2163 2008-05-21 03:31:27Z dvander $ + * Version: $Id$ */ #if defined _sdktools_voice_included @@ -39,15 +39,11 @@ * @section voice flags. */ #define VOICE_NORMAL 0 /**< Allow the client to listen and speak normally. */ -#define VOICE_MUTED 1 /**< Mutes the client from speaking to everyone. */ +#define VOICE_MUTED 1 /**< Mutes the client from speaking to everyone. */ #define VOICE_SPEAKALL 2 /**< Allow the client to speak to everyone. */ #define VOICE_LISTENALL 4 /**< Allow the client to listen to everyone. */ -#define VOICE_TEAM 8 /**< Allow the client to always speak to team, even when dead. */ +#define VOICE_TEAM 8 /**< Allow the client to always speak to team, even when dead. */ #define VOICE_LISTENTEAM 16 /**< Allow the client to always hear teammates, including dead ones. */ - -#define LISTEN_DEFAULT 0 /**< Default action (flags or game) is taken */ -#define LISTEN_NO 1 /**< Receiver cannot hear sender */ -#define LISTEN_YES 2 /**< Receiver can hear sender */ /** * @endsection @@ -57,7 +53,7 @@ * Set the client listening flags. * * @param client The client index - * @param flags The voice flags + * @param flags The voice flags * @noreturn */ native SetClientListeningFlags(client, flags); @@ -66,27 +62,24 @@ native SetClientListeningFlags(client, flags); * Retrieve the client current listening flags. * * @param client The client index - * @return The current voice flags + * @return The current voice flags */ native GetClientListeningFlags(client); /** - * Set the receiver's ability to listen to the sender. + * Set the receiver ability to listen to the sender. * - * @param receiver The listener client index. - * @param sender The sender client index. - * @param control A LISTEN_ constant describing the voice relationship. - * @noreturn - * @error If either client index is invalid or not connected. + * @param iReceiver The listener index. + * @param iSender The sender index. + * @return True if successful otherwise false. */ -native bool:SetClientListening(receiver, sender, control); +native bool:SetClientListening(iReceiver, iSender, bool:bListen); /** - * Retrieves if a receiver can listen to the sender. + * Retrieves if the receiver can listen to the sender. * - * @param receiver The listener client index. - * @param sender The sender client index. - * @return A LISTEN_ constant describing the voice relationship. - * @error If either client index is invalid or not connected. + * @param iReceiver The listener index. + * @param iSender The sender index. + * @return True if successful otherwise false. */ -native bool:GetClientListening(receiver, sender); +native bool:GetClientListening(iReceiver, iSender); \ No newline at end of file diff --git a/src/include/sorting.inc b/src/include/sorting.inc index fe21511..2b1bfec 100644 --- a/src/include/sorting.inc +++ b/src/include/sorting.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sorting.inc 1923 2008-03-03 06:28:41Z pred $ + * Version: $Id$ */ @@ -98,7 +98,7 @@ native SortStrings(String:array[][], num_strings, SortOrder:order = Sort_Ascendi * 0 if first is equal to second * 1 if first should go after second */ -functag SortFunc1D public(elem1, elem2, const array[], Handle:hndl); +functag public SortFunc1D(elem1, elem2, const array[], Handle:hndl); /** * Sorts a custom 1D array. You must pass in a comparison function. @@ -163,7 +163,7 @@ native SortADTArray(Handle:array, SortOrder:order, SortType:type); * 0 if first is equal to second * 1 if first should go after second */ -functag SortFuncADTArray public(index1, index2, Handle:array, Handle:hndl); +functag public SortFuncADTArray(index1, index2, Handle:array, Handle:hndl); /** * Custom sorts an ADT Array. You must pass in a comparison function. diff --git a/src/include/sourcemod.inc b/src/include/sourcemod.inc index 7a55072..5af90f6 100644 --- a/src/include/sourcemod.inc +++ b/src/include/sourcemod.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: sourcemod.inc 2212 2008-05-29 03:55:31Z dvander $ + * Version: $Id$ */ #if defined _sourcemod_included @@ -57,6 +57,7 @@ struct Plugin #include #include #include +#include #include #include #include @@ -66,12 +67,12 @@ struct Plugin #include #include #include -#include #include #include #include #include #include +#include /** * Declare this as a struct in your plugin to expose its information. diff --git a/src/include/string.inc b/src/include/string.inc index 8d57b3f..6369c8a 100644 --- a/src/include/string.inc +++ b/src/include/string.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: string.inc 2206 2008-05-29 03:46:42Z dvander $ + * Version: $Id$ */ #if defined _string_included @@ -284,9 +284,10 @@ native SplitString(const String:source[], const String:split[], String:part[], p * @param maxlength Maximum length of the string buffer. * @param search String to search for. * @param replace String to replace the search string with. + * @param caseSensitive If true (default), search is case sensitive. * @return Number of replacements that were performed. */ -native ReplaceString(String:text[], maxlength, const String:search[], const String:replace[]); +native ReplaceString(String:text[], maxlength, const String:search[], const String:replace[], bool:caseSensitive=true); /** * Given a string, replaces the first occurrence of a search string with a @@ -300,11 +301,12 @@ native ReplaceString(String:text[], maxlength, const String:search[], const Stri * a strlen() call on the search parameter. * @param replaceLen If higher than -1, its value will be used instead of * a strlen() call on the replace parameter. + * @param caseSensitive If true (default), search is case sensitive. * @return Index into the buffer (relative to the start) from where * the last replacement ended, or -1 if no replacements were * made. */ -native ReplaceStringEx(String:text[], maxlength, const String:search[], const String:replace[], searchLen=-1, replaceLen=-1); +native ReplaceStringEx(String:text[], maxlength, const String:search[], const String:replace[], searchLen=-1, replaceLen=-1, bool:caseSensitive=true); /** * Returns the number of bytes a character is using. This is diff --git a/src/include/textparse.inc b/src/include/textparse.inc index 159ed73..85ef687 100644 --- a/src/include/textparse.inc +++ b/src/include/textparse.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: textparse.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _textparse_included @@ -108,7 +108,7 @@ native bool:SMC_GetErrorString(SMCError:error, String:buffer[], buf_max); * @param smc The SMC Parse Handle. * @noreturn */ -functag SMC_ParseStart public(Handle:smc); +functag public SMC_ParseStart(Handle:smc); /** * Sets the SMC_ParseStart function of a parse Handle. @@ -128,7 +128,7 @@ native SMC_SetParseStart(Handle:smc, SMC_ParseStart:func); * @param failed True if parsing failed, false otherwise. * @noreturn */ -functag SMC_ParseEnd public(Handle:smc, bool:halted, bool:failed); +functag public SMC_ParseEnd(Handle:smc, bool:halted, bool:failed); /** * Sets the SMC_ParseEnd of a parse handle. @@ -149,7 +149,7 @@ native SMC_SetParseEnd(Handle:smc, SMC_ParseEnd:func); * @param opt_quotes True if the section name was quote-enclosed in the file. * @return An SMCResult action to take. */ -functag SMC_NewSection SMCResult:public(Handle:smc, const String:name[], bool:opt_quotes); +functag public SMCResult:SMC_NewSection(Handle:smc, const String:name[], bool:opt_quotes); /** * Called when the parser finds a new key/value pair. @@ -162,7 +162,7 @@ functag SMC_NewSection SMCResult:public(Handle:smc, const String:name[], bool:op * @param value_quotes Whether or not the value was enclosed in quotes. * @return An SMCResult action to take. */ -functag SMC_KeyValue SMCResult:public(Handle:smc, const String:key[], const String:value[], bool:key_quotes, bool:value_quotes); +functag public SMCResult:SMC_KeyValue(Handle:smc, const String:key[], const String:value[], bool:key_quotes, bool:value_quotes); /** * Called when the parser finds the end of the current section. @@ -170,7 +170,7 @@ functag SMC_KeyValue SMCResult:public(Handle:smc, const String:key[], const Stri * @param smc The SMC Parse Handle. * @return An SMCResult action to take. */ -functag SMC_EndSection SMCResult:public(Handle:smc); +functag public SMCResult:SMC_EndSection(Handle:smc); /** * Sets the three main reader functions. @@ -191,7 +191,7 @@ native SMC_SetReaders(Handle:smc, SMC_NewSection:ns, SMC_KeyValue:kv, SMC_EndSec * @param lineno The line number it occurs on. * @return An SMCResult action to take. */ -functag SMC_RawLine SMCResult:public(Handle:smc, const String:line[], lineno); +functag public SMCResult:SMC_RawLine(Handle:smc, const String:line[], lineno); /** * Sets a raw line reader on an SMC parser Handle. diff --git a/src/include/tf2.inc b/src/include/tf2.inc index 6b868fa..e4e4640 100644 --- a/src/include/tf2.inc +++ b/src/include/tf2.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: tf2.inc 2215 2008-05-29 04:06:16Z dvander $ + * Version: $Id$ */ #if defined _tf2_included @@ -104,6 +104,23 @@ native TF2_GetResourceEntity(); */ native TFClassType:TF2_GetClass(const String:classname[]); +/** + * Called on weapon fire to decide if the current shot should be critical. + * Return Plugin_Continue to let the original calculation or return a higher + * action to override the decision with the value of 'result' + * + * @note Since critical shots are also calculated client side any changes made with + * this will not show for the shooter. Projectile weapons such as the rocketlauncher + * and demoman weapons will show a critical bullet but no critical sound effect. + * Bullet hits should appear as expected. + * + * @param client Client Index. + * @param weapon Weapon entity Index. + * @param weaponname Classname of the weapon. + * @param result Buffer param for the result of the decision. + */ +forward Action:TF2_CalcIsAttackCritical(client, weapon, String:weaponname[], &bool:result); + /** * Do not edit below this line! */ @@ -118,4 +135,3 @@ public Extension:__ext_tf2 = required = 0, #endif }; - diff --git a/src/include/tf2_stocks.inc b/src/include/tf2_stocks.inc index f659248..a7c63ca 100644 --- a/src/include/tf2_stocks.inc +++ b/src/include/tf2_stocks.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: tf2_stocks.inc 2236 2008-05-31 22:30:57Z damagedsoul $ + * Version: $Id$ */ #if defined _tf2_stocks_included @@ -86,8 +86,7 @@ static const String:TFResourceNames[TFResourceType][] = * Get's a Clients current class. * * @param client Player's index. - * @param class TFClassType to change to. - * @noreturn + * @return Current TFClassType of player. * @error Invalid client index. */ stock TFClassType:TF2_GetPlayerClass(client) @@ -217,3 +216,4 @@ stock TF2_RemoveAllWeapons(client) TF2_RemoveWeaponSlot(client, i); } } + diff --git a/src/include/timers.inc b/src/include/timers.inc index 1b4ac74..07e801e 100644 --- a/src/include/timers.inc +++ b/src/include/timers.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: timers.inc 2213 2008-05-29 03:59:00Z dvander $ + * Version: $Id$ */ #if defined _timers_included @@ -39,7 +39,8 @@ #define TIMER_REPEAT (1<<0) /**< Timer will repeat until it returns Plugin_Stop */ #define TIMER_FLAG_NO_MAPCHANGE (1<<1) /**< Timer will not carry over mapchanges */ -#define TIMER_HNDL_CLOSE (1<<9) /**< Timer will automatically call CloseHandle() on its value when finished */ +#define TIMER_HNDL_CLOSE (1<<9) /**< Deprecated define, replaced by below */ +#define TIMER_DATA_HNDL_CLOSE (1<<9) /**< Timer will automatically call CloseHandle() on its data when finished */ /** * Any of the following prototypes will work for a timed function. @@ -50,7 +51,7 @@ funcenum Timer * Called when the timer interval has elapsed. * * @param timer Handle to the timer object. - * @param hndl Handle passed when the timer was created. + * @param hndl Handle passed to CreateTimer() when timer was created. * @return Plugin_Stop to stop a repeating timer, any other value for * default behavior. */ @@ -60,11 +61,11 @@ funcenum Timer * Called when the timer interval has elapsed. * * @param timer Handle to the timer object. - * @param value Value passed when the timer was created. + * @param data Data passed to CreateTimer() when timer was created. * @return Plugin_Stop to stop a repeating timer, any other value for * default behavior. */ - Action:public(Handle:timer, any:value), + Action:public(Handle:timer, any:data), /** * Called when the timer interval has elapsed. @@ -81,18 +82,18 @@ funcenum Timer * * @param interval Interval from the current game time to execute the given function. * @param func Function to execute once the given interval has elapsed. - * @param value Handle or value to give to the timer function. + * @param data Handle or value to pass through to the timer callback function. * @param flags Flags to set (such as repeatability or auto-Handle closing). * @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:value=INVALID_HANDLE, flags=0); +native Handle:CreateTimer(Float:interval, Timer:func, any:data=INVALID_HANDLE, flags=0); /** * Kills a timer. Use this instead of CloseHandle() if you need more options. * - * @param autoClose If autoClose is true, the timer's value will be - * closed as a handle if TIMER_HNDL_CLOSE was not specified. + * @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 */ native KillTimer(Handle:timer, bool:autoClose=false); @@ -189,20 +190,21 @@ forward OnMapTimeLeftChanged(); native bool:IsServerProcessing(); /** - * Creates a timer associated with a new data pack, and returns the datapack. + * Creates a timer associated with a new datapack, and returns the datapack. * @note The datapack is automatically freed when the timer ends. * @note The position of the datapack is not reset or changed for the timer function. * * @param interval Interval from the current game time to execute the given function. * @param func Function to execute once the given interval has elapsed. - * @param data The newly created datapack is passed though this by-reference parameter. + * @param datapack The newly created datapack is passed though this by-reference + * parameter to the timer callback function. * @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:data, flags=0) +stock Handle:CreateDataTimer(Float:interval, Timer:func, &Handle:datapack, flags=0) { - data = CreateDataPack(); - flags |= TIMER_HNDL_CLOSE; - return CreateTimer(interval, func, data, flags); + datapack = CreateDataPack(); + flags |= TIMER_DATA_HNDL_CLOSE; + return CreateTimer(interval, func, datapack, flags); } diff --git a/src/include/topmenus.inc b/src/include/topmenus.inc index 44776a5..b6fcca2 100644 --- a/src/include/topmenus.inc +++ b/src/include/topmenus.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: topmenus.inc 2086 2008-04-19 10:34:56Z pred $ + * Version: $Id$ */ #if defined _topmenus_included @@ -127,7 +127,7 @@ enum TopMenuObject * @param maxlength Output buffer (if used). * @noreturn */ -functag TopMenuHandler public(Handle:topmenu, +functag public TopMenuHandler(Handle:topmenu, TopMenuAction:action, TopMenuObject:object_id, param, diff --git a/src/include/usermessages.inc b/src/include/usermessages.inc index 7d0c1b8..ff27f9d 100644 --- a/src/include/usermessages.inc +++ b/src/include/usermessages.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: usermessages.inc 1943 2008-03-16 23:16:34Z dvander $ + * Version: $Id$ */ #if defined _eventsmsgs_included @@ -83,7 +83,8 @@ native bool:GetUserMessageName(UserMsg:msg_id, String:msg[], maxlength); * @param flags Optional flags to set. * @return A handle to a bf_write bit packing structure, or * INVALID_HANDLE on failure. - * @error Invalid message name or unable to start a message. + * @error Invalid message name, unable to start a message, invalid client, + * or client not connected. */ native Handle:StartMessage(String:msgname[], clients[], numClients, flags=0); @@ -98,7 +99,8 @@ native Handle:StartMessage(String:msgname[], clients[], numClients, flags=0); * @param flags Optional flags to set. * @return A handle to a bf_write bit packing structure, or * INVALID_HANDLE on failure. - * @error Invalid message name or unable to start a message. + * @error Invalid message name, unable to start a message, invalid client, + * or client not connected. */ native Handle:StartMessageEx(UserMsg:msg, clients[], numClients, flags=0); @@ -122,14 +124,15 @@ native EndMessage(); * blocks the message from being sent, and Plugin_Continue * resumes normal functionality. */ -functag MsgHook Action:public(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init); +functag public Action:MsgHook(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init); /** - * Called when a message is finished sending. + * Called when a message hook has completed. * * @param msg_id Message index. + * @param sent True if message was sent, false if blocked. */ -functag MsgSentNotify public(UserMsg:msg_id); +functag public MsgPostHook(UserMsg:msg_id, bool:sent); /** * Hooks a user message. @@ -143,7 +146,7 @@ functag MsgSentNotify public(UserMsg:msg_id); * @noreturn * @error Invalid message index. */ -native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false, MsgSentNotify:notify=MsgSentNotify:-1); +native HookUserMessage(UserMsg:msg_id, MsgHook:hook, bool:intercept=false, MsgPostHook:post=MsgPostHook:-1); /** * Removes one usermessage hook. diff --git a/src/include/vector.inc b/src/include/vector.inc index da8f9a7..78ad093 100644 --- a/src/include/vector.inc +++ b/src/include/vector.inc @@ -1,7 +1,7 @@ /** * vim: set ts=4 : * ============================================================================= - * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. * ============================================================================= * * This file is part of the SourceMod/SourcePawn SDK. @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: vector.inc 1336 2007-08-15 06:19:30Z damagedsoul $ + * Version: $Id$ */ #if defined _vector_included diff --git a/src/include/version.inc b/src/include/version.inc index ee3a51f..856b3cf 100644 --- a/src/include/version.inc +++ b/src/include/version.inc @@ -27,7 +27,7 @@ * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or . * - * Version: $Id: version.inc 2534 2008-09-14 05:13:21Z dvander $ + * Version: $Id$ */ #if defined _version_included @@ -36,7 +36,7 @@ #define _version_included #define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */ -#define SOURCEMOD_V_MINOR 0 /**< SourceMod Minor version */ -#define SOURCEMOD_V_RELEASE 4 /**< SourceMod Release version */ +#define SOURCEMOD_V_MINOR 2 /**< SourceMod Minor version */ +#define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */ -#define SOURCEMOD_VERSION "1.0.4" /**< SourceMod version string (major.minor.release.build) */ +#define SOURCEMOD_VERSION "1.2.0" /**< SourceMod version string (major.minor.release.build) */ diff --git a/src/include/zr.inc b/src/include/zr.inc index c85d222..ebd4426 100644 --- a/src/include/zr.inc +++ b/src/include/zr.inc @@ -1,3 +1,3 @@ -// =============================== -// Zombie:Reloaded External API +// =============================== +// Zombie:Reloaded External API // =============================== \ No newline at end of file