mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
added chat command for ping and hideid
/ping , /ping 113 , /hideid /showid
This commit is contained in:
parent
23c0fa7a9b
commit
7f11eca20b
6 changed files with 487 additions and 450 deletions
|
|
@ -34,6 +34,8 @@ Here you can ban player , mute them , disable their kick votes
|
|||
- Rank System.
|
||||
- Chat commands.
|
||||
- V2 Account with cloud console for server.
|
||||
- check clients ping , use /ping chat command to check ping of any player._ba.get_client_ping().
|
||||
- Hide player specs from cleints, chatcommand /hideid /showid .
|
||||
- Easy role management , create 1000 of roles as you wish add specific chat command to the role , give tag to role ..many more.
|
||||
- Rejoin cooldown.
|
||||
- Leaderboard , top 3 rank players name on top right corner.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import ba, _ba, time, setting
|
|||
import ba.internal
|
||||
import _thread
|
||||
from tools import playlist
|
||||
Commands = ['lm', 'gp', 'party', 'quit', 'kickvote','maxplayers','playlist','ban','kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand','getroles', 'removecmd', 'changetag','customtag','customeffect','add', 'spectators', 'lobbytime']
|
||||
Commands = ['showid','hideid','lm', 'gp', 'party', 'quit', 'kickvote','maxplayers','playlist','ban','kick', 'remove', 'end', 'quit', 'mute', 'unmute', 'slowmo', 'nv', 'dv', 'pause', 'cameramode', 'createrole', 'addrole', 'removerole', 'addcommand', 'addcmd', 'removecommand','getroles', 'removecmd', 'changetag','customtag','customeffect','add', 'spectators', 'lobbytime']
|
||||
CommandAliases = ['max','rm', 'next', 'restart', 'mutechat', 'unmutechat', 'sm', 'slow', 'night', 'day', 'pausegame', 'camera_mode', 'rotate_camera','effect']
|
||||
|
||||
|
||||
|
|
@ -36,7 +36,10 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
|||
end(arguments)
|
||||
elif command == 'kickvote':
|
||||
kikvote(arguments, clientid)
|
||||
|
||||
elif command == 'hideid':
|
||||
hide_player_spec()
|
||||
elif command == "showid":
|
||||
show_player_spec()
|
||||
elif command == 'lm':
|
||||
last_msgs(clientid)
|
||||
|
||||
|
|
@ -109,6 +112,13 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
|||
elif command == 'lobbytime':
|
||||
change_lobby_check_time(arguments)
|
||||
|
||||
|
||||
def hide_player_spec():
|
||||
_ba.hide_player_device_id(True)
|
||||
|
||||
def show_player_spec():
|
||||
_ba.hide_player_device_id(False)
|
||||
|
||||
def changepartysize(arguments):
|
||||
if len(arguments)==0:
|
||||
ba.internal.chatmessage("enter number")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import ba.internal
|
|||
from stats import mystats
|
||||
from ba._general import Call
|
||||
import _thread
|
||||
Commands = ['me', 'list', 'uniqeid']
|
||||
Commands = ['me', 'list', 'uniqeid','ping']
|
||||
CommandAliases = ['stats', 'score', 'rank', 'myself', 'l', 'id', 'pb-id', 'pb', 'accountid']
|
||||
|
||||
|
||||
|
|
@ -31,10 +31,30 @@ def ExcelCommand(command, arguments, clientid, accountid):
|
|||
elif command in ['uniqeid', 'id', 'pb-id', 'pb' , 'accountid']:
|
||||
accountid_request(arguments, clientid, accountid)
|
||||
|
||||
elif command in ['ping']:
|
||||
get_ping(arguments, clientid)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_ping(arguments, clientid):
|
||||
if arguments == [] or arguments == ['']:
|
||||
send(f"Your ping {_ba.get_client_ping(clientid)}ms ", clientid)
|
||||
|
||||
else:
|
||||
try:
|
||||
session = ba.internal.get_foreground_host_session()
|
||||
|
||||
for index, player in enumerate(session.sessionplayers):
|
||||
name = player.getname(full=True,icon = False),
|
||||
if player.inputdevice.client_id == int(arguments[0]):
|
||||
ping = _ba.get_client_ping(int(arguments[0]))
|
||||
send(f" {name}'s ping {ping}ms", clientid)
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def stats(ac_id,clientid):
|
||||
stats=mystats.get_stats_by_id(ac_id)
|
||||
if stats:
|
||||
|
|
@ -87,4 +107,3 @@ def accountid_request(arguments, clientid, accountid):
|
|||
except:
|
||||
return
|
||||
|
||||
|
||||
3
dist/ba_root/mods/custom_hooks.py
vendored
3
dist/ba_root/mods/custom_hooks.py
vendored
|
|
@ -89,6 +89,7 @@ def bootstraping():
|
|||
_ba.set_server_name(settings["HostName"])
|
||||
_ba.set_transparent_kickvote(settings["ShowKickVoteStarterName"])
|
||||
_ba.set_kickvote_msg_type(settings["KickVoteMsgType"])
|
||||
_ba.hide_player_device_id(settings["Anti-IdRevealer"])
|
||||
|
||||
# check for auto update stats
|
||||
_thread.start_new_thread(mystats.refreshStats, ())
|
||||
|
|
@ -122,6 +123,8 @@ def bootstraping():
|
|||
if settings["whitelist"]:
|
||||
pdata.load_white_list()
|
||||
|
||||
#
|
||||
|
||||
import_discord_bot()
|
||||
import_games()
|
||||
import_dual_team_score()
|
||||
|
|
|
|||
6
dist/ba_root/mods/features/EndVote.py
vendored
6
dist/ba_root/mods/features/EndVote.py
vendored
|
|
@ -5,7 +5,7 @@ import ba.internal
|
|||
import time
|
||||
|
||||
last_end_vote_start_time = 0
|
||||
end_vote_duration = 30
|
||||
end_vote_duration = 50
|
||||
game_started_on = 0
|
||||
min_game_duration_to_start_end_vote = 30
|
||||
|
||||
|
|
@ -66,6 +66,8 @@ def required_votes(players):
|
|||
return 4
|
||||
elif players == 8:
|
||||
return 4
|
||||
elif players == 10:
|
||||
return 5
|
||||
else:
|
||||
return players - 4
|
||||
|
||||
|
|
@ -90,7 +92,7 @@ def update_vote_text(votes_needed):
|
|||
votes_needed)
|
||||
})).autoretain()
|
||||
activity.end_vote_text = node
|
||||
ba.timer(10, remove_vote_text)
|
||||
ba.timer(20, remove_vote_text)
|
||||
|
||||
|
||||
def remove_vote_text():
|
||||
|
|
|
|||
1
dist/ba_root/mods/setting.json
vendored
1
dist/ba_root/mods/setting.json
vendored
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"whitelist": false,
|
||||
"useV2Account": false,
|
||||
"Anti-IdRevealer": false,
|
||||
"ChatCommands": {
|
||||
"BrodcastCommand": true
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue