![Smile :smile:](./images/smilies/smile.png)
![Smile :smile:](./images/smilies/smile.png)
![Cool :cool:](./images/smilies/cool.png)
Syntax: Select all
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')
cssbestrpg wrote:Hi try this code(Untested)Syntax: Select all
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')
cssbestrpg wrote:Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.
Code: Select all
//Hurricane Bot settings
hrcbot_enabled 1
hrcbot_minplayers 0
hrcbot_maxplayers 5
hrcbot_handicap 65
hrcbot_motd 0
hrcbot_dialogmsg 1
hrcbot_freezeifnoplayers 0
hrcbot_spawnprotectionseconds 2
hrcbot_spawnprotectedhealth 125
hrcbot_player_spawnweapon smg1
hrcbot_clan ""
Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
daren adler wrote:Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
Syntax: Select all
from listeners.tick import Delay
from listeners import OnLevelInit
from engines.server import queue_command_string
@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
Delay(0, queue_command_string, ('hrcbot_enabled 1',))
print(f'Executed bots on for {current_map} map')
L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.
Come to think about it, i do not even have my bots in my autoexec file, but i will try with it on there (remove from server.cfg) and add them to my autoexec file at the end.daren adler wrote:L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.
ok, will try. ty
Users browsing this forum: No registered users and 40 guests