mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 06:11:47 +02:00
[action_timers & pclasses] Limit class switch to one per houre
- Create a wrapper for the action_timers - Limit the use of class switch orbs to one use per hour - Related to #183
This commit is contained in:
@ -42,7 +42,14 @@ minetest.register_entity("pclasses:item", {
|
||||
self.object:set_properties(prop)
|
||||
end,
|
||||
on_rightclick = function(self, clicker)
|
||||
pclasses.api.set_player_class(clicker:get_player_name(), self.class)
|
||||
action_timers.wrapper(
|
||||
clicker:get_player_name(),
|
||||
"class switch",
|
||||
"class_switch_" .. clicker:get_player_name(),
|
||||
3600,
|
||||
pclasses.api.set_player_class,
|
||||
{clicker:get_player_name(), self.class}
|
||||
)
|
||||
end,
|
||||
on_activate = function(self, staticdata)
|
||||
local tab = minetest.deserialize(staticdata)
|
||||
|
Reference in New Issue
Block a user