Jump to content

Kill events no longer contain a valid player name in the initiator.


Recommended Posts

Posted

When we catch a kill event in a script, we no longer get a valid player name attached with the event. So we know something died, we know what died, but we have no idea who did it.

I've tried all sorts of weapons, always with the same result.

Posted

I didn't know that the event ever passed a player name with the event, neither for victim nor victor. You should be able to derive the victor with initiator:getPlayerName() - if the result is non-nil a player killed event.target. Be sure to guard initiator.getPlayerName against not being implemented.

If target still exists, you can likewise get the player's name who got killed. Else, catch the birth and playerEnterUnit events, and note down that unit's name indexed by the player who controls it. When the kill event comes, simply looking up the unit's name in your list should return the name of the player who got deep-sixed.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...