Skip to content

Commit

Permalink
Document suicide event
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewda committed Aug 10, 2016
1 parent 03146f3 commit 4f28248
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ Emitted whenever HLTV sends us a scoreboard update. The scoreboard may not be an

Emitted after every kill.

### suicide
- `player` - The player object of the suicider

Emitted after a player commits suicide.

### bombPlanted
- `player` - The player object of the bomb planter

Expand Down
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ Livescore.prototype._onKill = function(event) {
};

Livescore.prototype._onSuicide = function(event) {
self.emit('suicide', {
playerName: event.playerName,
playerSide: event.side
self.getPlayers(function(players) {
self.emit('suicide', {
player: players[event.playerName]
});
});
};

Expand Down

0 comments on commit 4f28248

Please sign in to comment.