Added more missing svn:keywords properties to some files (this should be the last of them before I never have to do this again)

Moved sm_memtable files in sqlite extension to sdk directory (to be consistent with topmenus)
Some extension source files had an incorrect extension name in their headers

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402037
This commit is contained in:
Scott Ehlert
2008-04-11 17:16:36 +00:00
parent 0c5e4b5a2f
commit c473d75d3d
61 changed files with 3599 additions and 3443 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
PrepareBan(client, target, time, const String:reason[])
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
enum CommType
+75 -75
View File
@@ -1,75 +1,75 @@
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Basecommands Plugin
* Provides cancelvote functionality.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
*/
PerformCancelVote(client)
{
if (!IsVoteInProgress())
{
ReplyToCommand(client, "[SM] %t", "Vote Not In Progress");
return;
}
ShowActivity2(client, "[SM] ", "%t", "Cancelled Vote");
CancelVote();
}
public AdminMenu_CancelVote(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
Format(buffer, maxlength, "%T", "Cancel vote", param);
}
else if (action == TopMenuAction_SelectOption)
{
PerformCancelVote(param);
RedisplayAdminMenu(topmenu, param);
}
else if (action == TopMenuAction_DrawOption)
{
buffer[0] = IsVoteInProgress() ? ITEMDRAW_DEFAULT : ITEMDRAW_IGNORE;
}
}
public Action:Command_CancelVote(client, args)
{
PerformCancelVote(client);
return Plugin_Handled;
}
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod Basecommands Plugin
* Provides cancelvote functionality.
*
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
PerformCancelVote(client)
{
if (!IsVoteInProgress())
{
ReplyToCommand(client, "[SM] %t", "Vote Not In Progress");
return;
}
ShowActivity2(client, "[SM] ", "%t", "Cancelled Vote");
CancelVote();
}
public AdminMenu_CancelVote(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength)
{
if (action == TopMenuAction_DisplayOption)
{
Format(buffer, maxlength, "%T", "Cancel vote", param);
}
else if (action == TopMenuAction_SelectOption)
{
PerformCancelVote(param);
RedisplayAdminMenu(topmenu, param);
}
else if (action == TopMenuAction_DrawOption)
{
buffer[0] = IsVoteInProgress() ? ITEMDRAW_DEFAULT : ITEMDRAW_IGNORE;
}
}
public Action:Command_CancelVote(client, args)
{
PerformCancelVote(client);
return Plugin_Handled;
}
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
new Handle:g_ConfigMenu = INVALID_HANDLE;
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
public MenuHandler_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
PerformWho(client, target, ReplySource:reply, bool:is_admin)
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
DisplayVoteBanMenu(client, target)
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
new Handle:g_MapList = INVALID_HANDLE;
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
DisplayVoteAllTalkMenu(client)
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
DisplayVoteBurnMenu(client, target, String:name[])
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
DisplayVoteFFMenu(client)
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
+1 -1
View File
@@ -28,7 +28,7 @@
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
* Version: $Id: admin-flatfile.sp 1438 2007-09-16 03:45:06Z dvander $
* Version: $Id$
*/
+325 -325
View File
@@ -1,325 +1,325 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _bitbuffer_included
#endinput
#endif
#define _bitbuffer_included
/**
* Writes a single bit to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param bit Bit to write (true for 1, false for 0).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteBool(Handle:bf, bool:bit);
/**
* Writes a byte to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param byte Byte to write (value will be written as 8bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteByte(Handle:bf, byte);
/**
* Writes a byte to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param chr Character to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteChar(Handle:bf, chr);
/**
* Writes a 16bit integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 16bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteShort(Handle:bf, num);
/**
* Writes a 16bit unsigned integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 16bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteWord(Handle:bf, num);
/**
* Writes a normal integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 32bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteNum(Handle:bf, num);
/**
* Writes a floating point number to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Number to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteFloat(Handle:bf, Float:num);
/**
* Writes a string to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param string Text string to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteString(Handle:bf, const String:string[]);
/**
* Writes an entity to a writable bitbuffer (bf_write).
* @note This is a wrapper around BfWriteShort().
*
* @param bf bf_write handle to write to.
* @param ent Entity index to write.
* @noreturn
* @error Invalid or incorrect Handle, or invalid entity.
*/
native BfWriteEntity(Handle:bf, ent);
/**
* Writes a bit angle to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param angle Angle to write.
* @param numBits Optional number of bits to use.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteAngle(Handle:bf, Float:angle, numBits=8);
/**
* Writes a coordinate to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param coord Coordinate to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteCoord(Handle:bf, Float:coord);
/**
* Writes a 3D vector of coordinates to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param coord Coordinate array to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteVecCoord(Handle:bf, Float:coord[3]);
/**
* Writes a 3D normal vector to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param vec Vector to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteVecNormal(Handle:bf, Float:vec[3]);
/**
* Writes a 3D angle vector to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param angles Angle vector to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteAngles(Handle:bf, Float:angles[3]);
/**
* Reads a single bit from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Bit value read.
* @error Invalid or incorrect Handle.
*/
native bool:BfReadBool(Handle:bf);
/**
* Reads a byte from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Byte value read (read as 8bit).
* @error Invalid or incorrect Handle.
*/
native BfReadByte(Handle:bf);
/**
* Reads a character from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Character value read.
* @error Invalid or incorrect Handle.
*/
native BfReadChar(Handle:bf);
/**
* Reads a 16bit integer from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 16bit).
* @error Invalid or incorrect Handle.
*/
native BfReadShort(Handle:bf);
/**
* Reads a 16bit unsigned integer from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 16bit).
* @error Invalid or incorrect Handle.
*/
native BfReadWord(Handle:bf);
/**
* Reads a normal integer to a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 32bit).
* @error Invalid or incorrect Handle.
*/
native BfReadNum(Handle:bf);
/**
* Reads a floating point number from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Floating point value read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadFloat(Handle:bf);
/**
* Reads a string from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param buffer Destination string buffer.
* @param maxlength Maximum length of output string buffer.
* @param line If true the buffer will be copied until it reaches a '\n' or a null terminator.
* @return Number of bytes written to the buffer. If the bitbuffer stream overflowed,
* that is, had no terminator before the end of the stream, then a negative
* number will be returned equal to the number of characters written to the
* buffer minus 1. The buffer will be null terminated regardless of the
* return value.
* @error Invalid or incorrect Handle.
*/
native BfReadString(Handle:bf, String:buffer[], maxlength, bool:line=false);
/**
* Reads an entity from a readable bitbuffer (bf_read).
* @note This is a wrapper around BfReadShort().
*
* @param bf bf_read handle to read from.
* @return Entity index read.
* @error Invalid or incorrect Handle.
*/
native BfReadEntity(Handle:bf);
/**
* Reads a bit angle from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param numBits Optional number of bits to use.
* @return Angle read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadAngle(Handle:bf, numBits=8);
/**
* Reads a coordinate from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Coordinate read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadCoord(Handle:bf);
/**
* Reads a 3D vector of coordinates from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param coord Destination coordinate array.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadVecCoord(Handle:bf, Float:coord[3]);
/**
* Reads a 3D normal vector from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param vec Destination vector array.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadVecNormal(Handle:bf, Float:vec[3]);
/**
* Reads a 3D angle vector from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param angles Destination angle vector.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadAngles(Handle:bf, Float:angles[3]);
/**
* Returns the number of bytes left in a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Number of bytes left unread.
* @error Invalid or incorrect Handle.
*/
native BfGetNumBytesLeft(Handle:bf);
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _bitbuffer_included
#endinput
#endif
#define _bitbuffer_included
/**
* Writes a single bit to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param bit Bit to write (true for 1, false for 0).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteBool(Handle:bf, bool:bit);
/**
* Writes a byte to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param byte Byte to write (value will be written as 8bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteByte(Handle:bf, byte);
/**
* Writes a byte to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param chr Character to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteChar(Handle:bf, chr);
/**
* Writes a 16bit integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 16bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteShort(Handle:bf, num);
/**
* Writes a 16bit unsigned integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 16bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteWord(Handle:bf, num);
/**
* Writes a normal integer to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Integer to write (value will be written as 32bit).
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteNum(Handle:bf, num);
/**
* Writes a floating point number to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param num Number to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteFloat(Handle:bf, Float:num);
/**
* Writes a string to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param string Text string to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteString(Handle:bf, const String:string[]);
/**
* Writes an entity to a writable bitbuffer (bf_write).
* @note This is a wrapper around BfWriteShort().
*
* @param bf bf_write handle to write to.
* @param ent Entity index to write.
* @noreturn
* @error Invalid or incorrect Handle, or invalid entity.
*/
native BfWriteEntity(Handle:bf, ent);
/**
* Writes a bit angle to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param angle Angle to write.
* @param numBits Optional number of bits to use.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteAngle(Handle:bf, Float:angle, numBits=8);
/**
* Writes a coordinate to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param coord Coordinate to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteCoord(Handle:bf, Float:coord);
/**
* Writes a 3D vector of coordinates to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param coord Coordinate array to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteVecCoord(Handle:bf, Float:coord[3]);
/**
* Writes a 3D normal vector to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param vec Vector to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteVecNormal(Handle:bf, Float:vec[3]);
/**
* Writes a 3D angle vector to a writable bitbuffer (bf_write).
*
* @param bf bf_write handle to write to.
* @param angles Angle vector to write.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfWriteAngles(Handle:bf, Float:angles[3]);
/**
* Reads a single bit from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Bit value read.
* @error Invalid or incorrect Handle.
*/
native bool:BfReadBool(Handle:bf);
/**
* Reads a byte from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Byte value read (read as 8bit).
* @error Invalid or incorrect Handle.
*/
native BfReadByte(Handle:bf);
/**
* Reads a character from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Character value read.
* @error Invalid or incorrect Handle.
*/
native BfReadChar(Handle:bf);
/**
* Reads a 16bit integer from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 16bit).
* @error Invalid or incorrect Handle.
*/
native BfReadShort(Handle:bf);
/**
* Reads a 16bit unsigned integer from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 16bit).
* @error Invalid or incorrect Handle.
*/
native BfReadWord(Handle:bf);
/**
* Reads a normal integer to a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Integer value read (read as 32bit).
* @error Invalid or incorrect Handle.
*/
native BfReadNum(Handle:bf);
/**
* Reads a floating point number from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Floating point value read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadFloat(Handle:bf);
/**
* Reads a string from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param buffer Destination string buffer.
* @param maxlength Maximum length of output string buffer.
* @param line If true the buffer will be copied until it reaches a '\n' or a null terminator.
* @return Number of bytes written to the buffer. If the bitbuffer stream overflowed,
* that is, had no terminator before the end of the stream, then a negative
* number will be returned equal to the number of characters written to the
* buffer minus 1. The buffer will be null terminated regardless of the
* return value.
* @error Invalid or incorrect Handle.
*/
native BfReadString(Handle:bf, String:buffer[], maxlength, bool:line=false);
/**
* Reads an entity from a readable bitbuffer (bf_read).
* @note This is a wrapper around BfReadShort().
*
* @param bf bf_read handle to read from.
* @return Entity index read.
* @error Invalid or incorrect Handle.
*/
native BfReadEntity(Handle:bf);
/**
* Reads a bit angle from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param numBits Optional number of bits to use.
* @return Angle read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadAngle(Handle:bf, numBits=8);
/**
* Reads a coordinate from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Coordinate read.
* @error Invalid or incorrect Handle.
*/
native Float:BfReadCoord(Handle:bf);
/**
* Reads a 3D vector of coordinates from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param coord Destination coordinate array.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadVecCoord(Handle:bf, Float:coord[3]);
/**
* Reads a 3D normal vector from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param vec Destination vector array.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadVecNormal(Handle:bf, Float:vec[3]);
/**
* Reads a 3D angle vector from a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @param angles Destination angle vector.
* @noreturn
* @error Invalid or incorrect Handle.
*/
native BfReadAngles(Handle:bf, Float:angles[3]);
/**
* Returns the number of bytes left in a readable bitbuffer (bf_read).
*
* @param bf bf_read handle to read from.
* @return Number of bytes left unread.
* @error Invalid or incorrect Handle.
*/
native BfGetNumBytesLeft(Handle:bf);
+272 -272
View File
@@ -1,272 +1,272 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _sdktools_trace_included
#endinput
#endif
#define _sdktools_trace_included
#define CONTENTS_EMPTY 0 /**< No contents. */
#define CONTENTS_SOLID 0x1 /**< an eye is never valid in a solid . */
#define CONTENTS_WINDOW 0x2 /**< translucent, but not watery (glass). */
#define CONTENTS_AUX 0x4
#define CONTENTS_GRATE 0x8 /**< alpha-tested "grate" textures. Bullets/sight pass through, but solids don't. */
#define CONTENTS_SLIME 0x10
#define CONTENTS_WATER 0x20
#define CONTENTS_MIST 0x40
#define CONTENTS_OPAQUE 0x80 /**< things that cannot be seen through (may be non-solid though). */
#define LAST_VISIBLE_CONTENTS 0x80
#define ALL_VISIBLE_CONTENTS (LAST_VISIBLE_CONTENTS | (LAST_VISIBLE_CONTENTS-1))
#define CONTENTS_TESTFOGVOLUME 0x100
#define CONTENTS_UNUSED5 0x200
#define CONTENTS_UNUSED6 0x4000
#define CONTENTS_TEAM1 0x800 /**< per team contents used to differentiate collisions. */
#define CONTENTS_TEAM2 0x1000 /**< between players and objects on different teams. */
#define CONTENTS_IGNORE_NODRAW_OPAQUE 0x2000 /**< ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW. */
#define CONTENTS_MOVEABLE 0x4000 /**< hits entities which are MOVETYPE_PUSH (doors, plats, etc) */
#define CONTENTS_AREAPORTAL 0x8000 /**< remaining contents are non-visible, and don't eat brushes. */
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
/**
* @section currents can be added to any other contents, and may be mixed
*/
#define CONTENTS_CURRENT_0 0x40000
#define CONTENTS_CURRENT_90 0x80000
#define CONTENTS_CURRENT_180 0x100000
#define CONTENTS_CURRENT_270 0x200000
#define CONTENTS_CURRENT_UP 0x400000
#define CONTENTS_CURRENT_DOWN 0x800000
/**
* @endsection
*/
#define CONTENTS_ORIGIN 0x1000000 /**< removed before bsping an entity. */
#define CONTENTS_MONSTER 0x2000000 /**< should never be on a brush, only in game. */
#define CONTENTS_DEBRIS 0x4000000
#define CONTENTS_DETAIL 0x8000000 /**< brushes to be added after vis leafs. */
#define CONTENTS_TRANSLUCENT 0x10000000 /**< auto set if any surface has trans. */
#define CONTENTS_LADDER 0x20000000
#define CONTENTS_HITBOX 0x40000000 /**< use accurate hitboxes on trace. */
/**
* @section Trace masks.
*/
#define MASK_ALL (0xFFFFFFFF)
#define MASK_SOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that is normally solid */
#define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that blocks player movement */
#define MASK_NPCSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< blocks npc movement */
#define MASK_WATER (CONTENTS_WATER|CONTENTS_MOVEABLE|CONTENTS_SLIME) /**< water physics in these contents */
#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_OPAQUE) /**< everything that blocks line of sight for AI, lighting, etc */
#define MASK_OPAQUE_AND_NPCS (MASK_OPAQUE|CONTENTS_MONSTER) /**< everything that blocks line of sight for AI, lighting, etc, but with monsters added. */
#define MASK_VISIBLE (MASK_OPAQUE|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players */
#define MASK_VISIBLE_AND_NPCS (MASK_OPAQUE_AND_NPCS|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players, but with monsters added. */
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_HITBOX) /**< bullets see these as solid */
#define MASK_SHOT_HULL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_GRATE) /**< non-raycasted weapons see this as solid (includes grates) */
#define MASK_SHOT_PORTAL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW) /**< hits solids (not grates) and passes through everything else */
#define MASK_SOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE) /**< everything normally solid, except monsters (world+brush only) */
#define MASK_PLAYERSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_PLAYERCLIP|CONTENTS_GRATE) /**< everything normally solid for player movement, except monsters (world+brush only) */
#define MASK_NPCSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< everything normally solid for npc movement, except monsters (world+brush only) */
#define MASK_NPCWORLDSTATIC (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< just the world, used for route rebuilding */
#define MASK_SPLITAREAPORTAL (CONTENTS_WATER|CONTENTS_SLIME) /**< These are things that can split areaportals */
/**
* @endsection
*/
enum RayType
{
RayType_EndPoint, /**< The trace ray will go from the start position to the end position. */
RayType_Infinite /**< The trace ray will go from the start position to infinity using a direction vector. */
};
funcenum TraceEntityFilter
{
/**
* Called on entity filtering.
*
* @param entity Entity index.
* @param contentsMask Contents Mask.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask),
/**
* Called on entity filtering.
*
* @param entity Entity index.
* @param contentsMask Contents Mask.
* @param data Data value, if used.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask, any:data),
};
/**
* Get the contents mask and the entity index at the given position.
*
* @param pos World position to test.
* @param entindex Entity index found at the given position (by reference).
* @return Contents mask.
*/
native TR_GetPointContents(const Float:pos[3], &entindex=-1);
/**
* Get the point contents testing only the given entity index.
*
* @param entindex Entity index to test.
* @param pos World position.
* @return Contents mask.
*/
native TR_GetPointContentsEnt(entindex, const Float:pos[3]);
/**
* Starts up a new trace ray using a global trace result.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @noreturn
*/
native TR_TraceRay(const Float:pos[3], const Float:vec[3], flags, RayType:rtype);
/**
* Starts up a new trace ray using a global trace result and a customized trace ray filter.
*
* Calling TR_TraceRayFilter or TR_TraceRayFilterEx from inside a filter function is
* currently not allowed and may not work.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @param filter Function to use as a filter.
* @param data Arbitrary data value to pass through to the filter function.
* @noreturn
*/
native TR_TraceRayFilter(const Float:pos[3],
const Float:vec[3],
flags,
RayType:rtype,
TraceEntityFilter:filter,
any:data=0);
/**
* Starts up a new trace ray using a new trace result.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @return Ray trace handle, which must be closed via CloseHandle().
*/
native Handle:TR_TraceRayEx(const Float:pos[3], const Float:vec[3], flags, RayType:rtype);
/**
* Starts up a new trace ray using a new trace result and a customized trace ray filter.
*
* Calling TR_TraceRayFilter or TR_TraceRayFilterEx from inside a filter function is
* currently not allowed and may not work.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @param filter Function to use as a filter.
* @param data Arbitrary data value to pass through to the filter function.
* @return Ray trace handle, which must be closed via CloseHandle().
*/
native Handle:TR_TraceRayFilterEx(const Float:pos[3],
const Float:vec[3],
flags,
RayType:rtype,
TraceEntityFilter:filter,
any:data=0);
/**
* Returns the time fraction from a trace result (1.0 means no collision).
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Time fraction value of the trace.
* @error Invalid Handle.
*/
native Float:TR_GetFraction(Handle:hndl=INVALID_HANDLE);
/**
* Returns the collision position of a trace result.
*
* @param pos Vector buffer to store data in.
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @noreturn
* @error Invalid Handle.
*/
native TR_GetEndPosition(Float:pos[3], Handle:hndl=INVALID_HANDLE);
/**
* Returns the entity index that collided with the trace.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Entity index or -1 for no collision.
* @error Invalid Handle.
*/
native TR_GetEntityIndex(Handle:hndl=INVALID_HANDLE);
/**
* Returns if there was any kind of collision along the trace ray.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return True if any collision found, otherwise false.
* @error Invalid Handle.
*/
native bool:TR_DidHit(Handle:hndl=INVALID_HANDLE);
/**
* Returns in which body hit group the trace collided if any.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Body hit group.
* @error Invalid Handle.
*/
native TR_GetHitGroup(Handle:hndl=INVALID_HANDLE);
/**
* Find the normal vector to the collison plane of a trace.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @param normal Vector buffer to store the vector normal to the collision plane
* @noreturn
* @error Invalid Handle
*/
native TR_GetPlaneNormal(Handle:hndl, Float:normal[3]);
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _sdktools_trace_included
#endinput
#endif
#define _sdktools_trace_included
#define CONTENTS_EMPTY 0 /**< No contents. */
#define CONTENTS_SOLID 0x1 /**< an eye is never valid in a solid . */
#define CONTENTS_WINDOW 0x2 /**< translucent, but not watery (glass). */
#define CONTENTS_AUX 0x4
#define CONTENTS_GRATE 0x8 /**< alpha-tested "grate" textures. Bullets/sight pass through, but solids don't. */
#define CONTENTS_SLIME 0x10
#define CONTENTS_WATER 0x20
#define CONTENTS_MIST 0x40
#define CONTENTS_OPAQUE 0x80 /**< things that cannot be seen through (may be non-solid though). */
#define LAST_VISIBLE_CONTENTS 0x80
#define ALL_VISIBLE_CONTENTS (LAST_VISIBLE_CONTENTS | (LAST_VISIBLE_CONTENTS-1))
#define CONTENTS_TESTFOGVOLUME 0x100
#define CONTENTS_UNUSED5 0x200
#define CONTENTS_UNUSED6 0x4000
#define CONTENTS_TEAM1 0x800 /**< per team contents used to differentiate collisions. */
#define CONTENTS_TEAM2 0x1000 /**< between players and objects on different teams. */
#define CONTENTS_IGNORE_NODRAW_OPAQUE 0x2000 /**< ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW. */
#define CONTENTS_MOVEABLE 0x4000 /**< hits entities which are MOVETYPE_PUSH (doors, plats, etc) */
#define CONTENTS_AREAPORTAL 0x8000 /**< remaining contents are non-visible, and don't eat brushes. */
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000
/**
* @section currents can be added to any other contents, and may be mixed
*/
#define CONTENTS_CURRENT_0 0x40000
#define CONTENTS_CURRENT_90 0x80000
#define CONTENTS_CURRENT_180 0x100000
#define CONTENTS_CURRENT_270 0x200000
#define CONTENTS_CURRENT_UP 0x400000
#define CONTENTS_CURRENT_DOWN 0x800000
/**
* @endsection
*/
#define CONTENTS_ORIGIN 0x1000000 /**< removed before bsping an entity. */
#define CONTENTS_MONSTER 0x2000000 /**< should never be on a brush, only in game. */
#define CONTENTS_DEBRIS 0x4000000
#define CONTENTS_DETAIL 0x8000000 /**< brushes to be added after vis leafs. */
#define CONTENTS_TRANSLUCENT 0x10000000 /**< auto set if any surface has trans. */
#define CONTENTS_LADDER 0x20000000
#define CONTENTS_HITBOX 0x40000000 /**< use accurate hitboxes on trace. */
/**
* @section Trace masks.
*/
#define MASK_ALL (0xFFFFFFFF)
#define MASK_SOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that is normally solid */
#define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< everything that blocks player movement */
#define MASK_NPCSOLID (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER|CONTENTS_GRATE) /**< blocks npc movement */
#define MASK_WATER (CONTENTS_WATER|CONTENTS_MOVEABLE|CONTENTS_SLIME) /**< water physics in these contents */
#define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_OPAQUE) /**< everything that blocks line of sight for AI, lighting, etc */
#define MASK_OPAQUE_AND_NPCS (MASK_OPAQUE|CONTENTS_MONSTER) /**< everything that blocks line of sight for AI, lighting, etc, but with monsters added. */
#define MASK_VISIBLE (MASK_OPAQUE|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players */
#define MASK_VISIBLE_AND_NPCS (MASK_OPAQUE_AND_NPCS|CONTENTS_IGNORE_NODRAW_OPAQUE) /**< everything that blocks line of sight for players, but with monsters added. */
#define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_HITBOX) /**< bullets see these as solid */
#define MASK_SHOT_HULL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEBRIS|CONTENTS_GRATE) /**< non-raycasted weapons see this as solid (includes grates) */
#define MASK_SHOT_PORTAL (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW) /**< hits solids (not grates) and passes through everything else */
#define MASK_SOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE) /**< everything normally solid, except monsters (world+brush only) */
#define MASK_PLAYERSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_PLAYERCLIP|CONTENTS_GRATE) /**< everything normally solid for player movement, except monsters (world+brush only) */
#define MASK_NPCSOLID_BRUSHONLY (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< everything normally solid for npc movement, except monsters (world+brush only) */
#define MASK_NPCWORLDSTATIC (CONTENTS_SOLID|CONTENTS_WINDOW|CONTENTS_MONSTERCLIP|CONTENTS_GRATE) /**< just the world, used for route rebuilding */
#define MASK_SPLITAREAPORTAL (CONTENTS_WATER|CONTENTS_SLIME) /**< These are things that can split areaportals */
/**
* @endsection
*/
enum RayType
{
RayType_EndPoint, /**< The trace ray will go from the start position to the end position. */
RayType_Infinite /**< The trace ray will go from the start position to infinity using a direction vector. */
};
funcenum TraceEntityFilter
{
/**
* Called on entity filtering.
*
* @param entity Entity index.
* @param contentsMask Contents Mask.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask),
/**
* Called on entity filtering.
*
* @param entity Entity index.
* @param contentsMask Contents Mask.
* @param data Data value, if used.
* @return True to allow the current entity to be hit, otherwise false.
*/
bool:public(entity, contentsMask, any:data),
};
/**
* Get the contents mask and the entity index at the given position.
*
* @param pos World position to test.
* @param entindex Entity index found at the given position (by reference).
* @return Contents mask.
*/
native TR_GetPointContents(const Float:pos[3], &entindex=-1);
/**
* Get the point contents testing only the given entity index.
*
* @param entindex Entity index to test.
* @param pos World position.
* @return Contents mask.
*/
native TR_GetPointContentsEnt(entindex, const Float:pos[3]);
/**
* Starts up a new trace ray using a global trace result.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @noreturn
*/
native TR_TraceRay(const Float:pos[3], const Float:vec[3], flags, RayType:rtype);
/**
* Starts up a new trace ray using a global trace result and a customized trace ray filter.
*
* Calling TR_TraceRayFilter or TR_TraceRayFilterEx from inside a filter function is
* currently not allowed and may not work.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @param filter Function to use as a filter.
* @param data Arbitrary data value to pass through to the filter function.
* @noreturn
*/
native TR_TraceRayFilter(const Float:pos[3],
const Float:vec[3],
flags,
RayType:rtype,
TraceEntityFilter:filter,
any:data=0);
/**
* Starts up a new trace ray using a new trace result.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @return Ray trace handle, which must be closed via CloseHandle().
*/
native Handle:TR_TraceRayEx(const Float:pos[3], const Float:vec[3], flags, RayType:rtype);
/**
* Starts up a new trace ray using a new trace result and a customized trace ray filter.
*
* Calling TR_TraceRayFilter or TR_TraceRayFilterEx from inside a filter function is
* currently not allowed and may not work.
*
* @param pos Starting position of the ray.
* @param vec Depending on RayType, it will be used as the ending point, or the direction angle.
* @param flags Trace flags.
* @param rtype Method to calculate the ray direction.
* @param filter Function to use as a filter.
* @param data Arbitrary data value to pass through to the filter function.
* @return Ray trace handle, which must be closed via CloseHandle().
*/
native Handle:TR_TraceRayFilterEx(const Float:pos[3],
const Float:vec[3],
flags,
RayType:rtype,
TraceEntityFilter:filter,
any:data=0);
/**
* Returns the time fraction from a trace result (1.0 means no collision).
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Time fraction value of the trace.
* @error Invalid Handle.
*/
native Float:TR_GetFraction(Handle:hndl=INVALID_HANDLE);
/**
* Returns the collision position of a trace result.
*
* @param pos Vector buffer to store data in.
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @noreturn
* @error Invalid Handle.
*/
native TR_GetEndPosition(Float:pos[3], Handle:hndl=INVALID_HANDLE);
/**
* Returns the entity index that collided with the trace.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Entity index or -1 for no collision.
* @error Invalid Handle.
*/
native TR_GetEntityIndex(Handle:hndl=INVALID_HANDLE);
/**
* Returns if there was any kind of collision along the trace ray.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return True if any collision found, otherwise false.
* @error Invalid Handle.
*/
native bool:TR_DidHit(Handle:hndl=INVALID_HANDLE);
/**
* Returns in which body hit group the trace collided if any.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @return Body hit group.
* @error Invalid Handle.
*/
native TR_GetHitGroup(Handle:hndl=INVALID_HANDLE);
/**
* Find the normal vector to the collison plane of a trace.
*
* @param hndl A trace Handle, or INVALID_HANDLE to use a global trace result.
* @param normal Vector buffer to store the vector normal to the collision plane
* @noreturn
* @error Invalid Handle
*/
native TR_GetPlaneNormal(Handle:hndl, Float:normal[3]);
+290 -290
View File
@@ -1,290 +1,290 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _topmenus_included
#endinput
#endif
#define _topmenus_included
#include <menus>
/**
* Actions a top menu will take on an object.
*/
enum TopMenuAction
{
/**
* An option is being drawn for a menu (or for sorting purposes).
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: Buffer for rendering, maxlength of buffer.
*/
TopMenuAction_DisplayOption = 0,
/**
* The title of a menu is being drawn for a given object.
*
* Note: The Object ID will be INVALID_TOPMENUOBJECT if drawing the
* root title. Otherwise, the Object ID is a category.
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: Buffer for rendering, maxlength of buffer.
*/
TopMenuAction_DisplayTitle = 1,
/**
* A menu option has been selected.
*
* The Object ID will always be an item (not a category).
*
* INPUT : TopMenu Handle, object ID, client index.
*/
TopMenuAction_SelectOption = 2,
/**
* A menu option is being drawn and its flags can be overridden.
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: The first byte of the 'buffer' string should be set
* to the desired flags. By default, it will contain
* ITEMDRAW_DEFAULT.
*/
TopMenuAction_DrawOption = 3,
/**
* Called when an object is being removed from the menu.
* This can be used to clean up data stored in the info string.
*
* INPUT : TopMenu Handle, object ID.
*/
TopMenuAction_RemoveObject = 4,
};
/**
* Top menu object types.
*/
enum TopMenuObjectType
{
TopMenuObject_Category = 0, /**< Category (sub-menu branching from root) */
TopMenuObject_Item = 1 /**< Item on a sub-menu */
};
/**
* Top menu starting positions for display.
*/
enum TopMenuPosition
{
TopMenuPosition_Start = 0, /**< Start/root of the menu */
TopMenuPosition_LastRoot = 1, /**< Last position in the root menu */
TopMenuPosition_LastCategory = 3, /**< Last position in their last category */
};
/**
* Top menu object tag for type checking.
*/
enum TopMenuObject
{
INVALID_TOPMENUOBJECT = 0,
}
/**
* TopMenu callback prototype.
*
* @param topmenu Handle to the TopMenu.
* @param action TopMenuAction being performed.
* @param object_id The object ID (if used).
* @param param Extra parameter (if used).
* @param buffer Output buffer (if used).
* @param maxlength Output buffer (if used).
* @noreturn
*/
functag TopMenuHandler public(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength);
/**
* Creates a TopMenu.
*
* @param handler Handler to use for drawing the root title.
* @return A new TopMenu Handle, or INVALID_HANDLE on failure.
*/
native Handle:CreateTopMenu(TopMenuHandler:handler);
/**
* Re-sorts the items in a TopMenu via a configuration file.
*
* The format of the configuration file should be a Valve Key-Values
* formatted file that SourceMod can parse. There should be one root
* section, and one sub-section for each category. Each sub-section's
* name should match the category name.
*
* Each sub-section may only contain key/value pairs in the form of:
* key: "item"
* value: Name of the item as passed to AddToTopMenu().
*
* The TopMenu will draw items in the order declared in the configuration
* file. If items do not appear in the configuration file, they are sorted
* per-player based on how the handler function renders for that player.
* These items appear after the configuration sorted items.
*
* @param topmenu TopMenu Handle.
* @param file File path.
* @param error Error buffer.
* @param maxlength Maximum size of the error buffer.
* Error buffer will be filled with a
* zero-terminated string if false is
* returned.
* @return True on success, false on failure.
* @error Invalid TopMenu Handle.
*/
native bool:LoadTopMenuConfig(Handle:topmenu, const String:file[], String:error[], maxlength);
/**
* Adds an object to a TopMenu.
*
* @param topmenu TopMenu Handle.
* @param name Object name (MUST be unique).
* @param type Object type.
* @param handler Handler for object.
* @param cmdname Command name (for access overrides).
* @param flags Default access flags.
* @param parent Parent object ID, or INVALID_TOPMENUOBJECT for none.
* Items must have a category parent.
* Categories must not have a parent.
* @param info_string Arbitrary storage (max 255 bytes).
* @return A new TopMenuObject ID, or INVALID_TOPMENUOBJECT on
* failure.
* @error Invalid TopMenu Handle.
*/
native TopMenuObject:AddToTopMenu(Handle:topmenu,
const String:name[],
TopMenuObjectType:type,
TopMenuHandler:handler,
TopMenuObject:parent,
const String:cmdname[]="",
flags=0,
const String:info_string[]="");
/**
* Retrieves the info string of a top menu item.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @param buffer Buffer to store info string.
* @param maxlength Maximum size of info string.
* @return Number of bytes written, not including the
* null terminator.
* @error Invalid TopMenu Handle or TopMenuObject ID.
*/
native GetTopMenuInfoString(Handle:topmenu, TopMenuObject:parent, String:buffer[], maxlength);
/**
* Retrieves the name string of a top menu item.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @param buffer Buffer to store info string.
* @param maxlength Maximum size of info string.
* @return Number of bytes written, not including the
* null terminator.
* @error Invalid TopMenu Handle or TopMenuObject ID.
*/
native GetTopMenuObjName(Handle:topmenu, TopMenuObject:object, String:buffer[], maxlength);
/**
* Removes an object from a TopMenu.
*
* Plugins' objects are automatically removed all TopMenus when the given
* plugin unloads or pauses. In the case of unpausing, all items are restored.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @noreturn
* @error Invalid TopMenu Handle.
*/
native RemoveFromTopMenu(Handle:topmenu, TopMenuObject:object);
/**
* Displays a TopMenu to a client.
*
* @param topmenu TopMenu Handle.
* @param client Client index.
* @param position Position to display from.
* @return True on success, false on failure.
* @error Invalid TopMenu Handle or client not in game.
*/
native bool:DisplayTopMenu(Handle:topmenu, client, TopMenuPosition:position);
/**
* Finds a category's object ID in a TopMenu.
*
* @param topmenu TopMenu Handle.
* @param name Object's unique name.
* @return TopMenuObject ID on success, or
* INVALID_TOPMENUOBJECT on failure.
* @error Invalid TopMenu Handle.
*/
native TopMenuObject:FindTopMenuCategory(Handle:topmenu, const String:name[]);
/**
* Do not edit below this line!
*/
public Extension:__ext_topmenus =
{
name = "TopMenus",
file = "topmenus.ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_EXTENSIONS
public __ext_topmenus_SetNTVOptional()
{
MarkNativeAsOptional("CreateTopMenu");
MarkNativeAsOptional("LoadTopMenuConfig");
MarkNativeAsOptional("AddToTopMenu");
MarkNativeAsOptional("RemoveFromTopMenu");
MarkNativeAsOptional("DisplayTopMenu");
MarkNativeAsOptional("FindTopMenuCategory");
}
#endif
/**
* 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 <http://www.gnu.org/licenses/>.
*
* 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 <http://www.sourcemod.net/license.php>.
*
* Version: $Id$
*/
#if defined _topmenus_included
#endinput
#endif
#define _topmenus_included
#include <menus>
/**
* Actions a top menu will take on an object.
*/
enum TopMenuAction
{
/**
* An option is being drawn for a menu (or for sorting purposes).
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: Buffer for rendering, maxlength of buffer.
*/
TopMenuAction_DisplayOption = 0,
/**
* The title of a menu is being drawn for a given object.
*
* Note: The Object ID will be INVALID_TOPMENUOBJECT if drawing the
* root title. Otherwise, the Object ID is a category.
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: Buffer for rendering, maxlength of buffer.
*/
TopMenuAction_DisplayTitle = 1,
/**
* A menu option has been selected.
*
* The Object ID will always be an item (not a category).
*
* INPUT : TopMenu Handle, object ID, client index.
*/
TopMenuAction_SelectOption = 2,
/**
* A menu option is being drawn and its flags can be overridden.
*
* INPUT : TopMenu Handle, object ID, client index.
* OUTPUT: The first byte of the 'buffer' string should be set
* to the desired flags. By default, it will contain
* ITEMDRAW_DEFAULT.
*/
TopMenuAction_DrawOption = 3,
/**
* Called when an object is being removed from the menu.
* This can be used to clean up data stored in the info string.
*
* INPUT : TopMenu Handle, object ID.
*/
TopMenuAction_RemoveObject = 4,
};
/**
* Top menu object types.
*/
enum TopMenuObjectType
{
TopMenuObject_Category = 0, /**< Category (sub-menu branching from root) */
TopMenuObject_Item = 1 /**< Item on a sub-menu */
};
/**
* Top menu starting positions for display.
*/
enum TopMenuPosition
{
TopMenuPosition_Start = 0, /**< Start/root of the menu */
TopMenuPosition_LastRoot = 1, /**< Last position in the root menu */
TopMenuPosition_LastCategory = 3, /**< Last position in their last category */
};
/**
* Top menu object tag for type checking.
*/
enum TopMenuObject
{
INVALID_TOPMENUOBJECT = 0,
}
/**
* TopMenu callback prototype.
*
* @param topmenu Handle to the TopMenu.
* @param action TopMenuAction being performed.
* @param object_id The object ID (if used).
* @param param Extra parameter (if used).
* @param buffer Output buffer (if used).
* @param maxlength Output buffer (if used).
* @noreturn
*/
functag TopMenuHandler public(Handle:topmenu,
TopMenuAction:action,
TopMenuObject:object_id,
param,
String:buffer[],
maxlength);
/**
* Creates a TopMenu.
*
* @param handler Handler to use for drawing the root title.
* @return A new TopMenu Handle, or INVALID_HANDLE on failure.
*/
native Handle:CreateTopMenu(TopMenuHandler:handler);
/**
* Re-sorts the items in a TopMenu via a configuration file.
*
* The format of the configuration file should be a Valve Key-Values
* formatted file that SourceMod can parse. There should be one root
* section, and one sub-section for each category. Each sub-section's
* name should match the category name.
*
* Each sub-section may only contain key/value pairs in the form of:
* key: "item"
* value: Name of the item as passed to AddToTopMenu().
*
* The TopMenu will draw items in the order declared in the configuration
* file. If items do not appear in the configuration file, they are sorted
* per-player based on how the handler function renders for that player.
* These items appear after the configuration sorted items.
*
* @param topmenu TopMenu Handle.
* @param file File path.
* @param error Error buffer.
* @param maxlength Maximum size of the error buffer.
* Error buffer will be filled with a
* zero-terminated string if false is
* returned.
* @return True on success, false on failure.
* @error Invalid TopMenu Handle.
*/
native bool:LoadTopMenuConfig(Handle:topmenu, const String:file[], String:error[], maxlength);
/**
* Adds an object to a TopMenu.
*
* @param topmenu TopMenu Handle.
* @param name Object name (MUST be unique).
* @param type Object type.
* @param handler Handler for object.
* @param cmdname Command name (for access overrides).
* @param flags Default access flags.
* @param parent Parent object ID, or INVALID_TOPMENUOBJECT for none.
* Items must have a category parent.
* Categories must not have a parent.
* @param info_string Arbitrary storage (max 255 bytes).
* @return A new TopMenuObject ID, or INVALID_TOPMENUOBJECT on
* failure.
* @error Invalid TopMenu Handle.
*/
native TopMenuObject:AddToTopMenu(Handle:topmenu,
const String:name[],
TopMenuObjectType:type,
TopMenuHandler:handler,
TopMenuObject:parent,
const String:cmdname[]="",
flags=0,
const String:info_string[]="");
/**
* Retrieves the info string of a top menu item.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @param buffer Buffer to store info string.
* @param maxlength Maximum size of info string.
* @return Number of bytes written, not including the
* null terminator.
* @error Invalid TopMenu Handle or TopMenuObject ID.
*/
native GetTopMenuInfoString(Handle:topmenu, TopMenuObject:parent, String:buffer[], maxlength);
/**
* Retrieves the name string of a top menu item.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @param buffer Buffer to store info string.
* @param maxlength Maximum size of info string.
* @return Number of bytes written, not including the
* null terminator.
* @error Invalid TopMenu Handle or TopMenuObject ID.
*/
native GetTopMenuObjName(Handle:topmenu, TopMenuObject:object, String:buffer[], maxlength);
/**
* Removes an object from a TopMenu.
*
* Plugins' objects are automatically removed all TopMenus when the given
* plugin unloads or pauses. In the case of unpausing, all items are restored.
*
* @param topmenu TopMenu Handle.
* @param object TopMenuObject ID.
* @noreturn
* @error Invalid TopMenu Handle.
*/
native RemoveFromTopMenu(Handle:topmenu, TopMenuObject:object);
/**
* Displays a TopMenu to a client.
*
* @param topmenu TopMenu Handle.
* @param client Client index.
* @param position Position to display from.
* @return True on success, false on failure.
* @error Invalid TopMenu Handle or client not in game.
*/
native bool:DisplayTopMenu(Handle:topmenu, client, TopMenuPosition:position);
/**
* Finds a category's object ID in a TopMenu.
*
* @param topmenu TopMenu Handle.
* @param name Object's unique name.
* @return TopMenuObject ID on success, or
* INVALID_TOPMENUOBJECT on failure.
* @error Invalid TopMenu Handle.
*/
native TopMenuObject:FindTopMenuCategory(Handle:topmenu, const String:name[]);
/**
* Do not edit below this line!
*/
public Extension:__ext_topmenus =
{
name = "TopMenus",
file = "topmenus.ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_EXTENSIONS
public __ext_topmenus_SetNTVOptional()
{
MarkNativeAsOptional("CreateTopMenu");
MarkNativeAsOptional("LoadTopMenuConfig");
MarkNativeAsOptional("AddToTopMenu");
MarkNativeAsOptional("RemoveFromTopMenu");
MarkNativeAsOptional("DisplayTopMenu");
MarkNativeAsOptional("FindTopMenuCategory");
}
#endif