I have a map with a func_brush with clip texture that blocks player movement but I want to be able to disable it on demand using code in my sourcemod plugin.
I have tried changing render/solid type like this:
PHP Code:
char brush_name[32];
int index = -1;
while ((index = FindEntityByClassname(index, "func_brush")) != -1) {
if(IsValidEntity(index)) {
GetEntPropString(index, Prop_Data, "m_iName", brush_name, sizeof(brush_name));
if (StrEqual(brush_name, "my_func_brush", false)) {
SetEntityRenderMode(index, RENDER_NONE);
SetEntProp(index, Prop_Send, "m_nSolidType", 0);
SetEntProp(index, Prop_Send, "m_CollisionGroup", 0);
SetEntProp(index, Prop_Send, "m_usSolidFlags", 0x0004);
}
}
}
It finds my brush entity and makes it a bit broken because I can kinda walk into it but the player sometimes gets stuck in the brush and cant move anymore, glitchy AF.
Any ideas?