I'm thinking there might be some engine method to do so
thanks in advance

Syntax: Select all
from entities import EntityGenerator
from filters.players import PlayerIter
from listeners.tick import Tick
for player_manager in EntityGenerator('cs_player_manager'):
break
@Tick
def tick_listener():
for index in PlayerIter('alive'):
player_manager.set_prop_int('m_bPlayerSpotted.%03d' % index, True)
Syntax: Select all
@Tick
def tick_listener():
for index in PlayerIter('alive'):
player_manager.set_prop_int('m_bPlayerSpotted.%03d ' % index, False)
Syntax: Select all
from filters.players import PlayerIter
HIDEHUD_RADAR = 1 << 12
@Event
def round_start(game_event):
# Loop through all living players...
for edict in PlayerIter('alive', return_types=['edict']):
# Get the player's hidden huds...
hidehud = edict.get_prop_int('m_iHideHud')
# Is the player already have the radar disabled?
if hidehud & HIDEHUD_RADAR:
# If so, no need to go further...
continue
# Hide the player's radar...
edict.set_prop_int('m_iHideHud', hidehud | HIDEHUD_RADAR)
L'In20Cible wrote:To disable the radar on CS:GO check out the following.Syntax: Select all
from filters.players import PlayerIter
HIDEHUD_RADAR = 1 << 12
@Event
def round_start(game_event):
# Loop through all living players...
for edict in PlayerIter('alive', return_types=['edict']):
# Get the player's hidden huds...
hidehud = edict.get_prop_int('m_iHideHud')
# Is the player already have the radar disabled?
if hidehud & HIDEHUD_RADAR:
# If so, no need to go further...
continue
# Hide the player's radar...
edict.set_prop_int('m_iHideHud', hidehud | HIDEHUD_RADAR)
L'In20Cible wrote:I may add that this won't work on CS:S, tho. While this flag is available, it is just ignored when rendering the radar. They did fix it on CS:GO (at least, it was when I was testing a while back). On CS:S, it requires to hack a bit.
L'In20Cible wrote:Something like this should works:Syntax: Select all
from entities import EntityGenerator
from filters.players import PlayerIter
from listeners.tick import Tick
for player_manager in EntityGenerator('cs_player_manager'):
break
@Tick
def tick_listener():
for index in PlayerIter('alive'):
player_manager.set_prop_int('m_bPlayerSpotted.%03d' % index, True)
Syntax: Select all
from entities.entity import BaseEntity
from entities import EntityGenerator
from filters.players import PlayerIter
from listeners import Tick
for edict in EntityGenerator('cs_player_manager'):
player_manager = BaseEntity(index_from_edict(edict))
break
@Tick
def tick_listener():
for index in PlayerIter('alive', return_types='index'):
player_manager.set_key_value_bool("m_bPlayerSpotted.{0:03d}".format(index), True)
Syntax: Select all
for player_manager in EntityIter('cs_player_manager', return_types="entity"):
break
@Tick
def tick_listener():
for index in PlayerIter('alive', return_types='index'):
player_manager.set_property_int("m_bPlayerSpotted.{0:03d}".format(index), 1)
L'In20Cible wrote:To disable the radar on CS:GO check out the following.Syntax: Select all
from filters.players import PlayerIter
HIDEHUD_RADAR = 1 << 12
@Event
def round_start(game_event):
# Loop through all living players...
for edict in PlayerIter('alive', return_types=['edict']):
# Get the player's hidden huds...
hidehud = edict.get_prop_int('m_iHideHud')
# Is the player already have the radar disabled?
if hidehud & HIDEHUD_RADAR:
# If so, no need to go further...
continue
# Hide the player's radar...
edict.set_prop_int('m_iHideHud', hidehud | HIDEHUD_RADAR)
Syntax: Select all
HIDEHUD_RADAR = 1 << 12
# ....
hidehud & HIDEHUD_RADAR
hidehud | HIDEHUD_RADAR
Return to “Plugin Development Support”
Users browsing this forum: No registered users and 104 guests