mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
Update Main.py
This commit is contained in:
parent
1d5596cb28
commit
3d9cbd4e04
1 changed files with 64 additions and 17 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
# Released under the MIT License. See LICENSE for details.
|
# Released under the MIT License. See LICENSE for details.
|
||||||
|
|
||||||
|
|
||||||
from .commands import NormalCommands
|
from .commands import NormalCommands
|
||||||
from .commands import Management
|
from .commands import Management
|
||||||
from .commands import Fun
|
from .commands import Fun
|
||||||
from .commands import Cheats
|
from .commands import Cheats
|
||||||
from .commands import NewCmds
|
from .commands import NewCmds
|
||||||
from .commands import CoinCmds
|
from .commands import CoinCmds
|
||||||
from chatHandle.ChatCommands.commands.Handlers import send
|
from chatHandle.ChatCommands.commands import NormalCommands as nc
|
||||||
|
from chatHandle.ChatCommands.commands import CoinCmds as cc
|
||||||
|
from chatHandle.ChatCommands.commands.Handlers import send, sendall
|
||||||
from .Handlers import clientid_to_accountid
|
from .Handlers import clientid_to_accountid
|
||||||
from .Handlers import check_permissions
|
from .Handlers import check_permissions
|
||||||
from chatHandle.chatFilter import ChatFilter
|
from chatHandle.chatFilter import ChatFilter
|
||||||
|
|
@ -15,12 +15,14 @@ from bastd.actor import popuptext
|
||||||
import ba
|
import ba
|
||||||
import _ba
|
import _ba
|
||||||
import ba.internal
|
import ba.internal
|
||||||
|
import set
|
||||||
import setting
|
import setting
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from playersData import pdata
|
from playersData import pdata
|
||||||
from serverData import serverdata
|
from serverData import serverdata
|
||||||
|
|
||||||
settings = setting.get_settings_data()
|
settings = setting.get_settings_data()
|
||||||
|
tic = settings["CurrencyType"]["Currency"]
|
||||||
|
|
||||||
def return_role(accountid):
|
def return_role(accountid):
|
||||||
roles = pdata.get_roles()
|
roles = pdata.get_roles()
|
||||||
|
|
@ -72,15 +74,16 @@ def Command(msg, clientid):
|
||||||
reply = '\ue049|| \ue00cCOMMAND ACCEPTED ADMIN\ue00c ||\ue049'
|
reply = '\ue049|| \ue00cCOMMAND ACCEPTED ADMIN\ue00c ||\ue049'
|
||||||
elif role == 'vip':
|
elif role == 'vip':
|
||||||
reply = '\ue049|| \ue00cCOMMAND ACCEPTED VIP\ue00c ||\ue049'
|
reply = '\ue049|| \ue00cCOMMAND ACCEPTED VIP\ue00c ||\ue049'
|
||||||
elif role == 'moderator':
|
elif role in ['moderator', 'mods', 'mod']:
|
||||||
reply = '\ue049|| \ue00cCOMMAND ACCEPTED MODERATOR\ue00c ||\ue049'
|
reply = '\ue049|| \ue00cCOMMAND ACCEPTED MODERATOR\ue00c ||\ue049'
|
||||||
elif role == 'leadstaff':
|
elif role in ['leadstaff', 'lead-staff', 'leads']:
|
||||||
reply = '\ue049|| \ue00cCOMMAND ACCEPTED LEAD-STAFF\ue00c ||\ue049'
|
reply = '\ue049|| \ue00cCOMMAND ACCEPTED LEAD-STAFF\ue00c ||\ue049'
|
||||||
elif role == 'staff':
|
elif role in ['staff', 'cs', 'complaintstaff', 'complaint-staff']:
|
||||||
reply = '\ue049|| \ue00cCOMMAND ACCEPTED STAFF\ue00c ||\ue049'
|
reply = '\ue049|| \ue00cCOMMAND ACCEPTED STAFF\ue00c ||\ue049'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
reply = '\ue043|| PLAYER COMMAND ACCEPTED ||\ue043'
|
reply = None
|
||||||
|
|
||||||
|
|
||||||
if command_type(command) == "Normal":
|
if command_type(command) == "Normal":
|
||||||
NormalCommands.ExcelCommand(command, arguments, clientid, accountid, ARGUMENTS)
|
NormalCommands.ExcelCommand(command, arguments, clientid, accountid, ARGUMENTS)
|
||||||
|
|
@ -91,7 +94,18 @@ def Command(msg, clientid):
|
||||||
elif command_type(command) == "Manage":
|
elif command_type(command) == "Manage":
|
||||||
if check_permissions(accountid, command):
|
if check_permissions(accountid, command):
|
||||||
Management.ExcelCommand(command, arguments, clientid, accountid)
|
Management.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
if reply is not None:
|
||||||
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
||||||
|
else:
|
||||||
|
if command in set.availablecommands:
|
||||||
|
cost_of_command = set.availablecommands[command]
|
||||||
|
have_coins = nc.getcoins(accountid)
|
||||||
|
if have_coins >= cost_of_command:
|
||||||
|
Management.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
cc.addcoins(accountid, cost_of_command * -1)
|
||||||
|
sendall(f"Success! /{command} cost you {tic}{cost_of_command}.")
|
||||||
|
else:
|
||||||
|
send(f"You need {tic}{cost_of_command} for that. You have {tic}{have_coins} only.", clientid)
|
||||||
else:
|
else:
|
||||||
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
||||||
clients=[clientid])
|
clients=[clientid])
|
||||||
|
|
@ -100,7 +114,18 @@ def Command(msg, clientid):
|
||||||
elif command_type(command) == "Fun":
|
elif command_type(command) == "Fun":
|
||||||
if check_permissions(accountid, command):
|
if check_permissions(accountid, command):
|
||||||
Fun.ExcelCommand(command, arguments, clientid, accountid)
|
Fun.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
if reply is not None:
|
||||||
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
||||||
|
else:
|
||||||
|
if command in set.availablecommands:
|
||||||
|
cost_of_command = set.availablecommands[command]
|
||||||
|
have_coins = nc.getcoins(accountid)
|
||||||
|
if have_coins >= cost_of_command:
|
||||||
|
Fun.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
cc.addcoins(accountid, cost_of_command * -1)
|
||||||
|
sendall(f"Success! /{command} cost you {tic}{cost_of_command}.")
|
||||||
|
else:
|
||||||
|
send(f"You need {tic}{cost_of_command} for that. You have {tic}{have_coins} only.", clientid)
|
||||||
else:
|
else:
|
||||||
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
||||||
clients=[clientid])
|
clients=[clientid])
|
||||||
|
|
@ -109,7 +134,18 @@ def Command(msg, clientid):
|
||||||
elif command_type(command) == "Cheats":
|
elif command_type(command) == "Cheats":
|
||||||
if check_permissions(accountid, command):
|
if check_permissions(accountid, command):
|
||||||
Cheats.ExcelCommand(command, arguments, clientid, accountid)
|
Cheats.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
if reply is not None:
|
||||||
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
||||||
|
else:
|
||||||
|
if command in set.availablecommands:
|
||||||
|
cost_of_command = set.availablecommands[command]
|
||||||
|
have_coins = nc.getcoins(accountid)
|
||||||
|
if have_coins >= cost_of_command:
|
||||||
|
Cheats.ExcelCommand(command, arguments, clientid, accountid)
|
||||||
|
cc.addcoins(accountid, cost_of_command * -1)
|
||||||
|
sendall(f"Success! /{command} cost you {tic}{cost_of_command}.")
|
||||||
|
else:
|
||||||
|
send(f"You need {tic}{cost_of_command} for that. You have {tic}{have_coins} only.", clientid)
|
||||||
else:
|
else:
|
||||||
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
||||||
clients=[clientid])
|
clients=[clientid])
|
||||||
|
|
@ -118,7 +154,18 @@ def Command(msg, clientid):
|
||||||
elif command_type(command) == "NewCmd":
|
elif command_type(command) == "NewCmd":
|
||||||
if check_permissions(accountid, command):
|
if check_permissions(accountid, command):
|
||||||
NewCmds.NewCommands(command, arguments, clientid, accountid)
|
NewCmds.NewCommands(command, arguments, clientid, accountid)
|
||||||
|
if reply is not None:
|
||||||
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
_ba.screenmessage(reply, color=(0,1,0), transient=True)
|
||||||
|
else:
|
||||||
|
if command in set.availablecommands:
|
||||||
|
cost_of_command = set.availablecommands[command]
|
||||||
|
have_coins = nc.getcoins(accountid)
|
||||||
|
if have_coins >= cost_of_command:
|
||||||
|
NewCmds.NewCommands(command, arguments, clientid, accountid)
|
||||||
|
cc.addcoins(accountid, cost_of_command * -1)
|
||||||
|
sendall(f"Success! /{command} cost you {tic}{cost_of_command}.")
|
||||||
|
else:
|
||||||
|
send(f"You need {tic}{cost_of_command} for that. You have {tic}{have_coins} only.", clientid)
|
||||||
else:
|
else:
|
||||||
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
_ba.screenmessage(u"\ue049|| \ue00cCOMMAND NOT FOR KIDS\ue00c ||\ue049", color=(1, 0, 0), transient=True,
|
||||||
clients=[clientid])
|
clients=[clientid])
|
||||||
|
|
@ -134,7 +181,7 @@ def Command(msg, clientid):
|
||||||
prefixes = settings["CmdChatDisable"]["Commands"]
|
prefixes = settings["CmdChatDisable"]["Commands"]
|
||||||
if any(msg.startswith(f"/{prefix}") for prefix in prefixes) and settings["CmdChatDisable"]["disable"]:
|
if any(msg.startswith(f"/{prefix}") for prefix in prefixes) and settings["CmdChatDisable"]["disable"]:
|
||||||
return None
|
return None
|
||||||
elif msg.startswith("/comp") and not settings["compChatText"]:
|
elif msg.startswith("/comp") or msg.startswith("/complaint") and not settings["compChatText"]:
|
||||||
return None # Disable the "/comp" command if compChatText setting is False
|
return None # Disable the "/comp" command if compChatText setting is False
|
||||||
elif settings["ChatCommands"]["BrodcastCommand"]:
|
elif settings["ChatCommands"]["BrodcastCommand"]:
|
||||||
return msg
|
return msg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue