From 99476979ad672ad16cb516cc0064fc77d37e74ec Mon Sep 17 00:00:00 2001 From: zaCade Date: Sun, 29 Sep 2019 10:24:22 +0200 Subject: [PATCH] Move the set functions behind the get functions. For organization sake. --- src/zr/tools_functions.inc | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/zr/tools_functions.inc b/src/zr/tools_functions.inc index 44487ee..2ce63f7 100644 --- a/src/zr/tools_functions.inc +++ b/src/zr/tools_functions.inc @@ -181,26 +181,6 @@ stock ToolsClientScore(client, bool:score = true, bool:apply = true, value = 0) return -1; } -/** - * Set a client's alpha value. - * - * @param client The client index. - * @param alpha The alpha value to set client's alpha to. (0-255) - * @param weapons Apply alpha to all client's weapons. - */ -stock ToolsSetClientAlpha(client, alpha) -{ - // Turn rendermode on, on the client. - SetEntityRenderMode(client, RENDER_TRANSALPHA); - - // Get current client colors. - new color[4]; - ToolsGetEntityColor(client, color); - - // Set alpha value on the client. - SetEntityRenderColor(client, color[0], color[1], color[2], alpha); -} - /** * Sets an entity's color. (This is the "get" version of SetEntityRenderColor) * @@ -231,6 +211,26 @@ stock ToolsGetEntityAlpha(entity) return GetEntData(entity, offset + 3, 1); } +/** + * Set a client's alpha value. + * + * @param client The client index. + * @param alpha The alpha value to set client's alpha to. (0-255) + * @param weapons Apply alpha to all client's weapons. + */ +stock ToolsSetClientAlpha(client, alpha) +{ + // Turn rendermode on, on the client. + SetEntityRenderMode(client, RENDER_TRANSALPHA); + + // Get current client colors. + new color[4]; + ToolsGetEntityColor(client, color); + + // Set alpha value on the client. + SetEntityRenderColor(client, color[0], color[1], color[2], alpha); +} + /** * Gets an entity's color and alpha. *