Public feed
#378758
function Arena_OnGameEnd() g_bGameRunning = false g_redTeamPoints = 0 g_blueTeamPoints = 0 -- Let's go through all the players on the winning team and change them to the 'Celeb' vehicle (104) for x = 1, g_arena:num() do player = g_arena:get(x) if (player:getTeam().m_name == g_winningTeam) then player:setVehicle(104) end end ---==== New sorting algorithm ====--- -- Lets go through all the players in the arena, and set them on the blue team local numplayers = 0 for x = 1, g_arena:num() do player = g_arena:get(x) if (player:spectator() == false) then player:team_change("Blue Team", "") numplayers = (numplayers + 1) end end -- Now lets change half of them to the red team! for x = 1, (numplayers / 2) do player = g_arena:get(math.random(1, g_arena:num())) if ((player:spectator() == false) and (player:getTeam().m_name == "Blue Team")) then player:team_change("Red Team", "") else x = (x - 1) end end -- Alert the players g_arena:message("Teams have been scrambled")end