From 1e2e9721e602fbebf148b7d717f6d33778b877aa Mon Sep 17 00:00:00 2001 From: Kimapr Date: Sun, 29 Dec 2019 21:58:05 +0500 Subject: [PATCH] no cooldown for admins --- nc_sky_isgen/init.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nc_sky_isgen/init.lua b/nc_sky_isgen/init.lua index 3bd8447..adb52de 100644 --- a/nc_sky_isgen/init.lua +++ b/nc_sky_isgen/init.lua @@ -497,13 +497,15 @@ minetest.register_chatcommand("reset",{ description = S"Get a new island", privs = {interact = true}, func = function(name) - local utime = minetest.get_server_uptime() - local cd = cooldowns[name] - if cd and cd > utime then - minetest.chat_send_player(name,S("You can't get a new island yet. Wait @1 secs.",(cd-utime))) - return + if not minetest.check_player_privs(name,{server=true}) then + local utime = minetest.get_server_uptime() + local cd = cooldowns[name] + if cd and cd > utime then + minetest.chat_send_player(name,S("You can't get a new island yet. Wait @1 secs.",(cd-utime))) + return + end + cooldowns[name] = utime + cooldown end - cooldowns[name] = utime + cooldown local is = players[name] if is then players[name] = nil