HL2:DM - RANDOM 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: 223
Joined: Sat May 18, 2019 7:42 pm

HL2:DM - RANDOM BOT WEAPONS

Postby daren adler » Thu Apr 01, 2021 5:48 am

Was wondering if someone could make a random bot weapon script ?. I was using randombotweapon from eventscripts, since i removed es from my server, was wondering if a scripter could make one. heres the way the old one looked.

Code: Select all

event es_map_start
{   
   es_doblock randombotweapon/randomize
}
event player_death
{   
   es_doblock randombotweapon/randomize
}



block randomize
{

     es_setinfo botweapon 0
        es_rand botweapon 1 1100
   
        if (server_var(botweapon) >= 100) do
        {
                hrcbot_player_spawnweapon pistol
       }
      if (server_var(botweapon) >= 150) do
        {
                hrcbot_player_spawnweapon crowbar
        }
      if (server_var(botweapon) >= 200) do
        {
                hrcbot_player_spawnweapon stunstick
        }
      if (server_var(botweapon) >= 250) do
        {
                hrcbot_player_spawnweapon frag
        }       
      if (server_var(botweapon) >= 300) do
        {
                hrcbot_player_spawnweapon smg1
        }
      if (server_var(botweapon) >= 350) do
        {
                hrcbot_player_spawnweapon ar2
        }
      if (server_var(botweapon) >= 400) do
        {
                hrcbot_player_spawnweapon shotgun
        }
      if (server_var(botweapon) >= 450) do
        {
                hrcbot_player_spawnweapon shotgun
        }
      if (server_var(botweapon) >= 500) do
        {
                hrcbot_player_spawnweapon rpg
        }       
      if (server_var(botweapon) >= 550) do
        {
                hrcbot_player_spawnweapon crossbow
        }       
      if (server_var(botweapon) >= 600) do
        {
                hrcbot_player_spawnweapon frag
        }
      if (server_var(botweapon) >= 650) do
        {
                hrcbot_player_spawnweapon pistol
   }
      if (server_var(botweapon) >= 700) do
        {
                hrcbot_player_spawnweapon crowbar
        }
      if (server_var(botweapon) >= 750) do
        {
                hrcbot_player_spawnweapon stunstick
        }
      if (server_var(botweapon) >= 800) do
        {
                hrcbot_player_spawnweapon frag
        }       
      if (server_var(botweapon) >= 850) do
        {
                hrcbot_player_spawnweapon smg1
        }
      if (server_var(botweapon) >= 900) do
        {
                hrcbot_player_spawnweapon ar2
        }
      if (server_var(botweapon) >= 950) do
        {
                hrcbot_player_spawnweapon shotgun
        }
      if (server_var(botweapon) >= 1000) do
        {
                hrcbot_player_spawnweapon shotgun
        }     
      if (server_var(botweapon) >= 1025) do
        {
                hrcbot_player_spawnweapon crossbow
        }       
      if (server_var(botweapon) >= 1050) do
        {
                hrcbot_player_spawnweapon frag
        }     
}

:cool: :cool: PS- i tryed the EventScripts-Emulator but did not work for me. thank you, stay kool.
User avatar
Kami
Global Moderator
Posts: 245
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: HL2:DM - RANDOM BOT WEAPONS

Postby Kami » Thu Apr 01, 2021 7:56 pm

Hey daren, you can give this a try:

Syntax: Select all

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

types = ['pistol','crowbar','stunstick','frag','smg1','ar2','shotgun','rpg','crossbow']

@OnLevelInit
def _init(map):
choice = random.choice(types)
queue_command_string(f'hrcbot_player_spawnweapon {choice}')

@Event('player_death')
def _death(ev):
choice = random.choice(types)
queue_command_string(f'hrcbot_player_spawnweapon {choice}')
User avatar
daren adler
Senior Member
Posts: 223
Joined: Sat May 18, 2019 7:42 pm

Re: HL2:DM - RANDOM BOT WEAPONS

Postby daren adler » Thu Apr 01, 2021 8:04 pm

OK will do, thank you :grin: :grin: Works great,,thank you again for your great work. :cool: :cool:

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 5 guests