Move the set functions behind the get functions.
For organization sake.
This commit is contained in:
parent
37698b0c20
commit
99476979ad
@ -181,26 +181,6 @@ stock ToolsClientScore(client, bool:score = true, bool:apply = true, value = 0)
|
|||||||
return -1;
|
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)
|
* 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);
|
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.
|
* Gets an entity's color and alpha.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user