HL2DM custom bot weapons

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

Please request only one plugin per thread.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

HL2DM custom bot weapons

Postby daren adler » Thu Apr 20, 2023 5:02 pm

Hello script writers :smile: I am using HRC (hurricane bots) and would like a script that would let the bots use custom weapons. The weapons are weapon_ak47, weapon_alyxgun, weapon_mp5, weapon_oicw, weapon_sniper. The bots only seem right now able to use just the normal (stock) weapons, Could someone on here help me out on this, thank you. :embarrassed:
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM custom bot weapons

Postby cssbestrpg » Thu Apr 20, 2023 5:21 pm

Hi, do you mean that bots would spawn with the random custom weapons?
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM custom bot weapons

Postby daren adler » Thu Apr 20, 2023 5:25 pm

cssbestrpg wrote:Hi, do you mean that bots would spawn with the random custom weapons?


Yes, i use sourcemod hl2dm customguns script. The bots will only spawn with the normal weapons.
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM custom bot weapons

Postby cssbestrpg » Thu Apr 20, 2023 5:26 pm

try this code(Untested) then:

Syntax: Select all

import random
from events import Event
from players.entity import Player

custom_weapons = ['weapon_ak47', 'weapon_alyxgun', 'weapon_mp5', 'weapon_oicw', 'weapon_sniper']

@Event('player_spawn')
def player_spawn(args):
player = Player.from_userid(args['userid'])
if not player.is_bot():
return

primary = player.primary
if not primary is None:
primary.remove()

weapon_to_give = random.choice(custom_weapons)
player.give_named_item(f'{weapon_to_give}')
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM custom bot weapons

Postby daren adler » Thu Apr 20, 2023 5:29 pm

Ok will do,, here is where i had a scripter write one for me but without custom weapons https://forums.sourcepython.com/viewtopic.php?f=37&t=2521
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM custom bot weapons

Postby daren adler » Thu Apr 20, 2023 5:58 pm

daren adler wrote:Ok will do,, here is where i had a scripter write one for me but without custom weapons https://forums.sourcepython.com/viewtopic.php?f=37&t=2521
Update,,,,,Nope does not seem to work,,does not give any errors in log,,,says it loaded, but does nothing, thank you for trying, thses bots do not like custom made weapons i guess lol, ty.
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM custom bot weapons

Postby cssbestrpg » Thu Apr 20, 2023 6:01 pm

I guess i need to use different method like the other tread where Kami made a code for random weapons for bots

Edit:
Here is code for other method to give the weapons:

Syntax: Select all

import random
from events import Event
from engines.server import queue_command_string

custom_weapons = ['ak47', 'alyxgun', 'mp5', 'oicw', 'sniper']

@Event('player_spawn')
def player_spawn(args):
player = Player.from_userid(args['userid'])

primary = player.primary
if not primary is None:
primary.remove()

weapon_to_give = random.choice(custom_weapons)
queue_command_string(f'hrcbot_player_spawnweapon {weapon_to_give}')
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM custom bot weapons

Postby daren adler » Thu Apr 20, 2023 7:18 pm

cssbestrpg wrote:I guess i need to use different method like the other tread where Kami made a code for random weapons for bots

Edit:
Here is code for other method to give the weapons:

Syntax: Select all

import random
from events import Event
from engines.server import queue_command_string

custom_weapons = ['ak47', 'alyxgun', 'mp5', 'oicw', 'sniper']

@Event('player_spawn')
def player_spawn(args):
player = Player.from_userid(args['userid'])

primary = player.primary
if not primary is None:
primary.remove()

weapon_to_give = random.choice(custom_weapons)
queue_command_string(f'hrcbot_player_spawnweapon {weapon_to_give}')


Nope same as before. i think its the bots, not your fault, thanks for trying tho, I did see i am not updated with the sourcepython,,so before i can say it all does not work,,let me update and get back to ya.

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 12 guests