From 059cc9a21250b95e0e728657891c66f8c382c7a9 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 13 Jan 2018 13:52:06 +0000 Subject: [PATCH] Added a can_open function --- Addons/Guis/polls.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Addons/Guis/polls.lua b/Addons/Guis/polls.lua index fde4b336..2d2dcf86 100644 --- a/Addons/Guis/polls.lua +++ b/Addons/Guis/polls.lua @@ -231,5 +231,10 @@ Gui.popup.add{ direction='vertical' } draw_poll(flow) + end, + can_open=function(player) + if #_polls().old > 0 then return true + elseif Ranking.get_rank(player):allowed('create-poll') then return true + else return {'polls.no-poll'} end end } \ No newline at end of file