[HL2:DM] BotPing

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 726
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] BotPing

Postby Painkiller » Mon Apr 11, 2016 1:36 pm

Creating a Bot Ping?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Apr 11, 2016 4:09 pm

Try this (untested):

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)
Image
User avatar
Painkiller
Senior Member
Posts: 726
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Postby Painkiller » Tue Apr 12, 2016 4:45 pm

Work good THX.

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 17 guests