local _root = getroottable() ::WEAPON_COUNT <- 8 function IncludeScriptWeather(path) { try IncludeScript(format("weather_wars_scripts/%s", path), _root) catch(e) printl(e) } IncludeScriptWeather("sandman_homing.nut") function GetItemInSlot(player, slot) { local item for (local i = 0; i < WEAPON_COUNT; i++) { local wep = NetProps.GetPropEntityArray(player, "m_hMyWeapons", i) if ( wep == null || wep.GetSlot() != slot) continue item = wep break } return item } ::WeatherNamespace <- { Cleanup = function() { // cleanup any persistent changes here // keep this at the end delete ::WeatherNamespace } // mandatory events OnGameEvent_recalculate_holidays = function(_) { if (GetRoundState() == 3) Cleanup() } OnGameEvent_mvm_wave_complete = function(_) { Cleanup() } // add stored variables or your own events here // // e.g. // myvar = 123 // // OnGameEvent_player_death = function(params) // { ... } OnGameEvent_player_spawn = function(params) { local player = GetPlayerFromUserID(params.userid) player.ValidateScriptScope() local playerscope = player.GetScriptScope() } }; __CollectGameEventCallbacks(WeatherNamespace)