gives a player fortress points and displays a HUD message whenever a player disables security

This commit is contained in:
alaswell 2015-05-17 19:16:20 -06:00
parent c001832e96
commit 827af8a859

View file

@ -88,6 +88,8 @@ function button_common:allowed( allowed_entity )
if IsPlayer( allowed_entity ) then if IsPlayer( allowed_entity ) then
local player = CastToPlayer( allowed_entity ) local player = CastToPlayer( allowed_entity )
if player:GetTeamId() == self.team and player:IsAlive() then if player:GetTeamId() == self.team and player:IsAlive() then
player:AddFortPoints(100, "disabled security")
ObjectiveNotice( player, "disabled security" )
return EVENT_ALLOWED return EVENT_ALLOWED
end end
end end
@ -212,6 +214,9 @@ function base_security_trigger:ontrigger( player )
-- only take sec down if its up currently -- only take sec down if its up currently
local button = _G[self.button] local button = _G[self.button]
if button and button.sec_up then if button and button.sec_up then
local player = CastToPlayer( player )
player:AddFortPoints(100, "disabled security")
ObjectiveNotice( player, "disabled security" )
self:onsecuritydown( player ) self:onsecuritydown( player )
end end
end end