[HL2:DM] BotPing
Posted: Mon Apr 11, 2016 1:36 pm
Creating a Bot Ping?
Syntax: Select all
from random import randint
from entities.entity import Entity
from filters.players import PlayerIter
from listeners.tick import TickRepeat
# =================== #
# >> CONFIGURATION << #
# =================== #
LOW_PING = 30
HIGH_PING = 80
DELAY = 3
# ======================= #
# >> END CONFIGURATION << #
# ======================= #
bot_players = PlayerIter('bot')
@TickRepeat
def set_bot_ping():
player_manager = Entity.find('player_manager')
for bot in bot_players:
player_manager.set_property_int('m_iPing.%03d' % bot.index, randint(LOW_PING, HIGH_PING))
set_bot_ping.start(DELAY, 0)