883 B
883 B
event onPlayerChangeFocus
This event is triggered when player targets another player.
Original: onPlayerChangeFocus
Parameters
dictkwargs:intplayerid: the id of the player which changes the focus.intoldFocusId: the old playerid targeted by the player. Can be-1if player wasn't targeting other player.intnewFocusId: the new playerid targeted by the player. Can be-1if player doesn't target anyone.
Usage
import pyg2o as g2o
@g2o.event('onPlayerChangeFocus')
async def onChangeFocus(playerid, oldFocusId, newFocusId):
if newFocusId != -1:
print(f'Player {playerid} is looking at {newFocusId}')
else
print(f'Player {playerid} is looking at... who?')