Quote:
Originally Posted by noxuu
How to set 50% visibility using alpha?
|
The server would need to have the alpha convar set if this is CSGO. It can be done like
PHP Code:
public OnMapStart(){
ServerCommand("sv_disable_immunity_alpha 1");
}
And then the opacity can be set with these functions replacing the RENDER_NONE method:
PHP Code:
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 255, 255, 255, 127);//Last argument is a number 0 to 255 for transparency
If you have no idea how to script and can't use these then see below
Spoiler
PHP Code:
#include <sourcemod>
public OnPluginStart(){ RegAdminCmd("sm_invisible", Invisi, ADMFLAG_GENERIC, ""); }
public OnMapStart(){ ServerCommand("sv_disable_immunity_alpha 1"); }
public Action:Invisi(client, args){
if(GetEntityRenderMode(client) != RENDER_NORMAL){
SetEntityRenderMode(client, RENDER_NORMAL);
}else{
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 255, 255, 255, 127);
}
}