Created
October 26, 2013 03:03
-
-
Save DexterHaslem/7164848 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IncludeScript("base_ctf") | |
| IncludeScript("base_location") | |
| IncludeScript("base_respawnturret") | |
| function startup() | |
| SetGameDescription("Capture the Flag") | |
| SetPlayerLimit(Team.kBlue, 0) | |
| SetPlayerLimit(Team.kRed, 0) | |
| SetPlayerLimit(Team.kYellow, -1) | |
| SetPlayerLimit(Team.kGreen, -1) | |
| local team = GetTeam(Team.kBlue) | |
| team:SetClassLimit(Player.kCivilian, -1) | |
| team = GetTeam(Team.kRed) | |
| team:SetClassLimit(Player.kCivilian, -1) | |
| end | |
| function gen_onclank( player ) | |
| -- add any thing you want to happen when the generator is hit by a wrench (while its detted) here | |
| ConsoleToAll("gen_onclank") | |
| end | |
| base_gen = func_button:new({ team = Team.kUnassigned }) | |
| NUM_HITS_TO_REPAIR = 10 | |
| FORT_POINTS_PER_REPAIR = 100 | |
| generators = | |
| { | |
| status = 0, | |
| repair_status = 0 | |
| } | |
| function base_gen:ondamage() | |
| if info_classname == "ff_weapon_spanner" then | |
| generators.repair_status = generators.repair_status + 1 | |
| if generators.repair_status >= NUM_HITS_TO_REPAIR then | |
| local player = CastToPlayer( GetPlayerByID(info_attacker) ) | |
| player:AddFortPoints( FORT_POINTS_PER_REPAIR, "Repairing the Crane" ) | |
| OutputEvent( "beam2", "TurnOn" ) | |
| OutputEvent( "tele_2_trigger", "Enable" ) | |
| BroadCastMessage("Beam 2 has been activated") | |
| generators.repair_status = 0 | |
| else | |
| gen_onclank( player ) | |
| end | |
| end | |
| return true | |
| end | |
| engy_spanner_button = base_gen:new({ team = Team.kUnassigned }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment