mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
Added new files
This commit is contained in:
parent
867634cc5c
commit
3a407868d4
1775 changed files with 550222 additions and 0 deletions
54
dist/ba_root/mods/chatHandle/ChatCommands/commands/Handlers.py
vendored
Normal file
54
dist/ba_root/mods/chatHandle/ChatCommands/commands/Handlers.py
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
""" Some useful handlers to reduce lot of code """
|
||||
import _ba, ba
|
||||
import ba.internal
|
||||
|
||||
|
||||
|
||||
def send(msg, clientid):
|
||||
"""Shortcut To Send Private Msg To Client"""
|
||||
for m in msg.split("\n"):
|
||||
ba.internal.chatmessage(str(m), clients=[clientid])
|
||||
_ba.screenmessage(str(msg), transient=True, clients=[clientid])
|
||||
|
||||
def sendchatclid(msg, clientid):
|
||||
"""Shortcut To Send Private Msg To Client"""
|
||||
for m in msg.split("\n"):
|
||||
ba.internal.chatmessage(str(m), clients=[clientid])
|
||||
|
||||
def sendmsgclid(msg, clientid):
|
||||
"""Shortcut To Send Private Msg To Client"""
|
||||
_ba.screenmessage(str(msg), transient=True, clients=[clientid])
|
||||
|
||||
def sendall(msg):
|
||||
"""Shortcut To Send Private Msg To Client"""
|
||||
for m in msg.split("\n"):
|
||||
ba.internal.chatmessage(str(m))
|
||||
_ba.screenmessage(str(msg), transient=True)
|
||||
|
||||
def sendchat(msg):
|
||||
"""Shortcut To Send Private Msg To Client"""
|
||||
for m in msg.split("\n"):
|
||||
ba.internal.chatmessage(str(m))
|
||||
|
||||
def clientid_to_myself(clientid):
|
||||
"""Return Player Index Of Self Player"""
|
||||
|
||||
for i , player in enumerate(_ba.get_foreground_host_activity().players):
|
||||
if player.sessionplayer.inputdevice.client_id == clientid:
|
||||
return i
|
||||
|
||||
def handlemsg(client, msg):
|
||||
"""Handles Spaz Msg For Single Player"""
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
activity.players[client].actor.node.handlemessage(msg)
|
||||
|
||||
def handlemsg_all(msg):
|
||||
"""Handle Spaz message for all players in activity"""
|
||||
|
||||
activity = _ba.get_foreground_host_activity()
|
||||
|
||||
for i in activity.players:
|
||||
i.actor.node.handlemessage(msg)
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue