Updated includes and spcomp to SourceMod 1.9
This commit is contained in:
Vendored
+42
-38
@@ -51,29 +51,26 @@ typedef TEHook = function Action (const char[] te_name, const int[] Players, int
|
||||
*
|
||||
* @param te_name TE name to hook.
|
||||
* @param hook Function to use as a hook.
|
||||
* @noreturn
|
||||
* @error Temp Entity name not available or invalid function hook.
|
||||
*/
|
||||
native AddTempEntHook(const String:te_name[], TEHook:hook);
|
||||
native void AddTempEntHook(const char[] te_name, TEHook hook);
|
||||
|
||||
/**
|
||||
* Removes a temp entity hook.
|
||||
*
|
||||
* @param te_name TE name to unhook.
|
||||
* @param hook Function used for the hook.
|
||||
* @noreturn
|
||||
* @error Temp Entity name not available or invalid function hook.
|
||||
*/
|
||||
native RemoveTempEntHook(const String:te_name[], TEHook:hook);
|
||||
native void RemoveTempEntHook(const char[] te_name, TEHook hook);
|
||||
|
||||
/**
|
||||
* Starts a temp entity transmission.
|
||||
*
|
||||
* @param te_name TE name.
|
||||
* @noreturn
|
||||
* @error Temp Entity name not available.
|
||||
*/
|
||||
native TE_Start(const String:te_name[]);
|
||||
native void TE_Start(const char[] te_name);
|
||||
|
||||
/**
|
||||
* Checks if a certain TE property exists.
|
||||
@@ -81,17 +78,16 @@ native TE_Start(const String:te_name[]);
|
||||
* @param prop Property to use.
|
||||
* @return True if the property exists, otherwise false.
|
||||
*/
|
||||
native bool:TE_IsValidProp(const String:prop[]);
|
||||
native bool TE_IsValidProp(const char[] prop);
|
||||
|
||||
/**
|
||||
* Sets an integer value in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param value Integer value to set.
|
||||
* @noreturn
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_WriteNum(const String:prop[], value);
|
||||
native void TE_WriteNum(const char[] prop, int value);
|
||||
|
||||
/**
|
||||
* Reads an integer value in the current temp entity.
|
||||
@@ -100,56 +96,52 @@ native TE_WriteNum(const String:prop[], value);
|
||||
* @return Property value.
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_ReadNum(const String:prop[]);
|
||||
native int TE_ReadNum(const char[] prop);
|
||||
|
||||
/**
|
||||
* Sets a floating point number in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param value Floating point number to set.
|
||||
* @noreturn
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_WriteFloat(const String:prop[], Float:value);
|
||||
native void TE_WriteFloat(const char[] prop, float value);
|
||||
|
||||
/**
|
||||
* Reads a floating point number in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @noreturn Property value.
|
||||
* @return Property value.
|
||||
* @error Property not found.
|
||||
*/
|
||||
native Float:TE_ReadFloat(const String:prop[]);
|
||||
native float TE_ReadFloat(const char[] prop);
|
||||
|
||||
/**
|
||||
* Sets a vector in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param vector Vector to set.
|
||||
* @noreturn
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_WriteVector(const String:prop[], const Float:vector[3]);
|
||||
native void TE_WriteVector(const char[] prop, const float vector[3]);
|
||||
|
||||
/**
|
||||
* Reads a vector in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param vector Vector to read.
|
||||
* @noreturn
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_ReadVector(const String:prop[], Float:vector[3]);
|
||||
native void TE_ReadVector(const char[] prop, float vector[3]);
|
||||
|
||||
/**
|
||||
* Sets a QAngle in the current temp entity.
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param angles Angles to set.
|
||||
* @return True on success, otherwise false.
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_WriteAngles(const String:prop[], const Float:angles[3]);
|
||||
native void TE_WriteAngles(const char[] prop, const float angles[3]);
|
||||
|
||||
/**
|
||||
* Sets an array of floats in the current temp entity.
|
||||
@@ -157,10 +149,9 @@ native TE_WriteAngles(const String:prop[], const Float:angles[3]);
|
||||
* @param prop Property to use.
|
||||
* @param array Array of values to copy.
|
||||
* @param arraySize Number of values to copy.
|
||||
* @return True on success, otherwise false.
|
||||
* @error Property not found.
|
||||
*/
|
||||
native TE_WriteFloatArray(const String:prop[], const Float:array[], arraySize);
|
||||
native void TE_WriteFloatArray(const char[] prop, const float[] array, int arraySize);
|
||||
|
||||
/**
|
||||
* Sends the current temp entity to one or more clients.
|
||||
@@ -168,10 +159,9 @@ native TE_WriteFloatArray(const String:prop[], const Float:array[], arraySize);
|
||||
* @param clients Array containing player indexes to broadcast to.
|
||||
* @param numClients Number of players in the array.
|
||||
* @param delay Delay in seconds to send the TE.
|
||||
* @noreturn
|
||||
* @error Invalid client index or client not in game.
|
||||
*/
|
||||
native TE_Send(const clients[], numClients, Float:delay=0.0);
|
||||
native void TE_Send(const int[] clients, int numClients, float delay=0.0);
|
||||
|
||||
/**
|
||||
* Sets an encoded entity index in the current temp entity.
|
||||
@@ -179,13 +169,12 @@ native TE_Send(const clients[], numClients, Float:delay=0.0);
|
||||
*
|
||||
* @param prop Property to use.
|
||||
* @param value Value to set.
|
||||
* @noreturn
|
||||
* @error Property not found.
|
||||
*/
|
||||
stock TE_WriteEncodedEnt(const String:prop[], value)
|
||||
stock void TE_WriteEncodedEnt(const char[] prop, int value)
|
||||
{
|
||||
new encvalue = (value & 0x0FFF) | ((1 & 0xF)<<12);
|
||||
return TE_WriteNum(prop, encvalue);
|
||||
int encvalue = (value & 0x0FFF) | ((1 & 0xF)<<12);
|
||||
TE_WriteNum(prop, encvalue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -193,20 +182,19 @@ stock TE_WriteEncodedEnt(const String:prop[], value)
|
||||
* @note See TE_Start().
|
||||
*
|
||||
* @param delay Delay in seconds to send the TE.
|
||||
* @noreturn
|
||||
*/
|
||||
stock TE_SendToAll(Float:delay=0.0)
|
||||
stock void TE_SendToAll(float delay=0.0)
|
||||
{
|
||||
new total = 0;
|
||||
new clients[MaxClients];
|
||||
for (new i=1; i<=MaxClients; i++)
|
||||
int total = 0;
|
||||
int[] clients = new int[MaxClients];
|
||||
for (int i=1; i<=MaxClients; i++)
|
||||
{
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
clients[total++] = i;
|
||||
}
|
||||
}
|
||||
return TE_Send(clients, total, delay);
|
||||
TE_Send(clients, total, delay);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,14 +203,30 @@ stock TE_SendToAll(Float:delay=0.0)
|
||||
*
|
||||
* @param client Client to send to.
|
||||
* @param delay Delay in seconds to send the TE.
|
||||
* @noreturn
|
||||
* @error Invalid client index or client not in game.
|
||||
*/
|
||||
stock TE_SendToClient(client, Float:delay=0.0)
|
||||
stock void TE_SendToClient(int client, float delay=0.0)
|
||||
{
|
||||
new players[1];
|
||||
int players[1];
|
||||
|
||||
players[0] = client;
|
||||
|
||||
return TE_Send(players, 1, delay);
|
||||
TE_Send(players, 1, delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the current TE to all clients that are in
|
||||
* visible or audible range of the origin.
|
||||
* @note See TE_Start().
|
||||
* @note See GetClientsInRange()
|
||||
*
|
||||
* @param origin Coordinates from which to test range.
|
||||
* @param rangeType Range type to use for filtering clients.
|
||||
* @param delay Delay in seconds to send the TE.
|
||||
*/
|
||||
stock void TE_SendToAllInRange(float origin[3], ClientRangeType rangeType, float delay=0.0)
|
||||
{
|
||||
int[] clients = new int[MaxClients];
|
||||
int total = GetClientsInRange(origin, rangeType, clients, MaxClients);
|
||||
TE_Send(clients, total, delay);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user