faluco@1031: /** faluco@1031: * vim: set ts=4 : faluco@1031: * =============================================================== faluco@1031: * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. faluco@1031: * =============================================================== faluco@1031: * faluco@1031: * This file is part of the SourceMod/SourcePawn SDK. This file may only be used faluco@1031: * or modified under the Terms and Conditions of its License Agreement, which is found faluco@1031: * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins faluco@1031: * may change at any time. To view the latest information, see: faluco@1031: * http://www.sourcemod.net/license.php faluco@1031: * faluco@1031: * Version: $Id$ faluco@1031: */ faluco@1031: faluco@1031: #if defined _sdktools_tempents_included faluco@1031: #endinput faluco@1031: #endif faluco@1031: #define _sdktools_tempents_included faluco@1031: faluco@1031: /** faluco@1031: * Starts a temp entity transmission. faluco@1031: * faluco@1031: * @param te_name TE name. faluco@1031: * @noreturn faluco@1031: * @error Temp Entity name not available. faluco@1031: */ faluco@1031: native TE_Start(const String:te_name[]); faluco@1031: faluco@1031: /** faluco@1031: * Checks if a certain TE property exists. faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @return True if the property exists, otherwise false. faluco@1031: */ faluco@1031: native bool:TE_IsValidProp(const String:prop[]); faluco@1031: faluco@1031: /** faluco@1031: * Sets an integer value in the current temp entity. faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @param value Integer value to set. faluco@1031: * @noreturn faluco@1031: * @error Property not found. faluco@1031: */ faluco@1031: native TE_WriteNum(const String:prop[], value); faluco@1031: faluco@1031: /** faluco@1031: * Sets a floating point number in the current temp entity. faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @param value Floating point number to set. faluco@1031: * @noreturn faluco@1031: * @error Property not found. faluco@1031: */ faluco@1031: native TE_WriteFloat(const String:prop[], Float:value); faluco@1031: faluco@1031: /** faluco@1031: * Sets a vector in the current temp entity. faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @param vector Vector to set. faluco@1031: * @noreturn faluco@1031: * @error Property not found. faluco@1031: */ faluco@1031: native TE_WriteVector(const String:prop[], Float:vector[3]); faluco@1031: faluco@1031: /** faluco@1031: * Sets a QAngle in the current temp entity. faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @param angles Angles to set. faluco@1031: * @return True on success, otherwise false. faluco@1031: * @error Property not found. faluco@1031: */ faluco@1031: native TE_WriteAngles(const String:prop[], Float:angles[3]); faluco@1031: faluco@1031: /** faluco@1031: * Sends the current temp entity to one or more clients. faluco@1031: * faluco@1031: * @param clients Array containing player indexes to broadcast to. faluco@1031: * @param numClients Number of players in the array. faluco@1031: * @param delay Delay in seconds to send the TE. faluco@1031: * @noreturn faluco@1031: * @error Invalid client index or client not in game. faluco@1031: */ faluco@1031: native TE_Send(clients[], numClients, Float:delay=0.0); faluco@1031: faluco@1031: /** faluco@1031: * Sets an encoded entity index in the current temp entity. faluco@1031: * (This is usually used for m_nStartEntity and m_nEndEntity). faluco@1031: * faluco@1031: * @param prop Property to use. faluco@1031: * @param value Value to set. faluco@1031: * @noreturn faluco@1031: * @error Property not found. faluco@1031: */ faluco@1031: stock TE_WriteEncodedEnt(const String:prop[], value) faluco@1031: { faluco@1031: new encvalue = (value & 0x0FFF) | ((1 & 0xF)<<12); faluco@1031: return TE_WriteNum(prop, encvalue); faluco@1031: } faluco@1031: faluco@1031: /** faluco@1031: * Broadcasts the current temp entity to all clients. faluco@1031: * @note See TE_Start(). faluco@1031: * faluco@1031: * @param delay Delay in seconds to send the TE. faluco@1031: * @noreturn faluco@1031: */ faluco@1031: stock TE_SendToAll(Float:delay=0.0) faluco@1031: { faluco@1031: new maxClients = GetMaxClients(); faluco@1031: new total = 0; faluco@1031: new clients[maxClients]; faluco@1031: for (new i=1; i<=maxClients; i++) faluco@1031: { faluco@1031: if (IsClientInGame(i)) faluco@1031: { faluco@1031: clients[total++] = i; faluco@1031: } faluco@1031: } faluco@1031: return TE_Send(clients, total, delay); faluco@1031: } faluco@1031: faluco@1031: /** faluco@1031: * Sends the current TE to only a client. faluco@1031: * @note See TE_Start(). faluco@1031: * faluco@1031: * @param client Client to send to. faluco@1031: * @param delay Delay in seconds to send the TE. faluco@1031: * @noreturn faluco@1031: * @error Invalid client index or client not in game. faluco@1031: */ faluco@1031: stock TE_SendToOne(client, Float:delay=0.0) faluco@1031: { faluco@1031: new players[1]; faluco@1031: faluco@1031: players[0] = client; faluco@1031: faluco@1031: return TE_Send(players, 1, delay); faluco@1031: }