[CS:GO] Check if entity is hidden to begin with

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

[CS:GO] Check if entity is hidden to begin with

Postby velocity » Sun Nov 25, 2018 5:43 pm

How do I check if an entity is visible or not-visible for the player?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [CS:GO] Check if entity is hidden to begin with

Postby L'In20Cible » Mon Nov 26, 2018 3:40 am

I'd say it depends of the entity. Most toggleable ones carry their own Boolean flag to whether or not they should think every frame.
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] Check if entity is hidden to begin with

Postby velocity » Mon Nov 26, 2018 12:49 pm

What about func_brush?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [CS:GO] Check if entity is hidden to begin with

Postby L'In20Cible » Mon Nov 26, 2018 2:28 pm

Based on the SDK, func_brush is using an EntityEffects. Something like this should works:

Syntax: Select all

from entities.constants import EntityEffects

def is_func_brush_visible(brush):
return EntityEffects.NODRAW not in EntityEffects(brush.effects) # I don't fully remember if this should be .values or not here...
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] Check if entity is hidden to begin with

Postby velocity » Mon Nov 26, 2018 8:39 pm

That worked thanks. I have some follow up questions. Is it possible to get the entities associated with a button (without having to press it).
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [CS:GO] Check if entity is hidden to begin with

Postby L'In20Cible » Tue Nov 27, 2018 2:34 am

velocity wrote:That worked thanks. I have some follow up questions. Is it possible to get the entities associated with a button (without having to press it).

Please, create new threads. Makes the searches more efficient if unrelated questions are indexed separately.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 17 guests