local closeServer = TalkAction("/closeserver")

function closeServer.onSay(player, words, param)
	if not player:getGroup():getAccess() or player:getAccountType() < ACCOUNT_TYPE_GOD then
		return true
	end

	if param == "shutdown" then
		Game.setGameState(GAME_STATE_SHUTDOWN)
	else
		Game.setGameState(GAME_STATE_CLOSED)
		player:sendTextMessage(MESSAGE_LOOK, "Server is now closed.")
	end
	return false
end

closeServer:separator(" ")
closeServer:register()
