function PlayerCount takes nothing returns nothing
local integer AmountOfPlayers = 0
local integer i = 0
loop
if GetPlayerSlotState(ConvertedPlayer((i))) == PLAYER_SLOT_STATE_PLAYING and ConvertedPlayer((i)) == MAP_CONTROL_USER then
set AmountOfPlayers = AmountOfPlayers + 1
endif
set i = i + 1
exitwhen i >= 11
endloop
endfunction