if argument 1 is "join":
if argument 2 is set:
if {tcoh.arena.%player%} is not set:
loop {tcoh.arenas::*}:
add player to {tcoh.list.%argument 2%::*}
loop-value is arg 2
set {tcoh.arena.%player%} to argument 2
set {tcoh.player.count.%{tcoh.arena.%player%}%} to {tcoh.player.count.%{tcoh.arena.%player%}%}+1
send "%{_prefix}% &aYou have joined &2%argument 2%&a."
teleport player to {tcoh.map.%{tcoh.arena.%player%}%.Lobby}
stop
send "%{_prefix}% &cThat arena doesn't exists."
else:
message "You cannot join a game you are already in."
else:
message "%{_prefix}% &aYou have joined the lobby."
teleport player to {tcoh.spawns.lobby}
if argument 1 is "leave":
if player has permission "tcoh.command.player":
if {tcoh.arena.%player%} is not set:
message "%{_prefix}% &cYou can not leave a game you are not in."
stop
if {tcoh.arena.%player%} is set:
remove player from {tcoh.list.%{tcoh.arena.%player%}%::*}
remove 1 from {tcoh.joinedtotal.%{tcoh.arena.%player%}%}
set line 3 of {tcoh.map.SignLocation::%{tcoh.arena.%player%}%} to "%{tcoh.joinedtotal.%{tcoh.arena.%player%}%}%/%{tcoh.settings.max player requirement::*}%"
message "%{_prefix}% &aYou have left from &2%{tcoh.arena.%player%}%&a."
delete {tcoh.ingame.%player%::*}
teleport the player to {tcoh.spawns.lobby}
delete {tcoh.arena.%player%}
stop