::flagTest <- { OnGameEvent_player_spawn = function(params) { local player = GetPlayerFromUserID(params.userid) if(!IsPlayerABot(player)) { return } EntFireByHandle(player, "runscriptcode", "flagTest.squadded()", -1, player, null) //ClientPrint(null, 3, player.entindex() + " spawned") } squadded = function() { if(activator.IsInASquad()) { activator.ValidateScriptScope() activator.GetScriptScope().think <- function() { if(!self.IsInASquad()) { ClientPrint(null, 3, self.entindex() + " left squad at " + Time()) AddThinkToEnt(self, null) NetProps.SetPropString(self, "m_iszScriptThinkFunction", "") return -1 } } AddThinkToEnt(activator, "think") } } OnGameEvent_player_death = function(params) { local player = GetPlayerFromUserID(params.userid) if(!IsPlayerABot(player)) { return } ClientPrint(null, 3, player.entindex() + " died at " + Time()) } forceRespawn = function() { local aBomb = Entities.FindByName(null, "intel_a"); local bBomb = Entities.FindByName(null, "intel_b"); NetProps.SetPropBool(aBomb, "m_bReturnBetweenWaves", false) NetProps.SetPropBool(bBomb, "m_bReturnBetweenWaves", false) NetProps.SetPropInt(aBomb, "m_nFlagStatus", 2) NetProps.SetPropInt(bBomb, "m_nFlagStatus", 2) EntFire("spawnbot_placeholder*", "disable") EntFire("spawnbot_a", "disable") EntFire("spawnbot_invasion", "disable") aBomb.SetAbsOrigin(Vector(1159, -367, 928)) bBomb.SetAbsOrigin(Vector(-1213, 605, 1120)) for(local i = 1; i <= 100; i++) { local player = PlayerInstanceFromIndex(i) if (player == null) continue if (player.GetTeam() == 2) continue player.ForceChangeTeam(3, true) //player.ForceRegenerateAndRespawn() } } OnGameEvent_recalculate_holidays = function(_) { if(GetRoundState() == 3) { local aBomb = Entities.FindByName(null, "intel_a"); local bBomb = Entities.FindByName(null, "intel_b"); ClientPrint(null, 3, "map reloaded at " + Time()) ClientPrint(null, 3, "aBomb at " + aBomb.GetOrigin()) ClientPrint(null, 3, "bBomb at " + bBomb.GetOrigin()) aBomb.ValidateScriptScope() aBomb.GetScriptScope().think <- function() { printl(Time() + " bomb") return 1 } AddThinkToEnt(aBomb, "think") } } OnGameEvent_mvm_wave_complete = function(params) { ClientPrint(null, 3, "wave finished at " + Time()) } } __CollectGameEventCallbacks(flagTest)