mirror of
https://repo.or.cz/minetest_playereffects.git
synced 2025-01-09 18:40:18 +01:00
Add “cancelall” example (cancels user’s effects)
This commit is contained in:
parent
4ef959c78e
commit
0ea070a3bd
15
examples.lua
15
examples.lua
@ -165,6 +165,21 @@ minetest.register_chatcommand("fly", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Cancel all active effects
|
||||||
|
]]
|
||||||
|
minetest.register_chatcommand("cancelall", {
|
||||||
|
params = "",
|
||||||
|
description = "Cancels all your effects.",
|
||||||
|
privs = {},
|
||||||
|
func = function(name, param)
|
||||||
|
local effects = playereffects.get_player_effects(name)
|
||||||
|
for e=1, #effects do
|
||||||
|
playereffects.cancel_effect(effects[e].effect_id)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
--[[ The stress test applies a shitload of effects at once.
|
--[[ The stress test applies a shitload of effects at once.
|
||||||
This is used to test the performance of this mod at very large effect numbers. ]]
|
This is used to test the performance of this mod at very large effect numbers. ]]
|
||||||
minetest.register_chatcommand("stresstest", {
|
minetest.register_chatcommand("stresstest", {
|
||||||
|
Loading…
Reference in New Issue
Block a user