mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 04:06:39 +09:00
Bonus Fixed and Admin Bring Fixed
This commit is contained in:
@@ -19,7 +19,7 @@ local settings = {
|
||||
|
||||
local function _bonus(reset)
|
||||
global.addons = not reset and global.addons or {}
|
||||
global.addons.homes = not reset and global.addons.bonus or {}
|
||||
global.addons.bonus = not reset and global.addons.bonus or {}
|
||||
return global.addons.bonus
|
||||
end
|
||||
|
||||
@@ -36,14 +36,14 @@ Event.register(defines.events.rank_change,function(event)
|
||||
local player = Game.get_player(event)
|
||||
if event.new_rank:allowed('bonus') then
|
||||
for _,setting in pairs(settings) do player[setting.key] = setting.scale*0.2 end
|
||||
_bonus()[player.index]=0.2
|
||||
_bonus()[player.index]=20
|
||||
else
|
||||
for _,setting in pairs(settings) do player[setting.key] = 0 end
|
||||
_bonus()[player.index]=nil
|
||||
end
|
||||
end)
|
||||
|
||||
Event.register(defines.events.on_player_respawned,fucntion(event)
|
||||
Event.register(defines.events.on_player_respawned,function(event)
|
||||
local player = Game.get_player(event)
|
||||
local bonus = _bonus()[player.index]
|
||||
if bonus then
|
||||
@@ -54,6 +54,6 @@ end)
|
||||
Event.register(defines.events.on_player_died,function(event)
|
||||
local player = Game.get_player(event)
|
||||
if Ranking.get_rank(player):allowed('bonus-respawn') then
|
||||
player.ticks_to_respawn = nil
|
||||
player.ticks_to_respawn = 0
|
||||
end
|
||||
end)
|
||||
@@ -92,7 +92,7 @@ local take_action = Gui.inputs.add{
|
||||
local _rank = Ranking.get_rank(_player)
|
||||
if rank.power >= _rank.power then dropdowns.warning.caption = {'admin-commands.rank-high'} return end
|
||||
local _reason = dropdowns['reason-input-admin-commands'] and dropdowns['reason-input-admin-commands'].text
|
||||
if selected == 'Jail' or selected == 'Kick' or selected == 'Ban' or selected == 'Temp Ban' and _reason == 'Enter Reason' or string.len(_reason) < 20 then return end
|
||||
if (selected == 'Jail' or selected == 'Kick' or selected == 'Ban' or selected == 'Temp Ban') and (_reason == 'Enter Reason' or string.len(_reason) < 20) then return end
|
||||
Admin.take_action(_action,_player,event.player_index,_reason)
|
||||
Gui.center.clear(event)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user