893 B
893 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 g2o
@g2o.event('onPlayerChangeFocus')
def onChangeFocus(**kwargs):
focusId = kwargs['newFocusId']
if focusId != -1:
print(f'Player {kwargs['playerid']} is looking at {focusId}')
else
print(f'Player {kwargs['playerid']} is looking at... who?')