When i look at health/suit charger it doesn't get any messages when suppose to.
Syntax: Select all
from messages import HudMsg
from listeners.tick import Repeat
from filters.players import PlayerIter
from colors import CYAN
_HUDMSG_X = -1
_HUDMSG_Y = 0.60
_HUDMSG_EFFECT = 0
_HUDMSG_FADEOUT = 0
_HUDMSG_HOLDTIME = 2
_HUDMSG_FXTIME = 0
_HUDMSG_CHANNEL = 5
msg = []
def check_msg():
for player in PlayerIter('alive'):
target = player.view_entity
if target and target.classname == 'item_healthcharger':
msg = 'I am not getting executed'
hudmessage(msg, player.index, CYAN)
if target and target.classname == 'item_suitcharger':
msg = 'I am not getting executed'
hudmessage(msg, player.index, CYAN)
def hudmessage(text, index, color):
HudMsg(text, color1=color, x=_HUDMSG_X, y=_HUDMSG_Y,
effect=_HUDMSG_EFFECT,
fade_out=_HUDMSG_FADEOUT,
hold_time=_HUDMSG_HOLDTIME,
fx_time=_HUDMSG_FXTIME,
channel=_HUDMSG_CHANNEL
).send(index)
msg_check = Repeat(check_msg)
msg_check.start(0.1)