860 B
860 B
event onPlayerChangeColor
This event is triggered when player nickname color was changed for all players.
Original: onPlayerChangeColor
Parameters
dictkwargs:intplayerid: the id of the player whose nickname color was changed.intr: the amount of red in the nickname color(0 - 255).intg: the amount of green in the nickname color(0 - 255).intb: the amount of blue in the nickname color(0 - 255).
Usage
import pyg2o as g2o
@g2o.event('onPlayerChangeColor')
async def onChangeColor(playerid, r, g, b):
rgbColor = tuple(r, g, b)
hexColor = '#%02x%02x%02x' % rgbColor
print(f'Player {playerid} changed his color to {hexColor}')