Documentation corrections and additions (#1498)

* Added `@error` documentation for every function that's missing it.
* Changed tabs to spaces (text alignment)
This commit is contained in:
Natanel Shitrit
2021-06-24 15:45:01 +01:00
committed by GitHub
parent 2778b132f0
commit d73f4e7eca
15 changed files with 73 additions and 37 deletions
+12 -10
View File
@@ -123,7 +123,7 @@ native void SlapPlayer(int client, int health=5, bool sound=true);
* Use -1 to start from the first entity.
* @param classname Classname of the entity to find.
* @return Entity index >= 0 if found, -1 otherwise.
* @error Lack of mod support or invalid start entity.
* @error Invalid start entity or lack of mod support.
*/
native int FindEntityByClassname(int startEnt, const char[] classname);
@@ -133,7 +133,7 @@ native int FindEntityByClassname(int startEnt, const char[] classname);
* @param client Player's index.
* @param ang Destination vector to store the client's eye angles.
* @return True on success, false on failure.
* @error Invalid client index, client not in game, or no mod support.
* @error Invalid client index, client not in game, or lack of mod support.
*/
native bool GetClientEyeAngles(int client, float ang[3]);
@@ -145,7 +145,7 @@ native bool GetClientEyeAngles(int client, float ang[3]);
* @param classname Entity classname.
* @param ForceEdictIndex Edict index used by the created entity (ignored on Orangebox and above).
* @return Entity index on success, or -1 on failure.
* @error Invalid edict index, or no mod support.
* @error Invalid edict index, no map is running, or lack of mod support.
*/
native int CreateEntityByName(const char[] classname, int ForceEdictIndex=-1);
@@ -154,7 +154,7 @@ native int CreateEntityByName(const char[] classname, int ForceEdictIndex=-1);
*
* @param entity Entity index of the created entity.
* @return True on success, false otherwise.
* @error Invalid entity index, or no mod support.
* @error Invalid entity index or lack of mod support.
*/
native bool DispatchSpawn(int entity);
@@ -165,7 +165,7 @@ native bool DispatchSpawn(int entity);
* @param keyName Name of the key.
* @param value String value.
* @return True on success, false otherwise.
* @error Invalid entity index, or no mod support.
* @error Invalid entity index or lack of mod support.
*/
native bool DispatchKeyValue(int entity, const char[] keyName, const char[] value);
@@ -176,7 +176,7 @@ native bool DispatchKeyValue(int entity, const char[] keyName, const char[] valu
* @param keyName Name of the key.
* @param value Floating point value.
* @return True on success, false otherwise.
* @error Invalid entity index, or no mod support.
* @error Invalid entity index or lack of mod support.
*/
native bool DispatchKeyValueFloat(int entity, const char[] keyName, float value);
@@ -187,7 +187,7 @@ native bool DispatchKeyValueFloat(int entity, const char[] keyName, float value)
* @param keyName Name of the key.
* @param vec Vector value.
* @return True on success, false otherwise.
* @error Invalid entity index, or no mod support.
* @error Invalid entity index or lack of mod support.
*/
native bool DispatchKeyValueVector(int entity, const char[] keyName, const float vec[3]);
@@ -266,7 +266,7 @@ native int GetTeamEntity(int teamIndex);
*
* @param entity Entity index.
* @param model Model name.
* @error Invalid entity index, or no mod support.
* @error Invalid entity index or lack of mod support.
*/
native void SetEntityModel(int entity, const char[] model);
@@ -297,6 +297,7 @@ native bool GetPlayerJingleFile(int client, char[] hex, int maxlength);
*
* @param in Buffer to store the input traffic velocity.
* @param out Buffer to store the output traffic velocity.
* @error Lack of mod support.
*/
native void GetServerNetStats(float &inAmount, float &outAmout);
@@ -325,7 +326,7 @@ native void ActivateEntity(int entity);
* @param client Player's index.
* @param key Key string.
* @param value Value string.
* @error Invalid client index, or client not connected.
* @error Invalid client index, client not connected, or lack of mod support.
*/
native void SetClientInfo(int client, const char[] key, const char[] value);
@@ -334,7 +335,7 @@ native void SetClientInfo(int client, const char[] key, const char[] value);
*
* @param client Player's index.
* @param name New name.
* @error Invalid client index, or client not connected.
* @error Invalid client index, client not connected, or lack of mod support.
*/
native void SetClientName(int client, const char[] name);
@@ -347,5 +348,6 @@ native void SetClientName(int client, const char[] name);
* @param ammotype Type of ammo to give to player.
* @param suppressSound If true, don't play the ammo pickup sound.
* @return Amount of ammo actually given.
* @error Lack of mod support.
*/
native int GivePlayerAmmo(int client, int amount, int ammotype, bool suppressSound=false);