Radar possebilities?
Radar possebilities?
Is there anyway to call a method, for showing a enemy on the radar? such as a decoy would do
I'm thinking there might be some engine method to do so
thanks in advance
I'm thinking there might be some engine method to do so
thanks in advance
-Tuck
- L'In20Cible
- Project Leader
- Posts: 1534
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
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)
- devilsnake88
- Junior Member
- Posts: 7
- Joined: Mon Feb 18, 2013 4:03 pm
- Contact:
Syntax: Select all
@Tick
def tick_listener():
for index in PlayerIter('alive'):
player_manager.set_prop_int('m_bPlayerSpotted.%03d ' % index, False)
is this how to disable radar??
- L'In20Cible
- Project Leader
- Posts: 1534
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
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: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)
thank you! really need to learn bout bitwise opertaions
- L'In20Cible
- Project Leader
- Posts: 1534
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
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: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.
i wanted to know for csgo so you read my mind!
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)
Tried updating this piece of code, can't get it to work.
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)
You want set_property_bool not set_key_value_bool. That was part of the entities changes when we merged SendProps with DataMaps.
Edit: also, you want Entity and not BaseEntity.
Edit2: though, you could also use EntityIter instead of using EntityGenerator directly:
http://wiki.sourcepython.com/pages/filters.entities
Edit: also, you want Entity and not BaseEntity.
Edit2: though, you could also use EntityIter instead of using EntityGenerator directly:
http://wiki.sourcepython.com/pages/filters.entities
Thanks, this ended up working:
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)
OT question: What is this exactly?
Syntax: Select all
HIDEHUD_RADAR = 1 << 12
# ....
hidehud & HIDEHUD_RADAR
hidehud | HIDEHUD_RADAR
I know in C++ << and >> on variables is bit shifting. How do you call that, and | & etc. in Python? :)
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 63 guests