player.killer_type_is

When called on the exact script tick after a player's death, this function can be used to check the general circumstances of the player's death. Calling this function with all permitted values is the primary way to react to a player's death at the instant that it occurs.

Arguments

types

The word none, or one or more of the following flags separated with the | symbol:

guardians
The player was killed by a level boundary or unexplained force.
suicide
The player killed themselves.
kill
The player was killed by an enemy.
betrayal
The player was betrayed by a teammate.
quit
The player died because they quit or disconnected from the match.

Example

alias opt_kill_points = script_option[1]
alias opt_spree_bonus = script_option[0]

for each player do
   if current_player.killer_type_is(kill) then
      alias killer = global.player[0]
      --
      killer = current_player.get_killer()
      killer.score += opt_kill_points
      global.number[0]  = killer.get_spree_count()
      global.number[0] %= 5
      if global.number[0] == 0 then
         --
         -- This is the player's 5th, 10th, 15th, etc., kill.
         --
         killer.score += opt_spree_bonus
      end
   end
end

See also