summaryrefslogtreecommitdiff
path: root/sourcemod/scripting/include/smlib/debug.inc
blob: 6a416ed49e99f81ddc6c3cc03e9572672d73d508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#if defined _smlib_debug_included
	#endinput
#endif
#define _smlib_debug_included

#include <sourcemod>

/**
 * Prints the values of a static Float-Array to the server console.
 *
 * @param array		Static Float-Array.
 * @param size		Size of the Array.
 */
stock void Debug_FloatArray(const float[] array, int size=3)
{
	char output[64] = "";

	for (int i=0; i < size; ++i) {

		if (i > 0 && i < size) {
			StrCat(output, sizeof(output), ", ");
		}

		Format(output, sizeof(output), "%s%f", output, array[i]);
	}

	PrintToServer("[DEBUG] Vector[%d] = { %s }", size, output);
}