Add register_on_eliminate global callback
parent
df913d63d7
commit
c32530bde9
1
DOCS.md
1
DOCS.md
|
@ -171,6 +171,7 @@ Global callbacks act in the same way of minigame callbacks with the same name. K
|
||||||
* `arena_lib.register_on_join(function(mod_ref, arena, p_name, as_spectator))`
|
* `arena_lib.register_on_join(function(mod_ref, arena, p_name, as_spectator))`
|
||||||
* `arena_lib.register_on_celebration(function(mod_ref, arena, winners))`
|
* `arena_lib.register_on_celebration(function(mod_ref, arena, winners))`
|
||||||
* `arena_lib.register_on_end(function(mod_ref, arena, players, winners, spectators, is_forced))`
|
* `arena_lib.register_on_end(function(mod_ref, arena, players, winners, spectators, is_forced))`
|
||||||
|
* `arena_lib.register_on_eliminate(function(mod_ref, arena, p_name))`
|
||||||
* `arena_lib.register_on_quit(function(mod_ref, arena, p_name, is_spectator, reason))`
|
* `arena_lib.register_on_quit(function(mod_ref, arena, p_name, is_spectator, reason))`
|
||||||
|
|
||||||
Let's say we want to stop people to enter minigames when there is an event on our server. We can simply do:
|
Let's say we want to stop people to enter minigames when there is an event on our server. We can simply do:
|
||||||
|
|
|
@ -891,6 +891,10 @@ function eliminate_player(mod_ref, arena, p_name, executioner)
|
||||||
if mod_ref.on_eliminate then
|
if mod_ref.on_eliminate then
|
||||||
mod_ref.on_eliminate(arena, p_name)
|
mod_ref.on_eliminate(arena, p_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for _, callback in ipairs(arena_lib.registered_on_eliminate) do
|
||||||
|
callback(mod_ref, arena, p_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ arena_lib.registered_on_start, arena_lib.register_on_start = make_registration()
|
||||||
arena_lib.registered_on_celebration, arena_lib.register_on_celebration = make_registration()
|
arena_lib.registered_on_celebration, arena_lib.register_on_celebration = make_registration()
|
||||||
arena_lib.registered_on_end, arena_lib.register_on_end = make_registration()
|
arena_lib.registered_on_end, arena_lib.register_on_end = make_registration()
|
||||||
arena_lib.registered_on_join, arena_lib.register_on_join = make_registration()
|
arena_lib.registered_on_join, arena_lib.register_on_join = make_registration()
|
||||||
|
arena_lib.registered_on_eliminate, arena_lib.register_on_eliminate = make_registration()
|
||||||
arena_lib.registered_on_quit, arena_lib.register_on_quit = make_registration()
|
arena_lib.registered_on_quit, arena_lib.register_on_quit = make_registration()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue