mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
bug-fixes
This commit is contained in:
parent
60b255c7ae
commit
07e4236701
1333 changed files with 198132 additions and 59228 deletions
|
|
@ -1,8 +1,9 @@
|
|||
from .Handlers import handlemsg, handlemsg_all, send, clientid_to_myself
|
||||
from playersData import pdata
|
||||
from bastd.actor.zoomtext import ZoomText
|
||||
# from tools.whitelist import add_to_white_list, add_commit_to_logs
|
||||
from serverData import serverdata
|
||||
#from chatHandle.ChatCommands.commands import NormalCommands as nc
|
||||
from chatHandle.ChatCommands.commands import NormalCommands as nc
|
||||
import ba
|
||||
import _ba,os,json
|
||||
import time
|
||||
|
|
@ -14,8 +15,8 @@ from stats import mystats
|
|||
from bastd.gameutils import SharedObjects
|
||||
from tools import playlist
|
||||
from tools import logger
|
||||
Commands = ['hug', 'icy', 'spaz', 'zombieall', 'boxall', 'texall', 'kickall', 'ooh', 'spazall', 'acl', 'vcl']
|
||||
CommandAliases = ['cc', 'ccall', 'control', 'zombie', 'rainbow', 'ooh', 'playsound', 'tex', 'hugall', 'box', 'ac', 'exchange', 'tint', 'say', 'playsound', 'admincmdlist', 'vipcmdlist']
|
||||
Commands = ['hug', 'icy', 'spaz', 'zombieall', 'boxall', 'texall', 'kickall', 'ooh', 'spazall', 'vcl', 'acl']
|
||||
CommandAliases = ['cc', 'ccall', 'control', 'prot', 'protect', 'zoommessage', 'zm', 'pme', 'zombie', 'rainbow', 'ooh', 'playsound', 'tex', 'hugall', 'box', 'ac', 'exchange', 'tint', 'say', 'playsound', 'admincmdlist', 'vipcmdlist']
|
||||
|
||||
|
||||
def NewCommands(command, arguments, clientid, accountid):
|
||||
|
|
@ -84,13 +85,56 @@ def NewCommands(command, arguments, clientid, accountid):
|
|||
elif command == 'ooh':
|
||||
play_ooh_sound(arguments)
|
||||
|
||||
elif command in ['zm', 'zoommessage']:
|
||||
zm(arguments, clientid)
|
||||
|
||||
elif command == 'playsound':
|
||||
play_sound(arguments, clientid)
|
||||
|
||||
elif command in ['vcl', 'vipcmdlist']:
|
||||
vcl(arguments, clientid)
|
||||
|
||||
|
||||
elif command in ['prot', 'protect']:
|
||||
protect_players(arguments, clientid)
|
||||
|
||||
elif command == 'pme':
|
||||
stats_to_clientid(arguments, clientid, accountid)
|
||||
|
||||
|
||||
def stats_to_clientid(arguments, clid, acid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
if arguments == [] or arguments == ['']:
|
||||
with ba.Context(player):
|
||||
send(f"Using: /pme [Clientid of player]", clid)
|
||||
else:
|
||||
cl_id = int(arguments[0])
|
||||
for pla in ba.internal.get_foreground_host_session().sessionplayers:
|
||||
if pla.inputdevice.client_id == cl_id:
|
||||
fname = pla.getname(full=True, icon=True)
|
||||
for roe in ba.internal.get_game_roster():
|
||||
if roe["client_id"] == cl_id:
|
||||
pbid = roe["account_id"]
|
||||
stats = mystats.get_stats_by_id(pbid)
|
||||
if stats:
|
||||
tickets = nc.getcoins(pbid)
|
||||
reply = (
|
||||
f"\ue048| Name: {fname}\n"
|
||||
f"\ue048| PB-ID: {stats['aid']}\n"
|
||||
f"\ue048| Tickets: {tickets}\U0001FA99\n"
|
||||
f"\ue048| Rank: {stats['rank']}\n"
|
||||
f"\ue048| Score: {stats['scores']}\n"
|
||||
f"\ue048| Games: {stats['games']}\n"
|
||||
f"\ue048| Kills: {stats['kills']}\n"
|
||||
f"\ue048| Deaths: {stats['deaths']}\n"
|
||||
f"\ue048| Avg.: {stats['avg_score']}\n"
|
||||
)
|
||||
send(reply, clid)
|
||||
else:
|
||||
areply = "Not played any match yet."
|
||||
send(areply, clid)
|
||||
|
||||
|
||||
def hug(arguments, clientid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
|
|
@ -241,53 +285,71 @@ def tint(arguments, clientid):
|
|||
|
||||
|
||||
def spaz(arguments, clientid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
a = arguments
|
||||
with ba.Context(player):
|
||||
try:
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
a = arguments
|
||||
with ba.Context(player):
|
||||
try:
|
||||
if arguments != []:
|
||||
n = int(a[0])
|
||||
players[n].actor.node.color_texture = ba.gettexture(a[1]+"Color")
|
||||
players[n].actor.node.color_mask_texture = ba.gettexture(a[1]+"ColorMask")
|
||||
players[n].actor.node.head_model = ba.getmodel(a[1]+"Head")
|
||||
players[n].actor.node.torso_model = ba.getmodel(a[1]+"Torso")
|
||||
players[n].actor.node.pelvis_model = ba.getmodel(a[1]+"Pelvis")
|
||||
players[n].actor.node.upper_arm_model = ba.getmodel(a[1]+"UpperArm")
|
||||
players[n].actor.node.forearm_model = ba.getmodel(a[1]+"ForeArm")
|
||||
players[n].actor.node.hand_model = ba.getmodel(a[1]+"Hand")
|
||||
players[n].actor.node.upper_leg_model = ba.getmodel(a[1]+"UpperLeg")
|
||||
players[n].actor.node.lower_leg_model = ba.getmodel(a[1]+"LowerLeg")
|
||||
players[n].actor.node.toes_model = ba.getmodel(a[1]+"Toes")
|
||||
players[n].actor.node.style = (a[1])
|
||||
except:
|
||||
send(f"Using: /spazall [AppearanceName] [or] /spaz [PlayerID] [AppearanceName] \n________________|_AppearanceName_|_______________\n {'ali, wizard, cyborg, penguin, agent, pixie, bear, bunny'}", clientid)
|
||||
except:
|
||||
send(f"Using: /spazall [AppearanceName] [or] /spaz [PlayerID] [AppearanceName] \n________________|_AppearanceName_|________________\n {'ali, wizard, cyborg, penguin, agent, pixie, bear, bunny'}", clientid)
|
||||
appearance_name = a[1].lower() # Convert to lowercase for case-insensitive comparison
|
||||
valid_appearance_names = ['ali', 'wizard', 'cyborg', 'penguin', 'agent', 'pixie', 'bear', 'bunny']
|
||||
# Check if the appearance name is valid
|
||||
if appearance_name in valid_appearance_names:
|
||||
players[n].actor.node.color_texture = ba.gettexture(appearance_name + "Color")
|
||||
players[n].actor.node.color_mask_texture = ba.gettexture(appearance_name + "ColorMask")
|
||||
players[n].actor.node.head_model = ba.getmodel(appearance_name + "Head")
|
||||
players[n].actor.node.torso_model = ba.getmodel(appearance_name + "Torso")
|
||||
players[n].actor.node.pelvis_model = ba.getmodel(appearance_name + "Pelvis")
|
||||
players[n].actor.node.upper_arm_model = ba.getmodel(appearance_name + "UpperArm")
|
||||
players[n].actor.node.forearm_model = ba.getmodel(appearance_name + "ForeArm")
|
||||
players[n].actor.node.hand_model = ba.getmodel(appearance_name + "Hand")
|
||||
players[n].actor.node.upper_leg_model = ba.getmodel(appearance_name + "UpperLeg")
|
||||
players[n].actor.node.lower_leg_model = ba.getmodel(appearance_name + "LowerLeg")
|
||||
players[n].actor.node.toes_model = ba.getmodel(appearance_name + "Toes")
|
||||
players[n].actor.node.style = appearance_name
|
||||
else:
|
||||
# If the appearance name is not valid, inform the user
|
||||
send("Invalid CharacterName.\nPlease choose from: ali, wizard, cyborg, penguin, agent, pixie, bear, bunny", clientid)
|
||||
else:
|
||||
send("Using: /spaz [PLAYER-ID] [CharacterName]", clientid)
|
||||
except Exception as e:
|
||||
print(f"Error in spaz command: {e}")
|
||||
send("An error occurred. Please try again.", clientid)
|
||||
|
||||
|
||||
def spazall(arguments, clientid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
a = arguments
|
||||
with ba.Context(player):
|
||||
for i in players:
|
||||
try:
|
||||
i.actor.node.color_texture = ba.gettexture(a[0]+"Color")
|
||||
i.actor.node.color_mask_texture = ba.gettexture(a[0]+"ColorMask")
|
||||
i.actor.node.head_model = ba.getmodel(a[0]+"Head")
|
||||
i.actor.node.torso_model = ba.getmodel(a[0]+"Torso")
|
||||
i.actor.node.pelvis_model = ba.getmodel(a[0]+"Pelvis")
|
||||
i.actor.node.upper_arm_model = ba.getmodel(a[0]+"UpperArm")
|
||||
i.actor.node.forearm_model = ba.getmodel(a[0]+"ForeArm")
|
||||
i.actor.node.hand_model = ba.getmodel(a[0]+"Hand")
|
||||
i.actor.node.upper_leg_model = ba.getmodel(a[0]+"UpperLeg")
|
||||
i.actor.node.lower_leg_model = ba.getmodel(a[0]+"LowerLeg")
|
||||
i.actor.node.toes_model = ba.getmodel(a[0]+"Toes")
|
||||
i.actor.node.style = a[0]
|
||||
except:
|
||||
send(f"Using: /spazall [AppearanceName] \n________________|_AppearanceName_|________________\n {'ali, wizard, cyborg, penguin, agent, pixie, bear, bunny'}", clientid)
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
player = _ba.get_foreground_host_activity()
|
||||
a = arguments
|
||||
with ba.Context(player):
|
||||
for i in players:
|
||||
try:
|
||||
if arguments != []:
|
||||
appearance_name = a[0].lower() # Convert to lowercase for case-insensitive comparison
|
||||
valid_appearance_names = ['ali', 'wizard', 'cyborg', 'penguin', 'agent', 'pixie', 'bear', 'bunny']
|
||||
# Check if the appearance name is valid
|
||||
if appearance_name in valid_appearance_names:
|
||||
i.actor.node.color_texture = ba.gettexture(appearance_name + "Color")
|
||||
i.actor.node.color_mask_texture = ba.gettexture(appearance_name + "ColorMask")
|
||||
i.actor.node.head_model = ba.getmodel(appearance_name + "Head")
|
||||
i.actor.node.torso_model = ba.getmodel(appearance_name + "Torso")
|
||||
i.actor.node.pelvis_model = ba.getmodel(appearance_name + "Pelvis")
|
||||
i.actor.node.upper_arm_model = ba.getmodel(appearance_name + "UpperArm")
|
||||
i.actor.node.forearm_model = ba.getmodel(appearance_name + "ForeArm")
|
||||
i.actor.node.hand_model = ba.getmodel(appearance_name + "Hand")
|
||||
i.actor.node.upper_leg_model = ba.getmodel(appearance_name + "UpperLeg")
|
||||
i.actor.node.lower_leg_model = ba.getmodel(appearance_name + "LowerLeg")
|
||||
i.actor.node.toes_model = ba.getmodel(appearance_name + "Toes")
|
||||
i.actor.node.style = appearance_name
|
||||
else:
|
||||
# If the appearance name is not valid, inform the user
|
||||
send("Invalid CharacterName.\nPlease choose from: ali, wizard, cyborg, penguin, agent, pixie, bear, bunny", clientid)
|
||||
else:
|
||||
send("Using: /spazall [CharacterName]", clientid)
|
||||
except Exception as e:
|
||||
print(f"Error in spaz command: {e}")
|
||||
send("An error occurred. Please try again.", clientid)
|
||||
|
||||
|
||||
def zombie(arguments, clientid):
|
||||
|
|
@ -404,7 +466,25 @@ def control(arguments, clientid):
|
|||
players[player2].actor.node = node1
|
||||
except:
|
||||
send(f"Using: /exchange [PlayerID1] [PlayerID2]", clientid)
|
||||
|
||||
|
||||
|
||||
def zm(arguments, clientid):
|
||||
if len(arguments) == 0:
|
||||
_ba.screenmessage("Special Chat Only For Main", color=(1,1,1), transient=True, clients=[clientid])
|
||||
else:
|
||||
k = ' '.join(arguments)
|
||||
with ba.Context(_ba.get_foreground_host_activity()):
|
||||
ZoomText(
|
||||
k,
|
||||
position=(0, 180),
|
||||
maxwidth=800,
|
||||
lifespan=1,
|
||||
color=(0.93*1.25, 0.9*1.25, 1.0*1.25),
|
||||
trailcolor=(0.15, 0.05, 1.0, 0.0),
|
||||
flash=False,
|
||||
jitter=3.0
|
||||
).autoretain()
|
||||
|
||||
|
||||
def icy(arguments, clientid):
|
||||
players = _ba.get_foreground_host_activity().players
|
||||
|
|
@ -469,16 +549,67 @@ def play_sound(arguments, clientid):
|
|||
send(f"Using: /playsound [music sound] [time] [volume]", clientid)
|
||||
|
||||
|
||||
def acl(arguments, clientid):
|
||||
send(f"\ue046____________|ADMIN-CMDS-LISTS|______________\ue046", clientid)
|
||||
send(f"\ue046|| kick, kill, heal, curse, ooh, sleep, superpunch or sp, gloves, tint", clientid)
|
||||
send(f"\ue046|| shield, ice, thaw, gm, playsound, inv, hl, speed, sm, dv, nv, creepy, ac", clientid)
|
||||
send(f"\ue046|| hug, tex, icy, celebrate, end, fly, lm, gp, remove, zombie, reflections", clientid)
|
||||
def acl(arguments, client_id):
|
||||
role = "admin"
|
||||
admin_commands = pdata.roles_cmdlist(role)
|
||||
if not admin_commands:
|
||||
send("Error: Admin role not found.", client_id)
|
||||
return
|
||||
msg = "\ue046______________|ADMIN-CMDS-LISTS|________________\ue046\n"
|
||||
admin_commands_list = admin_commands.split(', ')
|
||||
for i, cmd in enumerate(admin_commands_list, 1):
|
||||
if i % 10 == 0:
|
||||
msg += "\n\ue046 || " + cmd
|
||||
elif i == 1: # Add \ue046 || only to the first command of each line
|
||||
msg += "\ue046 || " + cmd
|
||||
else:
|
||||
msg += ', ' + cmd
|
||||
send(msg, client_id)
|
||||
|
||||
|
||||
def vcl(arguments, clientid):
|
||||
send(f"\ue046___________|VIP-CMDS-LISTS|______________\ue046", clientid)
|
||||
send(f"\ue046|| kill, heal, curse, sleep, ooh, gloves, creepy, hug, shield, thaw, fly", clientid)
|
||||
send(f"\ue046|| box, tex, inv, hl, zombie, playsound, nv, dv, sm, ice, lm, end, remove", clientid)
|
||||
def protect_players(arguments, clientid):
|
||||
if arguments == [] or arguments == ['']:
|
||||
myself = clientid_to_myself(clientid)
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
player = activity.players[myself].actor
|
||||
|
||||
if player.node.invincible != True:
|
||||
player.node.invincible = True
|
||||
else:
|
||||
player.node.invincible = False
|
||||
|
||||
elif arguments[0] == 'all':
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
for i in activity.players:
|
||||
if i.actor.node.invincible != True:
|
||||
i.actor.node.invincible = True
|
||||
else:
|
||||
i.actor.node.invincible = False
|
||||
|
||||
else:
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
req_player = int(arguments[0])
|
||||
player = activity.players[req_player].actor
|
||||
|
||||
if player.node.invincible != True:
|
||||
player.node.invincible = True
|
||||
else:
|
||||
player.node.invincible = False
|
||||
|
||||
|
||||
def vcl(arguments, client_id):
|
||||
role = "vip"
|
||||
admin_commands = pdata.roles_cmdlist(role)
|
||||
if not admin_commands:
|
||||
send("Error: Vip role not found.", client_id)
|
||||
return
|
||||
msg = "\ue046______________|VIP-CMDS-LISTS|________________\ue046\n"
|
||||
admin_commands_list = admin_commands.split(', ')
|
||||
for i, cmd in enumerate(admin_commands_list, 1):
|
||||
if i % 10 == 0:
|
||||
msg += "\n\ue046 || " + cmd
|
||||
elif i == 1: # Add \ue046 || only to the first command of each line
|
||||
msg += "\ue046 || " + cmd
|
||||
else:
|
||||
msg += ', ' + cmd
|
||||
send(msg, client_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue